diff --git a/apiary.apib b/apiary.apib index 74b511a..d401009 100644 --- a/apiary.apib +++ b/apiary.apib @@ -413,12 +413,540 @@ MerkleDAG. ## stat # Group bootstrap +Show or edit the list of bootstrap peers. -## add +Running `ipfs bootstrap` with no arguments will run `ipfs bootstrap list`. -## list +**Security Warning**: -## rm +The bootstrap command manipulates the `bootstrap list`, which contains +the addresses of bootstrap nodes. These are the *trusted peers* from +which to learn about other peers in the network. Only edit this list +if you understand the risks of adding or removing nodes from this list. + ++ Request No Subcommands + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap + ``` + ++ Response 200 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 22:29:38 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (object) + + Peers (array) + - (MultiAddr) + + + Body + + ``` + { + "Peers": [ + "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", + "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z", + "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM", + "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm", + "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu", + "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64", + "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", + "/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3", + "/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx" + ] + } + ``` + +## add [GET /bootstrap/add{?arg}{&default}] +Add peers to the bootstrap list. + +Outputs a list of peers that were added (that weren't already +in the bootstrap list). + ++ Parameters + + arg (MultiAddr, required) - A peer to add to the bootstrap list. + + default (boolean, optional) - Add default bootstrap nodes. + ++ Request No Arguments + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/add + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/add + ``` + ++ Response 400 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 22:36:08 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (Error) + - Message: "no bootstrap peers to add" + - Code: 1 + + + Body + + ``` + { + "Message": "no bootstrap peers to add", + "Code": 1 + } + ``` + ++ Request Invalid Argument + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/add?arg=QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/add?arg=QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ + ``` + ++ Response 500 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 22:39:48 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (Error) + - Message: "invalid multiaddr, must begin with /" + - Code: 0 + + + Body + + ``` + { + "Message": "invalid multiaddr, must begin with /", + "Code": 0 + } + ``` + ++ Request Empty Argument + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/add?arg= + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/add?arg= + ``` + ++ Response 500 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 22:41:16 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (Error) + - Message: "invalid ipfs address" + - Code: 0 + + + Body + + ``` + { + "Message": "invalid ipfs address", + "Code": 0 + } + ``` + ++ Request Valid Argument + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/add?arg=/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/add?arg=/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z + ``` + ++ Response 200 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 22:42:45 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (object) + + Peers (array) + - (MultiAddr) + + + Body + + ``` + { + "Peers": [ + "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z" + ] + } + ``` + ++ Request Default Option + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/add?default + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/add?default + ``` + ++ Response 200 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 22:38:09 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (object) + + Peers (array) + - (MultiAddr) + + + Body + + ``` + { + "Peers": [ + "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", + "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z", + "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM", + "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm", + "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu", + "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64", + "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", + "/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3", + "/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx" + ] + } + ``` + + +## list [GET /bootstrap/list] +Show peers in the bootstrap list + ++ Request Without Options + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/list + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/list + ``` + ++ Response 200 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 22:51:06 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (object) + + Peers (array) + - (MultiAddr) + + Body + + ``` + { + "Peers": [ + "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z", + "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", + "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM", + "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm", + "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu", + "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64", + "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", + "/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3", + "/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx" + ] + } + ``` + +## rm [GET /bootstrap/rm{?arg}{&all}] +Removes peers from the bootstrap list. + +Outputs the list of peers that were removed. + ++ Parameters + + arg (MultiAddr, optional) - A peer to add to the bootstrap list + + all (boolean, optional) - Remove all bootstrap peers. + ++ Request Without Options + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/rm + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/rm + ``` + ++ Response 200 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 23:17:18 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (object) + + Peers: [] (array) + + + Body + + ``` + { + "Peers": [] + } + ``` + ++ Request With All + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/rm?all + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/rm?all + ``` + ++ Response 200 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 23:18:17 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (object) + + Peers (array) + - (MultiAddr) + + + Body + + ``` + { + "Peers": [ + "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z", + "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", + "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM", + "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm", + "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu", + "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64", + "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", + "/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3", + "/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx" + ] + } + ``` + ++ Request With Empty Argument + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/rm?arg= + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/rm?arg= + ``` + ++ Response 500 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 23:20:35 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (Error) + - Message: "invalid ipfs address" + - Code: 0 + + + Body + + ``` + { + "Message": "invalid ipfs address", + "Code": 0 + } + ``` + ++ Request With Invalid Argument + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/rm?arg=invalid + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/rm?arg=invalid + ``` + ++ Response 500 + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 23:21:26 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (Error) + - Message: "invalid multiaddr, must begin with /" + - Code: 0 + + + Body + + ``` + { + "Message": "invalid multiaddr, must begin with /", + "Code": 0 + } + ``` + ++ Request With Valid Argument + + #### curl + + curl -i http://localhost:5001/api/v0/bootstrap/rm?arg=/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z + + + Body + + ``` + curl -i http://localhost:5001/api/v0/bootstrap/rm?arg=/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z + ``` + ++ Response 200 (application/json) + + + Headers + + ``` + Access-Control-Allow-Headers: X-Stream-Ouptut, X-Chunked-Output + Access-Control-Expose-Headers: X-Stream-Ouptut, X-Chunked-Output + Content-Type: application/json + Trailer: X-Stream-Error + Transfer-Encoding: chunked + Date: Fri, 29 Jan 2016 23:22:34 GMT + Transfer-Encoding: chunked + ``` + + + Attributes (object) + + Peers (array) + - (Multihash) + + + Body + + ``` + { + "Peers": [] + } + ``` # Group cat