Syncing with upstream. Fixing merge conflicts

This commit is contained in:
Chris Troutner
2025-10-04 09:00:38 -07:00
+33 -11
View File
@@ -71,16 +71,25 @@ class IpfsRESTControllerLib {
} }
/** /**
* @api {POST} /ipfs/peers Get IPFS peers * @api {post} /ipfs/peers Get information on IPFS peers this node is connected to
* @apiPermission public * @apiPermission public
* @apiName GetIpfsPeers * @apiName GetIpfsPeers
* @apiGroup REST IPFS * @apiGroup REST IPFS
* *
* @apiExample Example usage: * @apiParam {Boolean} [showAll=false] Whether to include detailed peer data
* curl -H "Content-Type: application/json" -X POST -d '{ "showAll": true }' localhost:5001/ipfs/peers
* *
* @apiExample Example usage:
* curl -H "Content-Type: application/json" -X POST localhost:5001/ipfs/peers \
* -d '{"showAll": false}'
*
* @apiSuccess {Object[]} peers Array of peer objects
* @apiSuccess {String} peers[].peer Peer ID
* @apiSuccess {String} peers[].name Peer name
* @apiSuccess {String} peers[].protocol Protocol used by the peer
* @apiSuccess {String} peers[].version Peer version
* @apiSuccess {String} peers[].connectionAddr Connection address
* @apiSuccess {Object} [peers[].peerData] Detailed peer data (when showAll=true)
*/ */
// Return information on IPFS peers this node is connected to.
async getPeers (ctx) { async getPeers (ctx) {
try { try {
const showAll = ctx.request.body.showAll const showAll = ctx.request.body.showAll
@@ -96,16 +105,22 @@ class IpfsRESTControllerLib {
} }
/** /**
* @api {POST} /ipfs/relays Get IPFS relays * @api {post} /ipfs/relays Get data about the known Circuit Relays
* @apiPermission public * @apiPermission public
* @apiName GetIpfsRelays * @apiName GetIpfsRelays
* @apiGroup REST IPFS * @apiGroup REST IPFS
* *
* @apiDescription Returns information about Circuit Relays, both v1 and v2, that this node knows about. V2 relays are hydrated with peer data from the connected peers list.
*
* @apiExample Example usage: * @apiExample Example usage:
* curl -H "Content-Type: application/json" -X POST localhost:5001/ipfs/relays * curl -H "Content-Type: application/json" -X POST localhost:5001/ipfs/relays
* *
* @apiSuccessExample {json} Success-Response: * @apiSuccess {Object} relays Object containing relay information
* HTTP/1.1 200 OK * @apiSuccess {Object[]} relays.v2Relays Array of v2 Circuit Relay objects
* @apiSuccess {String} relays.v2Relays[].ipfsId IPFS ID of the relay
* @apiSuccess {String} relays.v2Relays[].name Name of the relay (hydrated from peer data)
* @apiSuccess {String} relays.v2Relays[].description Description of the relay (hydrated from peer data)
* @apiSuccess {Object[]} relays.v1Relays Array of v1 Circuit Relay configurations
*/ */
// Get data about the known Circuit Relays. Hydrate with data from peers list. // Get data about the known Circuit Relays. Hydrate with data from peers list.
async getRelays (ctx) { async getRelays (ctx) {
@@ -121,15 +136,22 @@ class IpfsRESTControllerLib {
} }
/** /**
* * @api {post} /ipfs/connect Connect to a specific IPFS peer
* @api {POST} /ipfs/connect Connect to an IPFS peer
* @apiPermission public * @apiPermission public
* @apiName ConnectToIpfsPeer * @apiName ConnectToIpfsPeer
* @apiGroup REST IPFS * @apiGroup REST IPFS
* *
* @apiExample Example usage: * @apiDescription Attempts to establish a connection to a specific IPFS peer using the provided multiaddr. Optionally returns detailed information about the connection.
* curl -H "Content-Type: application/json" -X POST -d '{ "multiaddr": "/ip4/123.45.67.89/tcp/4001/p2p/1234567890", "getDetails": true }' localhost:5001/ipfs/connect
* *
* @apiParam {String} multiaddr Multiaddress of the peer to connect to (required)
* @apiParam {Boolean} [getDetails=false] Whether to return detailed connection information
*
* @apiExample Example usage:
* curl -H "Content-Type: application/json" -X POST localhost:5001/ipfs/connect \
* -d '{"multiaddr": "/ip4/161.35.99.207/tcp/4001/p2p/12D3KooWDtj9cfj1SKuLbDNKvKRKSsGN8qivq9M8CYpLPDpcD5pu", "getDetails": false}'
*
* @apiSuccess {Boolean} success Indicates whether the connection attempt was successful
* @apiSuccess {Object} [details] Additional connection details (when getDetails=true)
*/ */
async connect (ctx) { async connect (ctx) {
try { try {