FORMAT: 1A # IPFS The API for interacting with IPFS nodes. The HTTP API is currently accepting all methods, so GET will work just as well as POST for any group. Because of this, the methods shown below are the specifications that should be adhered to, although any will work. For more, see this discussion: https://github.com/ipfs/go-ipfs/issues/2165. # Group add Add a file or directory to IPFS. ## add [POST /add{?arg}{&r,p,t,n,w,H,s,pin}] #### curl curl -F "file=@test" "http://localhost:5001/api/v0/add" + Parameters + arg (string, required) - The path to a file to be added to IPFS. + H (boolean, optional) - Hidden. Include files that are hidden. Default: false. + n (boolean, optional) - Only-hash. Only chunk and hash - do not write to disk. Default: false. + p (boolean, optional) - Progress. Stream progress data. Default: true. + pin (boolean, optional) - Pin this object when adding. Default: true. + r (boolean, optional) - Recursive. Add directory paths recursively. Default: false. + s (boolean, optional) - Chunker. Chunking algorithm to use. + t (boolean, optional) - Trickle. Use trickle-dag format for dag generation. Default: false. + w (boolean, optional) - Wrap-with-directory. Wrap files with a directory object. Default: false. + Request Single File (multipart/form-data; boundary=CUSTOM) #### Curl curl -i -H "Content-Type: multipart/form-data; boundary=CUSTOM" -d $'--CUSTOM\r\nContent-Type: multipart/octet-stream\r\nContent-Disposition: file; filename="test"\r\n\r\nHello World!\n--CUSTOM--' "http://localhost:5001/api/v0/add" + Body ``` curl -i -H "Content-Type: multipart/form-data; boundary=CUSTOM" -d $'--CUSTOM\r\nContent-Type: multipart/octet-stream\r\nContent-Disposition: file; filename="test"\r\n\r\nHello World!\n--CUSTOM--' "http://localhost:5001/api/v0/add" ``` + Response 200 Note that the response sends a 100 continuation code before a 200 code. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:36:50 GMT Transfer-Encoding: chunked ``` + Attributes + Name (string) + Hash (Multihash) + Body ``` { "Name":"test", "Hash":"QmfM2r8seH2GiRaC4esTjeraXEachRt8ZsSeGaWTPLyMoG" } ``` + Request Progress (multipart/form-data) #### Curl curl -i -F "file=@test" "http://localhost:5001/api/v0/add?p" + Body ``` curl -i -F "file=@test" "http://localhost:5001/api/v0/add?p" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:37:07 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) + Object (object) - Name: test/test (string) - Bytes: 12 (number) + Object (object) - Name: test/test (string) - Hash (Multihash) + Body ``` { "Name": "test", "Bytes": 12 } { "Name": "test", "Hash": "QmePw8gVcBMb8x6kAep6aMBAX23hCSk6iZW3i9VKkiFhu1" } ``` + Request Trickle (multipart/form-data) #### Curl curl -i -F "file=@test" "http://localhost:5001/api/v0/add?t" + Body ``` curl -i -F "file=@test" "http://localhost:5001/api/v0/add?t" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:37:21 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) + Object (object) - Name: test/test (string) - Hash (Multihash) + Body ``` { "Name": "test", "Hash": "QmePw8gVcBMb8x6kAep6aMBAX23hCSk6iZW3i9VKkiFhu1" } ``` + Request Only Hash (multipart/form-data) #### Curl curl -i -F "file=@test" "http://localhost:5001/api/v0/add?n" + Body ``` curl -i -F "file=@test" "http://localhost:5001/api/v0/add?n" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:37:33 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) + Object (object) - Name: test/test (string) - Hash (Multihash) + Body ``` { "Name": "test", "Bytes": 12 } { "Name": "test", "Hash": "QmePw8gVcBMb8x6kAep6aMBAX23hCSk6iZW3i9VKkiFhu1" } ``` + Request Wrap with Directory (multipart/form-data) #### Curl curl -i -F "file=@test" "http://localhost:5001/api/v0/add?w" + Body ``` curl -i -F "file=@test" "http://localhost:5001/api/v0/add?w" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:37:46 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) + Object (object) - Name: test/test (string) - Hash (Multihash) + Body ``` { "Name": "test", "Hash": "QmePw8gVcBMb8x6kAep6aMBAX23hCSk6iZW3i9VKkiFhu1" } { "Name": "", "Hash": "QmV7sQezAjKh9pokjUPLL7ebuMF5t56UmfhK4cJncCcrNZ" } ``` + Request Hidden (multipart/form-data) #### Curl curl -i -F "file=@test" "http://localhost:5001/api/v0/add?H" + Body ``` curl -i -F "file=@test" "http://localhost:5001/api/v0/add?H" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:37:59 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) + Object (object) - Name: test/test (string) - Hash (Multihash) + Body ``` { "Name": "test", "Hash": "QmePw8gVcBMb8x6kAep6aMBAX23hCSk6iZW3i9VKkiFhu1" } ``` + Request Chunker (multipart/form-data) #### Curl curl -i -F "file=@test" "http://localhost:5001/api/v0/add?s" + Body ``` curl -i -F "file=@test" "http://localhost:5001/api/v0/add?s" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:38:11 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) + Object (object) - Name: test/test (string) - Hash (Multihash) + Body ``` { "Name": "test", "Hash": "QmePw8gVcBMb8x6kAep6aMBAX23hCSk6iZW3i9VKkiFhu1" } ``` + Request Recursive (multipart/form-data) #### Curl curl -i -F "file=@test" "http://localhost:5001/api/v0/add?r" + Body ``` curl -i -F "file=@test" "http://localhost:5001/api/v0/add?r" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:40:06 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) + Object (object) - Name: test/test (string) - Bytes: 12 (number) + Object (object) - Name: test/test (string) - Hash (Multihash) + Body ``` { "Name": "test/test", "Bytes": 12 } { "Name": "test/test", "Hash": "QmePw8gVcBMb8x6kAep6aMBAX23hCSk6iZW3i9VKkiFhu1" } { "Name": "test", "Hash": "QmV7sQezAjKh9pokjUPLL7ebuMF5t56UmfhK4cJncCcrNZ" } ``` + Request Empty Arguments #### curl curl -i "http://localhost:5001/api/v0/add" + Body ``` curl -i "http://localhost:5001/api/v0/add" ``` + Response 400 + Headers ``` Date: Fri, 08 Jan 2016 15:22:01 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Body ``` File argument `path` is required ``` # Group bitswap A set of commands to manipulate the bitswap agent. This command can't be called directly. ## stat [GET /bitswap/stat] Show some diagnostic information on the bitswap agent. + Request #### curl curl -i http://localhost:5001/api/v0/bitswap/stat + Body ``` curl -i http://localhost:5001/api/v0/bitswap/stat ``` + Response 200 + Attributes (object) + ProvideBufLen: 0 (number) + Wantlist (array, nullable) + Peers (array) - QmNjRVohhWBX31EoaAXkrj5mPF9vQNcTVvQgWHNwdxweCN (Multihash) + BlocksReceived: 0 (number) + DupBlksReceived: 0 (number) + DupDataReceived: 0 (number) + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Mon, 13 Jun 2016 11:06:46 GMT Transfer-Encoding: chunked ``` + Body ``` { "ProvideBufLen": 0, "Wantlist": null, "Peers": [ "QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM", "QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z", "QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm" ], "BlocksReceived": 0, "DupBlksReceived": 0, "DupDataReceived": 0 } ``` ## unwant [GET /bitswap/unwant{?arg*}] Remove a given block from your wantlist. + Parameters + arg (Multihash, required) - Key or keys to remove from your wantlist. + Request With No Arguments #### curl curl -i http://localhost:5001/api/v0/bitswap/unwant + Body ``` curl -i http://localhost:5001/api/v0/bitswap/unwant ``` + Response 400 + Headers ``` Date: Fri, 29 Jan 2016 20:25:10 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Body ``` Argument 'key' is required ``` + Request Empty Argument #### curl curl -i http://localhost:5001/api/v0/bitswap/unwant?arg= + Body ``` curl -i http://localhost:5001/api/v0/bitswap/unwant?arg= ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:50:44 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: 'incorrectly formatted key: ' - Code: 0 + Body ``` { "Message": "Incorrectly formatted key: ", "Code": 0 } ``` + Request With Invalid Argument #### curl curl -i http://localhost:5001/api/v0/bitswap/unwant?arg=kitten + Body ``` curl -i http://localhost:5001/api/v0/bitswap/unwant?arg=kitten ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:50:33 GMT Transfer-Encoding: chunked ``` + Attributes + Body ``` ``` + Request With Key #### curl curl -i http://localhost:5001/api/v0/bitswap/unwant?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ + Body ``` curl -i http://localhost:5001/api/v0/bitswap/unwant?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:51:00 GMT Transfer-Encoding: chunked ``` + Body ``` ``` + Request With Multiple Keys #### curl curl -i http://localhost:5001/api/v0/bitswap/unwant?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ + Body ``` curl -i http://localhost:5001/api/v0/bitswap/unwant?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:51:10 GMT Transfer-Encoding: chunked ``` + Body ``` ``` ## wantlist [GET /bitswap/wantlist{?peer}] Show blocks currently on the wantlist. Print out all blocks currently on the bitswap wantlist for the local peer. + Parameters + peer (Multihash, optional) - Specify which peer to show wantlist for. Default: self. + Request No Arguments #### curl curl -i http://localhost:5001/api/v0/bitswap/wantlist + Body ``` curl -i http://localhost:5001/api/v0/bitswap/wantlist ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:48:53 GMT Transfer-Encoding: chunked ``` + Attributes + Keys (array) - The keys + Body ``` { "Keys": null } ``` + Request with Invalid Argument The response is the same if the argument is not included. For example: curl -i http://localhost:5001/api/v0/bitswap/wantlist?peer= #### curl curl -i http://localhost:5001/api/v0/bitswap/wantlist?peer=cat.jpg + Body ``` curl -i http://localhost:5001/api/v0/bitswap/wantlist?peer=cat.jpg ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:49:04 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: 'multihash too short. must be \u003e 3 bytes' - Code: 0 + Body ``` { "Message": "multihash too short. must be \u003e 3 bytes", "Code": 0 } ``` + Request With Peer #### curl curl -i http://localhost:5001/api/v0/bitswap/wantlist?peer=QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM + Body ``` curl -i http://localhost:5001/api/v0/bitswap/wantlist?peer=QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:49:15 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Keys (array) - (Multihash) + Body ``` { "Keys": [ "QmeQh6xVvGEKEkeKVEAUg6svnLogNxNBMHnEeEyvw8yfsd", "QmZe4oTtfmQKmzwVob8N5MUSw1zcwW44J46sV3vjTa29TV", "QmS8wN8cBMdASH7cEpCbVGXiK5kvD1Rz7cYgShs18mFCbh", "QmQeKw6b6fJ48ett5JMsVDmQTqEimwtSEWAtnGAvAEdb5W", "QmSuX7yWDSZM2rns2PtSz1r6n5C6XoU1EvE5DaUsnpeMCm", "QmRUctQmvs3M8EUUG8G1srJm4PLqD6x9719zm1nAPYRKv8", "QmX14SaE4U7dTavWDVXviBToXji65haa8KHHYAnDJ8x7Ci", "QmNrE6csRAHZUYA1mPyszpx9sYEzgSoi2SpBrPhZDRAhv1", "QmXKzXvbmLZ7v1Ns8oFBxNujHoRBDCgtYVyiF9YEyeo5dC", "QmaY7qHWpdQJ9QcTmrrgHL4ykAABULrZkvSUCCLTb79iS5", "QmYbmoDHDNgqoDbLC4vMyoMH5dYQdrxL1wh63x9rhSC6Zf", "QmcXMzFwmhDciqAfFemVpaFyEs3Kz7TABs7ARMtt1qRpxj", "QmShCGUPPASXFTBJGUAbyfkUy3ntQxuy4FUSupV1UjRqk6", "QmQwR1UZTxDz2T8qdZBCC5qTvLZnnPrWp2LvtdkKUPhsyh", "QmPFVbtH6Dqf35Rc4UFkTcrFkPrTym7KS1RqVcA6gv8uMq", "QmWBFyiMbJxSsmaudS7rQnt6tkDFrbDYjkVpsjLUT8bwqS", "QmXth7PrfapKZmC3GE7kucQWCBgXqyYHeDRLibmBaCK5wq", "QmWSHWupzYH2ZrC8teiYQATUC14go7Gx9k7GYXrdwuLnFr", "Qmamu7JPzTFnyUcpo2qSuEpsFkYEnewCcU2PixQ3v7QCr1", "QmbZdk1SKmTg2ivwyqoHjRMUi4WTkF9sZfDx6hyjJGMU5a", "QmbL6gjKM1LPBEgqAoDUvKAHdp1zAAkeD78UZS4BSLwJCY", "QmSFZZEu5SF4Yes1YLvuQyU5LK1in2knq5dma9Dd2ezjy2", "QmRpiFpFuzaQvuSbukUzZUB6BjzFKCMYK4saaJvsMSo1Ab", "QmPBrnRNZvidUzWT4NkvhGfJwCzfNk1WFvBF4PYh1rW9de", "QmP4FJ4jyk9TDcuUzMbtCThSraAj3FKC9q6LLMDfPTtnqF", "QmR1kZwr4zrrkVMjtNrZSZNAP7btbNNhUCDzFn7vjytQWU", "QmVRvtjmWLpMphqAj9k1bySbZTUN2C9sZ64JUrh9wanLj5", "QmbeQDMbw8cdvyBZ9BsKTWfe2iXUbSXBc5FY9EqFfFgY2Q", "QmZsTuTBFzveqUWyE3K7LPrLeTEaquyNU7YQbYfqQfJNLp", "QmTBKAHg6VFnNkn2bBvi4Uk9CpTDpxEKUm5BsbjXcuwARw", "Qmd38Q7j9pczrWZ9M1jZEoX4xx6E8E41w2dEbud3KYv2YX" ] } ``` # Group block Manipulate raw IPFS blocks. This command can't be called directly. ## get [GET /block/get{?arg}] Store data as a raw ipfs block. + Parameters + arg (Multihash, required) - The base58 multihash of an existing block to get. + Request No Arguments #### curl curl -i "http://localhost:5001/api/v0/block/get" + Body ``` curl -i "http://localhost:5001/api/v0/block/get" ``` + Response 400 + Headers ``` Date: Fri, 29 Jan 2016 21:46:01 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'key' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For instance: curl -i "http://localhost:5001/api/v0/block/get?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/block/get?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/block/get?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:49:54 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Not a valid hash" - Code: 0 + Body ``` { "Message": "Not a valid hash", "Code": 0 } ``` + Request With Valid Argument #### curl curl -i "http://localhost:5001/api/v0/block/get?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o" + Body ``` curl -i "http://localhost:5001/api/v0/block/get?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Stream-Output: 1 Date: Thu, 28 Apr 2016 17:50:04 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` hello world ``` ## put [POST /block/put{?arg}] Stores input as an IPFS block 'ipfs block put' is a plumbing command for storing raw IPFS blocks. + Parameters + arg (string, required) - The data to be stored as an IPFS block. + Request Without Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/block/put" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/block/put" ``` + Response 400 + Headers ``` Date: Fri, 29 Jan 2016 21:48:34 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` File argument 'data' is required ``` + Request Invalid Argument (multipart/form-data) The response is the same if there is no data provided. For example: curl -i -X POST -F "data=" "http://localhost:5001/api/v0/block/put" #### curl curl -i -X POST -F "data=invalid" "http://localhost:5001/api/v0/block/put" + Body ``` curl -i -X POST -F "data=invalid" "http://localhost:5001/api/v0/block/put" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:50:15 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "mime: no media type" - Code: 0 + Body ``` { "Message": "mime: no media type", "Code": 0 } ``` + Request Valid Argument (multipart/form-data) In the example provided, the 'test' file has the following contents: ``` hello world ``` #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/block/put" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/block/put" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:49:22 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Key: "QmZjTnYw2TFhn9Nn7tjmPSoTBoY7YRkwPzwSrSbabY24Kp" (Multihash) - Size: 12 (number) + Body ``` { "Key": "QmZjTnYw2TFhn9Nn7tjmPSoTBoY7YRkwPzwSrSbabY24Kp", "Size": 12 } ``` ## stat [GET /block/stat{?arg}] Retrieve information on a raw ipfs block. + Parameters + arg (Multihash, required) - The base58 multihash of an existing block to get. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/block/stat" + Body ``` curl -i "http://localhost:5001/api/v0/block/stat" ``` + Response 400 + Headers ``` Date: Fri, 29 Jan 2016 21:25:34 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'key' is required ``` + Request Invalid Argument The response is the same if there is no argument provided. For example: curl -i -F "data=" "http://localhost:5001/api/v0/block/stat/arg=" #### curl curl -i "http://localhost:5001/api/v0/block/stat/arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/block/stat/arg=kitten" ``` + Response 400 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:49:33 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Not a valid hash" - Code: 0 + Body ``` { "Message": "Not a valid hash", "Code": 0 } ``` + Request Valid Argument #### curl curl -i "http://localhost:5001/api/v0/block/stat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/block/stat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:49:43 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Key (Multihash) + Size (number) - the size of the block in bytes + Body ``` { "Key": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ", "Size": 55 } ``` # Group bootstrap Show or edit the list of bootstrap peers. Requesting `ipfs/bootstrap` with no arguments will return `ipfs/bootstrap/list`. **Security Warning**: 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-Output, X-Chunked-Output Access-Control-Expose-Headers: X-Stream-Output, 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. Default: false. + 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:49:55 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:50:05 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:50:24 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:50:47 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:51:05 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:51:19 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. Default: false. + 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:51:30 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:51:45 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:52:02 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-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:52:14 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 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:52:23 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Peers (array) - (Multihash) + Body ``` { "Peers": [] } ``` # Group cat Show IPFS object data. ## cat [GET /cat{?arg}] Displays the data contained by an IPFS or IPNS object(s) at the given path. + Parameters + arg (string, required) - The path to the IPFS object or objects to be outputted. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/cat" + Body ``` curl -i "http://localhost:5001/api/v0/cat" ``` + Response 400 + Headers ``` Date: Fri, 05 Feb 2016 17:14:24 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) This is the raw content of the file. + Body ``` Argument 'ipfs-path' is required ``` + Request With Empty Argument The response is the same if there is an invalid argument. For example: curl -i "http://localhost:5001/api/v0/cat?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/cat?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/cat?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 15:54:57 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Valid Argument But Invalid DAG Node The multihash in this request is for a directory, not for an object. #### curl curl -i "http://localhost:5001/api/v0/cat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/cat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 15:55:11 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "this dag node is a directory" - Code: 0 + Body ``` { "Message": "this dag node is a directory", "Code": 0 } ``` + Request With Valid Argument In this request, 'QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o' is the hash for a file, 'test', with the following contents ``` hello world ``` #### curl curl -i "http://localhost:5001/api/v0/cat?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o" + Body ``` curl -i "http://localhost:5001/api/v0/cat?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o" ``` + Response 200 The Content-Type of the response should be `application/x-tar`. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Content-Length: 12 X-Stream-Output: 1 Date: Thu, 28 Apr 2016 15:55:24 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` hello world ``` # Group commands Lists all available commands. ## commands [GET /commands] Lists all available commands (and subcommands) and exits. + Request #### curl curl -i http://localhost:5001/api/v0/commands + Body ``` curl -i http://localhost:5001/api/v0/commands ``` + Response 200 Due to the size of the response, no Body is included here, and only one level depth for the Attributes. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:56:11 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Name: "ipfs" (string) + Subcommands (array) - Name (string) + Subcommands (object) + Options (array) - ShowOptions: false (boolean) + Options (array) - "{}" (object) - ShowOptions: false (boolean) # Group config ## config [POST /config{?arg1,arg2}{&bool,json}] 'ipfs config' controls configuration variables. It works much like 'git config'. The configuration values are stored in a config file inside your IPFS repository. + Parameters + arg1: "Datastore.Path" (string, required) - The key of the config entry. + arg2: "~/.ipfs/datastore" (string, optional) - The value to set the config entry to. + bool (boolean, optional) - Set a boolean. Default: false. + json (boolean, optional) - Parse stringified JSON. Default: false. + Request Without Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/config" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/config" ``` + Response 400 + Headers ``` Date: Tue, 02 Feb 2016 16:37:00 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Body ``` Argument 'key' is required ``` + Request With Invalid Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/config?arg=kitten" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/config?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:56:23 GMT Transfer-Encoding: chunked ``` + Attributes (Error) + Message: "Failed to get config value: key has no attributes" + Code: 0 + Body ``` { "Message": "Failed to get config value: key has no attributes", "Code": 0 } ``` + Request With Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/config?arg=API.HTTPHeaders" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/config?arg=API.HTTPHeaders" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:56:32 GMT Transfer-Encoding: chunked ``` + Attributes (object) + `Key`: "Datastore" (string) + `Value` (object, nullable) - The config entry. + Body ``` { "Key": "API.HTTPHeaders", "Value": null } ``` + Request As Subcommand #### curl curl -i -X POST "http://localhost:5001/api/v0/config/API.HTTPHeaders" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/config/API.HTTPHeaders" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:56:42 GMT Transfer-Encoding: chunked ``` + Attributes (object) + `Key`: "Datastore" (string) + `Value` (object, nullable) - The config entry. + Body ``` { "Key": "API.HTTPHeaders", "Value": null } ``` + Request With Both Args #### curl curl -i -X POST "http://localhost:5001/api/v0/config?arg=Datastore.Path&arg=kitten" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/config?arg=Datastore.Path&arg=kitten" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:56:57 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Key: "Datastore.Path" (string) - Value: "kitten" (string) + Body ``` { "Key": "Datastore.Path", "Value": "kitten" } ``` + Request With Both Args and JSON Flag With Invalid JSON Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/config?arg=Datastore.Path&arg=kitten&json" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/config?arg=Datastore.Path&arg=kitten&json" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:57:08 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "failed to unmarshal json. invalid character 'k' looking for beginning of value" - Code: 0 + Body ``` { "Message": "failed to unmarshal json. invalid character 'k' looking for beginning of value", "Code": 0 } ``` + Request With Both Args and JSON Flag With Valid JSON Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/config?arg=Datastore.Path&arg=\"kitten\"&json" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/config?arg=Datastore.Path&arg=\"kitten\"&json" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:57:20 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Key: "Datastore.Path" (string) - Value: "kitten" (string) + Body ``` { "Key": "Datastore.Path", "Value": "kitten" } ``` ## replace [POST /config/replace{?arg}] Replaces the config with . Make sure to back up the config file first if neccessary, as this operation can't be undone. #### curl curl -i -X POST -F "file=@test" "http://localhost:5001/api/v0/config/replace" + Parameters + arg (string, required) - The file to use as the new config. + Request Without File #### curl curl -i -X POST "http://localhost:5001/api/v0/config/replace" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/config/replace" ``` + Response 400 + Headers ``` Date: Tue, 02 Feb 2016 22:31:15 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` File argument 'file' is required ``` + Request With Badly Configured Config File Where 'test' is a file that is not JSON and does not conform to the standard IPFS config file structure. #### curl curl -i -X POST -F "file=@test" http://localhost:5001/api/v0/config/replace + Body ``` curl -i -X POST -F "file=@test" http://localhost:5001/api/v0/config/replace ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:57:31 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Failed to decode file as config" (string) - Code: 0 (number) + Body ``` { "Message": "Failed to decode file as config", "Code": 0 } ``` + Request With Config File #### curl curl -i -X POST -F "file=@test" http://localhost:5001/api/v0/config/replace + Body ``` curl -i -X POST -F "file=@test" http://localhost:5001/api/v0/config/replace ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 16:58:13 GMT Transfer-Encoding: chunked ``` + Attributes + Body ``` ``` ## show [GET /config/show] Outputs the content of the config file **Warning** Your private key is stored in the config file, and it will be included in the output of this command. + Request Without Config File This request is shown as an example, presuming that ~/.ipfs/config has been deleted, not that it hasn't been specified in the request. #### curl curl -i "http://localhost:5001/api/v0/config/show" + Body ``` curl -i http://localhost:5001/api/v0/config/show ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Stream-Output: 1 Date: Thu, 28 Apr 2016 16:58:24 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "open /Users/richard/.ipfs/config: no such file or directory" (string) - Code: 0 (number) + Body ``` { "Message": "open /Users/richard/.ipfs/config: no such file or directory", "Code": 0 } ``` + Request #### curl curl -i "http://localhost:5001/api/v0/config/show" + Body ``` curl -i "http://localhost:5001/api/v0/config/show" ``` + Response 200 A Body is not included here in order to obfuscate the private key. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Stream-Output: 1 Date: Thu, 28 Apr 2016 16:58:39 GMT Transfer-Encoding: chunked ``` + Attributes (object) + `API` (object) + `HTTPHeaders` (string, nullable) + `Addresses` (object) + `API`: "/ip4/127.0.0.1/tcp/5001" (MultiAddr) + `Gateway`: "/ip4/127.0.0.1/tcp/8080" (MultiAddr) + `Swarm` (array) - (SwarmAddrs) + `Bootstrap` (array) - MultiAddr (MultiAddr) + `Datastore` (object) - `GCPeriod`: "" (string) - `NoSync`: false (boolean) - `Params` (string, nullable) - `Path`: "" (string) - `StorageGCWatermark`: 90 (number) - `StorageMax`: "10GB" (string) - `Type`: "" (string) + `Discovery` (object) + `MDNS` (object) - `Enabled`: true (boolean) - `Interval`: 10 (number) + `Gateway` (object) - `HTTPHeaders` (string, nullable) - `RootRedirect`: "" (string) - `Writable`: false (boolean) + `Identity` (object) - `PeerID`: hash (Multihash) - `PrivKey`: hash (string) + `Ipns` (object) - `RecordLifetime`: "" (string) - `RepublishPeriod`: "" (string) - `ResolveCacheSize`: 128 (number) + `Log` (object) - `MaxAgeDays`: 0 (number) - `MaxBackups`: 1 (number) - `MaxSizeMB`: 250 (number) + `Mounts` (object) - `FuseAllowOther`: false (boolean) - `IPFS`: "/ipfs" (string) - `IPFS`: "/ipns" (string) + `SupernodeRouting` (object) + `Servers` (array) - (SwarmAddrs) + `Swarm` (object) - `AddrFilters` (string, nullable) + `Tour` (object) - `Last`: "" (string) + `Version` (object) - `AutoUpdate`: "minor" (string) - `Check`: "error" (string) - `CheckDate`: "0001-01-01T00:00:00Z" (string) - `CheckPeriod`: "172800000000000" (string) - `Current`: "0.4.0-dev" (string) + `id` (Multihash) # Group dht Issue commands directly through the DHT. This command can't be called directly. ## findpeer [GET /dht/findpeer{?arg}] Query the DHT for all of the multiaddresses associated with a Peer ID. + Parameters + arg (string, required) - The ID of the peer to search for. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/dht/findpeer" + Body ``` curl -i "http://localhost:5001/api/v0/dht/findpeer" ``` + Response 400 + Headers ``` Date: Wed, 13 Apr 2016 14:08:32 GMT Content-Length: 29 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'peerID' is required ``` + Request With Empty Argument #### curl curl -i "http://localhost:5001/api/v0/dht/findpeer?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/dht/findpeer?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 14:08:49 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "multihash too short. must be \u003e 3 bytes" - Code: 0 + Body ``` { "Message": "multihash too short. must be \u003e 3 bytes", "Code": 0 } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/dht/findpeer?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/dht/findpeer?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 14:09:05 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "multihash length inconsistent: \u0026{6 174 [128 54 35]}" - Code: 0 + Body ``` { "Message": "multihash length inconsistent: \u0026{6 174 [128 54 35]}", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/dht/findpeer?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/dht/findpeer?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 The response has been truncated to a single ndjson object, as the responses are streamed. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Wed, 13 Apr 2016 14:09:20 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Extra (string) - ID (Multihash) + Responses (array) + (object) - Addrs (MultiAddr) - ID (Multihash) - Type (number) + Body ``` { "Extra": "", "ID": "QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", "Responses": [ { "Addrs": [ "/ip4/10.0.0.116/tcp/14001", "/ip4/127.0.0.1/tcp/14001", "/ip4/127.0.0.2/tcp/14001", "/ip4/62.210.92.54/tcp/14001" ], "ID": "QmdmznJmndCNmfDNZ6pLSFuihXwgSnHbienWCJzJQ4M8By" }, ... ], "Type": 0 } ``` ## findprovs [POST /dht/findprovs{?arg}] Find peers in the DHT that can provide a specific value, given a key. + Parameters + arg (string, required) - The key to find providers for. + Request Without Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/dht/findprovs" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/dht/findprovs" ``` + Response 400 + Headers ``` Date: Sat, 06 Feb 2016 22:50:36 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'key' is required ``` + Request With Argument The response is the same if the argument is empty or invalid. For example: curl -i -X POST "http://localhost:5001/api/v0/dht/findprovs?arg=kitten" #### curl curl -i -X POST "http://localhost:5001/api/v0/dht/findprovs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/dht/findprovs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 The response has been truncated to a single ndjson object, as the responses are streamed. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Wed, 13 Apr 2016 14:10:51 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Extra (string) - ID (Multihash) + Responses (array) + (object) - Addrs (MultiAddr) - ID (Multihash) - Type (number) + Body ``` { "Extra": "", "ID": "QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", "Responses": [ { "Addrs": [ "/ip4/10.0.0.116/tcp/14001", "/ip4/127.0.0.1/tcp/14001", "/ip4/127.0.0.2/tcp/14001", "/ip4/62.210.92.54/tcp/14001" ], "ID": "QmdmznJmndCNmfDNZ6pLSFuihXwgSnHbienWCJzJQ4M8By" }, ... ], "Type": 0 } ``` ## get [GET /dht/get{?arg}] Given a key, query the DHT for its best value. There may be several different values for a given key stored in the DHT; in this context 'best' means the record that is most desirable. There is no one metric for 'best': it depends entirely on the key type. For IPNS, 'best' is the record that is both valid and has the highest sequence number (freshest). Different key types can specify other 'best' rules. + Parameters + arg (string, required) - The key to find providers for + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/dht/get" + Body ``` curl -i "http://localhost:5001/api/v0/dht/get" ``` + Response 400 + Headers ``` Date: Sat, 06 Feb 2016 22:59:08 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'key' is required ``` + Request With Argument The response is the same if the argument is empty or invalid. For example: curl -i "http://localhost:5001/api/v0/dht/get?arg=\[kitten\]" #### curl curl -i "http://localhost:5001/api/v0/dht/get?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/dht/get?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 The response has been truncated to a single ndjson object, as the responses are streamed. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 16:59:34 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Extra (string) - ID (Multihash) + Responses (array) + (object) - Addrs (MultiAddr) - ID (Multihash) - Type (number) + Body ``` { "Extra": "", "ID": "QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", "Responses": [ { "Addrs": [ "/ip4/10.0.0.116/tcp/14001", "/ip4/127.0.0.1/tcp/14001", "/ip4/127.0.0.2/tcp/14001", "/ip4/62.210.92.54/tcp/14001" ], "ID": "QmdmznJmndCNmfDNZ6pLSFuihXwgSnHbienWCJzJQ4M8By" }, ... ], "Type": 0 } ``` ## put [GET /dht/put{?arg1,arg2}] Write a key/value pair to the DHT. Given a key of the form /foo/bar and a value of any form, this will write that value to the DHT with that key. Keys have two parts: a keytype (foo) and the key name (bar). IPNS uses the /ipns keytype, and expects the key name to be a Peer ID. IPNS entries are specifically formatted (protocol buffer). You may only use keytypes that are supported in your ipfs binary: currently this is only /ipns. Unless you have a relatively deep understanding of the go-ipfs DHT internals, you likely want to be using 'ipfs name publish' instead of this. Value is arbitrary text. Standard input can be used to provide value. NOTE: A value may not exceed 2048 bytes. + Parameters + arg1 (string, required) - The key to store the value at. + arg2 (string, required) - The value to store. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/dht/put" + Body ``` curl -i "http://localhost:5001/api/v0/dht/put" ``` + Response 400 + Headers ``` Date: Sat, 06 Feb 2016 23:01:30 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'key' is required ``` + Request With Empty Or Invalid First Argument #### curl curl -i "http://localhost:5001/api/v0/dht/put?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/dht/put?arg=" ``` + Response 400 + Headers ``` Date: Sat, 06 Feb 2016 23:02:04 GMT Content-Length: 28 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'value' is required ``` + Request With Arguments The response has been truncated to a single ndjson object, as the responses are streamed. The response is the same if either argument is empty or invalid. For example: curl -i "http://localhost:5001/api/v0/dht/put?arg=&arg=" #### curl curl -i "http://localhost:5001/api/v0/dht/put?arg=kitten&arg=true" + Body ``` curl -i "http://localhost:5001/api/v0/dht/put?arg=kitten&arg=true" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:00:12 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Extra (string) - ID (Multihash) + Responses (array) + (object) - Addrs (MultiAddr) - ID (Multihash) - Type (number) + Body ``` { "Extra": "", "ID": "QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", "Responses": [ { "Addrs": [ "/ip4/10.0.0.116/tcp/14001", "/ip4/127.0.0.1/tcp/14001", "/ip4/127.0.0.2/tcp/14001", "/ip4/62.210.92.54/tcp/14001" ], "ID": "QmdmznJmndCNmfDNZ6pLSFuihXwgSnHbienWCJzJQ4M8By" }, ... ], "Type": 0 } ``` ## query [GET /dht/query{?arg}] Find the closest Peer IDs to a given Peer ID by querying the DHT + Parameters + arg (string, required) - The peerID to run the query against. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/dht/query" + Body ``` curl -i "http://localhost:5001/api/v0/dht/query" ``` + Response 400 + Headers ``` Date: Sat, 06 Feb 2016 23:04:52 GMT Content-Length: 29 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'peerID' is required ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/dht/query?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/dht/query?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Wed, 13 Apr 2016 14:24:22 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Extra (string) - ID (Multihash) + Responses (array) + (object) - Addrs (MultiAddr) - ID (Multihash) - Type (number) + Body ``` { "Extra": "", "ID": "QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", "Responses": [ { "Addrs": [ "/ip4/10.0.0.116/tcp/14001", "/ip4/127.0.0.1/tcp/14001", "/ip4/127.0.0.2/tcp/14001", "/ip4/62.210.92.54/tcp/14001" ], "ID": "QmdmznJmndCNmfDNZ6pLSFuihXwgSnHbienWCJzJQ4M8By" }, ... ], "Type": 0 } ``` # Group diag Generate diagnostic reports. This command can't be called directly. ## cmds [GET /diag/cmds] List commands run on this ipfs node. + Request #### curl curl -i "http://localhost:5001/api/v0/diag/cmds" + Body ``` curl -i "http://localhost:5001/api/v0/diag/cmds" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Tue, 26 Apr 2016 23:21:50 GMT Transfer-Encoding: chunked ``` + Attributes (array) + (object) - Active (boolean) + Args (array, nullable) - Command (string) - EndTime (string) - ID (number) + Options (object) - enc (string) + StartTime (string) + Body ``` [ { "Active": true, "Args": [], "Command": "diag/cmds", "EndTime": "0001-01-01T00:00:00Z", "ID": 19, "Options": { "enc": "json" }, "StartTime": "2016-04-26T19:22:41.376294115-04:00" } ] ``` ## cmds clear [GET /diag/cmds/clear] Clear inactive requests from the log. + Request #### curl curl -i "http://localhost:5001/api/v0/diag/cmds/clear" + Body ``` curl -i "http://localhost:5001/api/v0/diag/cmds/clear" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 14:26:49 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` ## cmds set-time [GET /diag/cmds/set-time{?arg}] Set how long to keep inactive requests in the log. + Parameters + arg (string, required) - Time to keep inactive requests in log. // TODO Switch to Time on rebase + Request Without Argument #### curl curl -i "http://localhost:5001/api/v0/diag/cmds/set-time" + Body ``` curl -i "http://localhost:5001/api/v0/diag/cmds/set-time" ``` + Response 400 + Headers ``` Date: Fri, 18 Mar 2016 21:28:38 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'time' is required ``` + Request With Empty Argument The repsonse is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/diag/cmds/set-time?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/diag/cmds/set-time" + Body ``` curl -i "http://localhost:5001/api/v0/diag/cmds/set-time" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 14:39:43 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "time: invalid duration " - Code: 0 + Body ``` { "Code": 0, "Message": "time: invalid duration " } ``` + Request With Valid Argument #### curl curl -i "http://localhost:5001/api/v0/diag/cmds/set-time?arg=1s" + Body ``` curl -i "http://localhost:5001/api/v0/diag/cmds/set-time?arg=1s" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 14:39:59 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` ## net [GET /diag/net{?vis}] Sends out a message to each node in the network recursively requesting a listing of data about them including number of connected peers and latencies between them. The given timeout will be decremented 2s at every network hop, ensuring peers try to return their diagnostics before the initiator's timeout. If the timeout is too small, some peers may not be reached. 30s and 60s are reasonable timeout values, though networks vary. The default timeout is 20 seconds. + Parameters + vis (enum[string], optional) - Output format. - Default: `text` + Members - `text` - Easy to read. - `d3` - JSON ready to be fed into d3view. - `dot` - Graphviz format. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/diag/net" + Body ``` curl -i "http://localhost:5001/api/v0/diag/net" ``` + Response 200 The response Body is exceedingly large: here, it has been sampled. The format is `plain text`. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Fri, 18 Mar 2016 21:39:47 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ID Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH up 184 seconds connected to 10: ID QmSdFMkJGoG1VRxUfrKGivxUvnfefUsGPrAVtAug8CJRm6 connections: 1 latency: 243965153 ns ID QmZzPcDwgaoqhvfE1QW91J8SG9G2M8wGJaaPmNDKRGw1LN connections: 1 latency: 371879189 ns ID QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM connections: 1 latency: 607917705 ns ID QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ connections: 1 latency: 293064495 ns ID QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z connections: 1 latency: 1159858705 ns ID QmTv99LaBwegvtRgUaUUy6JSzF6q8i2FCJdy7fJQxqAtU8 connections: 1 latency: 244056752 ns ID QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm connections: 1 latency: 164713121 ns ID QmT19P4HExyfDqZAU65LWyuuJU31G8uWKPoFkQPEcqYGD2 connections: 1 latency: 298962573 ns ID QmVjEQAUXCEQMDmvgtsd5f2EsgTbg33Cpis5TDM3uVP9Vs connections: 1 latency: 349706701 ns ID QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu connections: 1 latency: 3586431786 ns ID QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm up 18824 seconds connected to 68: ... ``` + Request With Vis Option d3 #### curl curl -i "http://localhost:5001/api/v0/diag/net?vis=d3" + Body ``` curl -i "http://localhost:5001/api/v0/diag/net?vis=d3" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Fri, 18 Mar 2016 21:40:17 GMT Transfer-Encoding: chunked ``` + Attributes (object) + links (array) + (object) - source (number) - target (number) - value (number) + nodes (array) - (object) - name (Multihash) - rtkey (Multihash) - value (number) + Body ``` { "links": [ { "source": 0, "target": 22, "value": 3 }, ... ], "nodes": [ { "name": "Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH", "rtkey": "FuYMoHi3adbGrgACqL7tWSQnEVNANZ9NToPo9VTD9VWe", "value": 10 }, ... ] } ``` + Request With Vis Option `dot` #### curl curl -i "http://localhost:5001/api/v0/diag/net?vis=dot" + Body ``` curl -i "http://localhost:5001/api/v0/diag/net?vis=dot" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Fri, 18 Mar 2016 21:40:37 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` digraph "diag-net" { subgraph cluster_L { L [shape=box fontsize=32 label="Nodes: 84\l"] } N0 [label="Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH 23 conns" fontsize=8 shape=box tooltip="Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH (23 conns)"] ... 44 conns" fontsize=8 shape=box tooltip="QmavYZiVcX18nfw5fNwrXSUCCDKjWpgaSTG4onHCqTgL5w (44 conns)"] N0 -> N37 [label=" 67442950" weight=1 tooltip="Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH ... Qmda2AecGMjJ96P7tgcyveEx7EDWF4JghPfr2jAW7ov6HG (67442950)" labeltooltip="Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH ... Qmda2AecGMjJ96P7tgcyveEx7EDWF4JghPfr2jAW7ov6HG (67442950)" style="dotted"] ... ``` ## sys [GET /diag/sys] Print out information about your computer to aid in debugging. + Request #### curl curl -i http://localhost:5001/api/v0/diag/sys + Body ``` curl -i http://localhost:5001/api/v0/diag/sys ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Sun, 19 Jun 2016 14:24:40 GMT Transfer-Encoding: chunked ``` + Attributes (object) - diskinfo (object) - free_space: 6639185920 (number) - fstype: hfs (string) - total_space: 120101797888 (number) - environment (object) - GOPATH: "/Users/dignifiedquire/.go" (string) - IPFS_PATH (string, nullable) - ipfs_commit: "a6fb581" (string, nullable) - ipfs_version: "0.3.9" (string) - memory (object) - swap: 0 (number) - virt: 0 (number) - net (object) - interface_addresses (array) - "/ip6/::1" (MultiAddr) - online (boolean) - runtime (object) - arch: amd64 (string) - compiler: gc (string) - gomaxprocs: 3 (number) - numcpu: 4 (number) - numgoroutines: 145 (number) - os: darwin (string) - version: `go1.5.1` (string) + Body ``` { "diskinfo": { "free_space": 22129876992, "fstype": "17", "total_space": 21867732992 }, "environment": { "GOPATH": "/Users/richard/gocode", "IPFS_PATH": "" }, "ipfs_commit": "a6fb581", "ipfs_version": "0.4.2", "memory": { "swap": 0, "virt": 0 }, "net": { "interface_addresses": [ "/ip6/::1", "/ip4/127.0.0.1", "/ip6/fe80::1", "/ip6/fe80::a6d1:8cff:fee0:7950", "/ip4/192.168.10.234", "/ip6/fe80::6c24:b1ff:fe6d:8ad2" ], "online": true }, "runtime": { "arch": "amd64", "compiler": "gc", "gomaxprocs": 3, "numcpu": 4, "numgoroutines": 211, "os": "darwin", "version": "go1.5.3" } } ``` # Group dns DNS link resolver. ## dns [GET /dns{?arg}] Multihashes are hard to remember, but domain names are usually easy to remember. To create memorable aliases for multihashes, DNS TXT records can point to other DNS links, IPFS objects, IPNS keys, etc. This command resolves those links to the referenced object. + Parameters + arg (string, required) - DNS name + recursive (string, optional) - Resolve until the result is not a DNS link. Default: false. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/dns" + Body ``` curl -i "http://localhost:5001/api/v0/dns" ``` + Response 400 + Headers ``` Date: Fri, 05 Feb 2016 23:30:20 GMT Content-Length: 34 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'domain-name' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/dns?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/dns?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/dns?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:01:03 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "not a valid domain name" - Code: 0 + Body ``` { "Message": "not a valid domain name", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/dns?arg=ipfs.io" + Body ``` curl -i "http://localhost:5001/api/v0/dns?arg=ipfs.io" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:01:14 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Path (string) + Body ``` { "Path": "/ipfs/QmUbFnoqVhzPBXq1Bi2Rn9dCYu1csbKuowo7oTj5FCdXQs"" } ``` + Request With Valid Argument And No Recursive Option #### curl curl -i "http://localhost:5001/api/v0/dns?arg=recursive.ipfs.io" + Body ``` curl -i "http://localhost:5001/api/v0/dns?arg=recursive.ipfs.io" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:01:23 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Code: 0 - Message: "Could not resolve name. Recursion limit exceeded." + Body ``` { "Code": 0, "Message": "Could not resolve name (recursion limit exceeded)." } ``` + Request With Valid Argument And Recursive Option #### curl curl -i "http://localhost:5001/api/v0/dns?arg=recursive.ipfs.io&r" + Body ``` curl -i "http://localhost:5001/api/v0/dns?arg=recursive.ipfs.io&r" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:01:37 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Path (string) + Body ``` { "Path": "/ipfs/QmUbFnoqVhzPBXq1Bi2Rn9dCYu1csbKuowo7oTj5FCdXQs" } ``` # Group file Interact with IPFS objects representing Unix filesystems. This provides a familiar interface to file systems represented by IPFS objects, which hides IPFS implementation details like layout objects (e.g. fanout and chunking). This command can't be called directly. ## ls [GET /file/ls{?arg}] List directory contents for Unix filesystem object Retrieves the object named by and displays the contents. The JSON output contains size information. For files, the child size is the total size of the file contents. For directories, the child size is the IPFS link size. The path can be a prefixless ref; in this case, we assume it to be an /ipfs ref and not /ipns. + Parameters + arg (string, required) - The path to the IPFS object or objects to list links from. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/file/ls" + Body ``` curl -i "http://localhost:5001/api/v0/file/ls" ``` + Response 400 + Headers ``` Date: Sat, 06 Feb 2016 23:13:03 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'ipfs-path' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/file/ls?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/file/ls?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/file/ls?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:02:27 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/file/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/file/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:02:37 GMT Transfer-Encoding: chunked ``` + Attributes + Argument (object) - Key (Multihash) - Where 'Key' is the IPFS object's multihash. + Objects (object) + Key (object) - Where 'Key' is the IPFS object's multihash. - Hash (Multihash) - Size (number) - Type (string) - Links (array) - (object) - Name (string) - Hash (Multihash) - Size (number) - Type (string) + Body ``` { "Arguments": { "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" }, "Objects": { "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ": { "Hash": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ", "Size": 0, "Type": "Directory", "Links": [ { "Name": "cat.jpg", "Hash": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Size": 443230, "Type": "File" } ] } } } ``` # Group files Manipulate unixfs files. Files is an API for manipulating ipfs objects as if they were a unix filesystem. Note: Most of the subcommands of 'ipfs files' accept the 'flush' option. It defaults to 'true'. Use caution when setting this to 'false'. It will improve performance for large numbers of file operations, but it does so at the cost of consistency guarantees. This command can't be called directly. ## rm [POST /files/rm{?arg}{&recursive,flush}] Remove a file. ### Bugs + Parameters + arg (string, required) - File to remove. + recursive (boolean, optional) - Recursively remove directories. Default: false. Alias: r. + flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f. + Request Without Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/files/rm" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/files/rm" ``` + Response 400 + Headers ``` Date: Fri, 19 Feb 2016 15:02:04 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'path' is required ``` + Request With Empty Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:42:51 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must not be empty." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must not be empty." } ``` + Request With Invalid Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=kitten" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:43:04 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must start with a leading slash." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must start with a leading slash." } ``` + Request With Argument This request is dependent on there being a 'test' file in your Files API folder. To create this file, run: url -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:41:36 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` + Request With Argument For Directory Without Recursive '/test' here must be a directory, not a file. To create this folder, run: curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/test" #### curl curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:42:34 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "/test is a directory, use -r to remove directories" - Code: 0 + Body ``` { "Code": 0, "Message": "/test is a directory, use -r to remove directories" } ``` + Request With Argument And Recursive Option This request is dependent on there being a 'test' folder in your Files API folder. To create this folder, run: curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/test" #### curl curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:42:48 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` ## flush [GET /files/flush{?arg}{&flush}] Flush a given path's data to disk. This is only useful when other commands are run with the 'flush' option set to false. + Parameters + arg (string, required) - Path to flush. Default: '/'. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/files/flush" + Body ``` curl -i "http://localhost:5001/api/v0/files/flush" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:43:15 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` + Request With Empty Argument #### curl curl -i "http://localhost:5001/api/v0/files/flush?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/files/flush?arg=" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:43:25 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/files/flush?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/files/flush?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:43:35 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "file does not exist" - Code: 0 + Body ``` { "Code": 0, "Message": "file does not exist" } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/files/flush?arg=/test" + Body ``` curl -i "http://localhost:5001/api/v0/files/flush?arg=/test" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:43:46 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` ## mv [GET /files/mv{?arg,arg2}{&flush}] Move files. Move files around. Just like traditional unix mv. + Parameters + arg (string, required) - Source file to move. + arg2 (string, required) - Target path for file to be moved to. + flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/files/mv" + Body ``` curl -i "http://localhost:5001/api/v0/files/mv" ``` + Response 400 + Headers ``` Date: Fri, 19 Feb 2016 16:07:11 GMT Content-Length: 29 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'source' is required ``` + Request With Empty Arguments #### curl curl -i "http://localhost:5001/api/v0/files/mv?arg=&arg=" + Body ``` curl -i "http://localhost:5001/api/v0/files/mv?arg=&arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:44:04 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must not be empty." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must not be empty." } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/files/mv?arg=kitten&arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/files/mv?arg=kitten&arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:44:21 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must start with a leading slash." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must start with a leading slash." } ``` + Request With Non-Existent Argument This call depends upon a file in the Files API called 'here'. This file must not exist. To ensure this file does not exist, run: curl -i "http://localhost:5001/api/v0/files/rm?arg=/here" #### curl curl -i "http://localhost:5001/api/v0/files/mv?arg=/here&arg=/there" + Body ``` curl -i "http://localhost:5001/api/v0/files/mv?arg=/here&arg=/there" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:44:54 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Code: 0 - Message: "file does not exist" + Body ``` { "Code": 0, "Message": "file does not exist" } ``` + Request With Argument This call depends upon a file in the Files API called 'here'. To create such a file, run: curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/here" #### curl curl -i "http://localhost:5001/api/v0/files/mv?arg=/here&arg=/there" + Body ``` curl -i "http://localhost:5001/api/v0/files/mv?arg=/here&arg=/there" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:46:03 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` ## cp [GET /files/cp{?arg,arg2}{&flush}] Copy files into mfs. + Parameters + arg (string, required) - Source file to move. + arg2 (string, required) - Destination to copy object to. + flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/files/cp" + Body ``` curl -i "http://localhost:5001/api/v0/files/cp" ``` + Response 400 + Headers ``` Date: Tue, 19 Apr 2016 18:46:14 GMT Content-Length: 29 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'source' is required ``` + Request With Empty Arguments #### curl curl -i "http://localhost:5001/api/v0/files/cp?arg=&arg=" + Body ``` curl -i "http://localhost:5001/api/v0/files/cp?arg=&arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:48:20 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must not be empty." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must not be empty." } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/files/cp?arg=kitten&arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/files/cp?arg=kitten&arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:48:37 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must start with a leading slash." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must start with a leading slash." } ``` + Request With Non-Existent Argument This call depends upon a file in the Files API called 'here', which must not exist. To make sure it does not, run this first: curl -i "http://localhost:5001/api/v0/files/rm?arg=/here" #### curl curl -i "http://localhost:5001/api/v0/files/cp?arg=/here&arg=/there" + Body ``` curl -i "http://localhost:5001/api/v0/files/cp?arg=/here&arg=/there" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:02:58 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Code: 0 - Message: "file does not exist" + Body ``` { "Code": 0, "Message": "file does not exist" } ``` + Request With Existing Argument This call depends upon a file in the Files API called 'here', which must exist. To create this file, run: curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/here" #### curl curl -i "http://localhost:5001/api/v0/files/cp?arg=/here&arg=/there" + Body ``` curl -i "http://localhost:5001/api/v0/files/cp?arg=/here&arg=/there" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:54:12 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Code: 0 - Message: "directory already has entry by that name" + Body ``` { "Code": 0, "Message": "directory already has entry by that name" } ``` + Request With Argument This call depends upon a file in the Files API called 'here', and no 'there' file. To create this file, run: curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/here" curl -i "http://localhost:5001/api/v0/files/rm?arg=/there" #### curl curl -i "http://localhost:5001/api/v0/files/cp?arg=/here&arg=/there" + Body ``` curl -i "http://localhost:5001/api/v0/files/cp?arg=/here&arg=/there" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:51:23 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` ## ls [GET /files/ls{?arg}{&flush}] List directories. + Parameters + arg (string, required) - Path to show listing for. Default: '/'. + l (boolean, optional) - Use long listing format. Default: false. + flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/files/ls" + Body ``` curl -i "http://localhost:5001/api/v0/files/ls" ``` + Response 400 + Headers ``` Date: Fri, 19 Feb 2016 16:27:58 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'path' is required ``` + Request With Empty Argument #### curl curl -i "http://localhost:5001/api/v0/files/ls?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/files/ls?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:54:27 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must not be empty." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must not be empty." } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/files/ls?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/files/ls?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:54:48 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must start with a leading slash." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must start with a leading slash." } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/files/ls?arg=/" + Body ``` curl -i "http://localhost:5001/api/v0/files/ls?arg=/" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:55:04 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Entries (array, nullable) + (object) - Hash (Multihash) - Name (string) - Size (number) - Type (number) + Body ``` { "Entries": [ { "Hash": "", "Name": "test", "Size": 0, "Type": 0 } ] } ``` + Request With Argument And List Option #### curl curl -i "http://localhost:5001/api/v0/files/ls?arg=/&l=true" + Body ``` curl -i "http://localhost:5001/api/v0/files/ls?arg=/&l=true" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:55:19 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Entries (array, nullable) + (object) - Hash (Multihash) - Name (string) - Size (number) - Type (number) + Body ``` { "Entries": [ { "Hash": "QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o", "Name": "test", "Size": 12, "Type": 0 } ] } ``` ## mkdir [GET /files/mkdir{?arg}{&parents,flush}] Make directories. Create the directory if it does not already exist. Note: all paths must be absolute. + Parameters + arg (string, required) - Path to dir to make. + parents (boolean, optional) - No error if existing, make parent directories as needed. Default: false. Alias: p. + flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/files/mkdir" + Body ``` curl -i "http://localhost:5001/api/v0/files/mkdir" ``` + Response 400 + Headers ``` Date: Fri, 19 Feb 2016 16:38:12 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'path' is required ``` + Request With Empty Argument #### curl curl -i "http://localhost:5001/api/v0/files/mkdir?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/files/mkdir?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:55:35 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must not be empty." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must not be empty." } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/files/mkdir?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/files/mkdir?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:55:50 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must start with a leading slash." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must start with a leading slash." } ``` + Request With Existing Directory Argument #### curl curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/" + Body ``` curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:56:04 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Code: 0 - Message: "cannot create directory '/': Already exists" + Body ``` { "Code": 0, "Message": "cannot create directory '/': Already exists" } ``` + Request With Existing File Argument This depends upon a file or directory called '/test' already existing. To ensure this is true, run the command twice. #### curl curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/test" + Body ``` curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/test" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:56:19 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Code: 0 - Message: "file already exists" + Body ``` { "Code": 0, "Message": "file already exists" } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/testing" + Body ``` curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/testing" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:57:04 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` + Request With Embedded Argument and Without Parents Option #### curl curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/testing/test/test" + Body ``` curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/testing/test/test" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:57:29 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Code: 0 - Message: "file does not exist" + Body ``` { "Code": 0, "Message": "file does not exist" } ``` + Request With Embedded Argument And Parents Option #### curl curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/testing/test/test&parents" + Body ``` curl -i "http://localhost:5001/api/v0/files/mkdir?arg=/testing/test/test&parents" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:58:05 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` ## stat [GET /files/stat{?arg}{&flush}] Display file status. + Parameters + arg (string, required) - Path to node to stat. + flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/files/stat" + Body ``` curl -i "http://localhost:5001/api/v0/files/stat" ``` + Response 400 + Headers ``` Date: Fri, 19 Feb 2016 16:49:33 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'path' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: #### curl curl -i "http://localhost:5001/api/v0/files/stat?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/files/stat?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:58:20 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must not be empty." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must not be empty." } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/files/stat?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/files/stat?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:58:38 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must start with a leading slash." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must start with a leading slash." } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/files/stat?arg=/" + Body ``` curl -i "http://localhost:5001/api/v0/files/stat?arg=/" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:59:03 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Blocks (number) - CumulativeSize (number) - Hash (Multihash) - Size (number) - Type (string) + Body ``` { "Blocks": 2, "CumulativeSize": 123, "Hash": "QmZLZmaTGuVBGuuRzqqW7aoigxf1vCjSDgDgZaDNT5xyEi", "Size": 0, "Type": "directory" } ``` ## read [GET /files/read{?arg}{&flush,offset,count}] Read a file in a given mfs. Read a specified number of bytes from a file at a given offset. By default, will read the entire file similar to unix cat. + Parameters + arg (string, required) - Path to file to be read. + offset (number, optional) - Byte offset to begin reading from. Alias: o. + count (number, optional) - Maximum number of bytes to read. Alias: n. + flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/files/read" + Body ``` curl -i "http://localhost:5001/api/v0/files/read" ``` + Response 400 + Headers ``` Date: Fri, 19 Feb 2016 16:49:33 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'path' is required ``` + Request With Empty Argument #### curl curl -i "http://localhost:5001/api/v0/files/read?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/files/read?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:59:19 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must not be empty." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must not be empty." } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/files/read?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/files/read?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 18:59:36 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Paths must start with a leading slash." - Code: 0 + Body ``` { "Code": 0, "Message": "Paths must start with a leading slash." } ``` + Request With Argument This depends upon a file in the Files API named 'test' with the content: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i "http://localhost:5001/api/v0/files/read?arg=/test" + Body ``` curl -i "http://localhost:5001/api/v0/files/read?arg=/test" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Tue, 19 Apr 2016 19:02:00 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` hello world ``` + Request With Argument And Offset Option This depends upon a file in the Files API named 'test' with the content: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i "http://localhost:5001/api/v0/files/read?arg=/test&offset=10" + Body ``` curl -i "http://localhost:5001/api/v0/files/read?arg=/test&offset=10" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Tue, 19 Apr 2016 19:02:16 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` d ``` + Request With Argument And Invalid Offset Option This depends upon a file in the Files API named 'test' with the content: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i "http://localhost:5001/api/v0/files/read?arg=/test&offset=20" + Body ``` curl -i "http://localhost:5001/api/v0/files/read?arg=/test&offset=20" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:03:15 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Code (number) - Message (string) + Body ``` { "Code": 0, "Message": "Offset was past end of file (20 > 12)." } ``` + Request With Argument And Count Option This depends upon a file in the Files API named 'test' with the content: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i "http://localhost:5001/api/v0/files/read?arg=/test&count=5" + Body ``` curl -i "http://localhost:5001/api/v0/files/read?arg=/test&count=5" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Tue, 19 Apr 2016 19:03:33 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` hello ``` + Request With Argument And Invalid Count Option This depends upon a file in the Files API named 'test' with the content: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i "http://localhost:5001/api/v0/files/read?arg=/test&count=50" + Body ``` curl -i "http://localhost:5001/api/v0/files/read?arg=/test&count=50" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Tue, 19 Apr 2016 19:03:53 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` hello world ``` + Request With Argument And Invalid Count or Offset Option Type This depends upon a file in the Files API named 'test' with the content: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i "http://localhost:5001/api/v0/files/read?arg=/test&count=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/files/read?arg=/test&count=kitten" ``` + Response 400 + Headers ``` Date: Fri, 19 Feb 2016 17:04:31 GMT Content-Length: 67 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Could not convert value 'kitten' to type 'int' (for option '-count') ``` + Request With Argument And Offset And Count Options This depends upon a file in the Files API named 'test' with the content: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i "http://localhost:5001/api/v0/files/read?arg=/test&count=5&offset=2" + Body ``` curl -i "http://localhost:5001/api/v0/files/read?arg=/test&count=5&offset=2" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Tue, 19 Apr 2016 19:04:25 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` llo w ``` ## write [POST /files/write{?arg,arg2}{&offset,create,truncate,count,flush}] Write to a mutable file in a given filesystem. Write data to a file in a given filesystem. The entire length of the input will be written. If the 'create' option is specified, the file will be created if it does not exist. Nonexistant intermediate directories will not be created. If the 'flush' option is set to false, changes will not be propogated to the merkledag root. + Parameters + arg (string, required) - Path to write to. + arg2 (string, required) - Data to write. + offset (number, optional) - Byte offset to begin writing at. Alias: o. + create (number, optional) - Create the file if it does not exist. Alias: e. + truncate (boolean, optional) - Truncate the file to size zero before writing. Alias: t. + count (number, optional) - Maximum number of bytes to read. Alias: n. + flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/files/write" + Body ``` curl -i "http://localhost:5001/api/v0/files/write" ``` + Response 400 + Headers ``` Date: Fri, 19 Feb 2016 16:49:33 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'path' is required ``` + Request With Empty Argument And No Data File #### curl curl -i "http://localhost:5001/api/v0/files/write?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/files/write?arg=" ``` + Response 400 + Headers ``` Date: Fri, 19 Feb 2016 16:49:33 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` File argument 'data' is required ``` + Request With Empty Argument And Data File This request depends upon no file in the Files API at '/test', and an empty file 'test'. #### curl curl -i -X POST -F "data=test" "http://localhost:5001/api/v0/files/write?arg=/test" + Body ``` curl -i -X POST -F "data=test" "http://localhost:5001/api/v0/files/write?arg=/test" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 19:06:29 GMT Connection: close Transfer-Encoding: chunked ``` + Attributes (Error) - Code: 0 - Message: "file does not exist" + Body ``` { "Code": 0, "Message": "file does not exist" } ``` + Request With Invalid Argument #### curl curl -i -X POST -F "data=test" "http://localhost:5001/api/v0/files/write?arg=/" + Body ``` curl -i -X POST -F "data=test" "http://localhost:5001/api/v0/files/write?arg=/" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 19:08:01 GMT Connection: close Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "/ was not a file" - Code: 0 + Body ``` { "Code": 0, "Message": "/ was not a file" } ``` + Request With Argument This request depends upon a file '/test' existing in the Files API, and a file 'test' existing locally. To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/test" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/test" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 19:09:16 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` + Request With Argument With Offset Option Here, 'test' is a file with the following contents: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/test&offset=2" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/test&offset=2" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 19:10:19 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` + Request With Argument With Create Option #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/kitten&create=true" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/kitten&create=true" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 19:10:37 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` + Request With Argument With Truncate Option Here, '/test' is a file with the following contents: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/test&truncate=true" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/test&truncate=true" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 19:10:49 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` + Request With Argument With Count Option Here, '/test' is a file with the following contents: ``` hello world ``` To make sure that this exists, run the following: curl -i "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true" curl -i "http://localhost:5001/api/v0/files/cp?arg=/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&arg=/test" #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/test&count=3" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/files/write?arg=/test&count=3" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 19:11:32 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` # Group get Download IPFS objects. ## get [POST /get{?arg}{&archive,compress,compression%2Dlevel}] Stores to disk the data contained an IPFS or IPNS object(s) at the given path. + Parameters + arg (string, required) - The path to the IPFS object or objects to be outputted. + archive (boolean, optional) - Output a TAR archive. Default: false. + compress (boolean, optional) - Compress the output with GZIP compression. Default: false. + compression-level (enum[number], optional) - The level of compression. + Default: -1 + Members + -1 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/get" + Body ``` curl -i "http://localhost:5001/api/v0/get" ``` + Response 400 + Headers ``` Date: Sat, 06 Feb 2016 23:21:32 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'ipfs-path' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/get?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/get?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/get?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 15:05:18 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/get?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o" + Body ``` curl -i "http://localhost:5001/api/v0/get?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Tue, 19 Apr 2016 15:06:40 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o0000644000000000000000000000001412655500300016646 0ustar0000000000000000hello world ``` + Request With Argument And Compression Options #### curl curl -i "http://localhost:5001/api/v0/get?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&compress=true&compression-level=1" + Body ``` curl -i "http://localhost:5001/api/v0/get?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&compress=true&compression-level=1" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Tue, 19 Apr 2016 15:10:02 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ? n???H???W(?/?I???-? ``` + Request with Archive #### curl curl -i "http://localhost:5001/api/v0/get?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&archive=true" + Body ``` curl -i "http://localhost:5001/api/v0/get?arg=QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o&archive=true" ``` + Response 200 The `Content-Type` here should be `application/x-tar`. `text/plain` is the default response for output from go-ipfs, and has been included below as the current response. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Tue, 19 Apr 2016 15:19:24 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o0000644000000000000000000000001412705446174016664 0ustar0000000000000000hello world ``` # Group id Prints out information about the specified peer. If no peer is specified, prints out local peers info. ## id [POST /id{?arg}] Show IPFS Node ID info + Parameters + arg (string, required) - peerID of node to look up + Request Without Arguments This will default to showing your ID. #### curl curl -i -X POST "http://localhost:5001/api/v0/id" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/id" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:04:53 GMT Transfer-Encoding: chunked ``` + Attributes (object) + ID (Multihash) + PublicKey (string) + Addresses (SwarmAddrs) + AgentVersion (string) + ProtocolVersion (string) + Body ``` { "ID": "Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH", "PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDsXD74cPfcI0dJJzg9N3BApJvlTDmW2GsGfvjmq7Bpm++0JI3LvC3cASPqLb8aiJlynqqzgNkX/xZtAdn0ua63VUWZvamuC2HBEke2IGUF4mkgDdSTaKYMl8NlaSNZDUUthcljZ2aqkdXP+W217U/NjINksYll5IBBPGJqH5Wamb5uNXQM9LQOZSW/qP+T+NoaQGfid21oorHyeSHcugxNdvgPV0RXC6IfZS/1NkupNz2mboXdppKRs3hDKVrtz6/tYGi8kBDvx8susTxw4x8YbRHVnpjh9fIg++PLQUm5xaxQu89YSLsx23Wz3Twq2jg6gi2Tl8GZtgBaZwD9KWLpAgMBAAE=", "Addresses": [ "/ip4/127.0.0.1/tcp/4001/ipfs/Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH", "/ip4/10.0.0.42/tcp/4001/ipfs/Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH", "/ip6/::1/tcp/4001/ipfs/Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH", "/ip6/2601:184:4400:78fc:62f8:1dff:fed2:1970/tcp/4001/ipfs/Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH", "/ip6/2601:184:4400:78fc:d00c:bbbe:d064:a237/tcp/4001/ipfs/Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH", "/ip4/50.136.95.149/tcp/4001/ipfs/Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH" ], "AgentVersion": "go-ipfs/0.4.0-dev", "ProtocolVersion": "ipfs/0.1.0" } 17 ``` + Request With Empty Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/id?arg=" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/id?arg=" ``` + Response 400 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:05:03 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Invalid peer id" (string) - Code: 1 (number) + Body ``` { "Message": "Invalid peer id", "Code": 1 } ``` + Request With Invalid Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/id?arg=kitten" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/id?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:54:52 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "routing: not found" (string) - Code: 0 (number) + Body ``` { "Message": "routing: not found", "Code": 0 } ``` + Request With Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/id?arg=QmepgFW7BHEtU4pZJdxaNiv75mKLLRQnPi1KaaXmQN4V1a" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/id?arg=QmepgFW7BHEtU4pZJdxaNiv75mKLLRQnPi1KaaXmQN4V1a" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:07:55 GMT Transfer-Encoding: chunked ``` + Attributes (object) + ID (Multihash) + PublicKey (string) + Addresses (SwarmAddrs) + AgentVersion (string) + ProtocolVersion (string) + Body ``` { "ID": "QmepgFW7BHEtU4pZJdxaNiv75mKLLRQnPi1KaaXmQN4V1a", "PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC8hSwYY1FXqjT5M36O/Q5fBeDhXE5ePvGAeN3MIibfChqQpgqBbXQi1gAp4TQypSTKl/AMy7hfzsKauieim7jHMgIYAB4pLoBQD1qGVn/n7CqzAR3gDg9umIGuAy15oT0uaqMDqSepfnyxEyPDqfDklgvmS/MAwfBHjH2IPcMIaFgZ6d6gVlhmwuH8WVQ/geumDqyKuU9Jy+SUozmxEu2Baylg4fuqxaxoqOiPFZeWKSCFAngFj3NPmLApE0Fy48/eEZ+t7iP6s/raupP4+Jk/AFNDJNos4VxUnLJpZ1g6W5vYkkt1kXbMTaqxFVryCdCW2UEOwEzjGPGkcIE4RJrHAgMBAAE=", "Addresses": [ "/ip4/172.17.0.2/udp/4002/utp", "/ip4/188.40.116.66/tcp/4001", "/ip4/127.0.0.1/udp/4002/utp", "/ip4/172.17.0.2/tcp/4001", "/ip4/127.0.0.1/tcp/4001" ], "AgentVersion": "go-ipfs/0.4.0-dev", "ProtocolVersion": "ipfs/0.1.0" } ``` # Group log Interact with the daemon log output. 'ipfs log' contains utility commands to affect or read the logging output of a running daemon. This command cannot be called directly. ## level [POST /log/level{?arg1,arg2}] 'ipfs log level' is a utility command used to change the logging output of a running daemon. + Parameters + arg1 (string) - The subsystem logging identifier. Use `all` for all subsystems. + Members - bitswap - blockstore - dht - merkledag - all + arg2 (enum[string]) - The log level, with 'debug' the most verbose and 'critical' the least verbose. + Members - debug - info - notice - warning - error - critical + Request Without Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/log/level" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/log/level" ``` + Response 400 + Headers ``` Date: Fri, 05 Feb 2016 21:12:32 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'subsystem' is required ``` + Request With Empty Argument The response is the same if the first argument is invalid. For example: curl -i -X POST "http://localhost:5001/api/v0/log/level?arg=kitten" #### curl curl -i -X POST "http://localhost:5001/api/v0/log/level?arg=" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/log/level?arg=" ``` + Response 400 + Headers ``` Date: Fri, 05 Feb 2016 21:13:04 GMT Content-Length: 28 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'level' is required ``` + Request With Invalid Subsystem Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/log/level?arg=kitten&arg=info" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/log/level?arg=kitten&arg=info" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Wed, 20 Apr 2016 19:38:32 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "Error: No such logger" - Code: 0 + Body ``` { "Message": "Error: No such logger", "Code": 0 } ``` + Request With Invalid Log Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/log/level?arg=dht&arg=kitten" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/log/level?arg=dht&arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Wed, 20 Apr 2016 19:38:20 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "logger: invalid log level" - Code: 0 + Body ``` { "Message": "logger: invalid log level", "Code": 0 } ``` + Request With Valid Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/log/level?arg=dht&arg=info" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/log/level?arg=dht&arg=info" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Wed, 20 Apr 2016 19:38:00 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Message (string) + Body ``` { "Message": "Changed log level of 'dht' to 'info'\n" } ``` ## ls [GET /log/ls] This is a utility command used to list the logging subsystems of a running daemon. + Request #### curl curl -i "http://localhost:5001/api/v0/log/ls" + Body ``` curl -i "http://localhost:5001/api/v0/log/ls" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Fri, 06 May 2016 21:13:40 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Strings (array) + Body ``` { "Strings": [ "chunk", "mfs", "mount", "core", "merkledag", "table", "bitswap", "reprovider", "core/commands", "lock", "fsrepo", "gc", "cmd/ipfs", "eventlog", "blockset", "offlinerouting", "engine", "supernode", "blockstore", "pin", "coreunix", "core/server", "tarfmt", "blockservice", "path", "dht", "corerepo", "bitswap_network", "namesys", "ipns-repub", "fuse/ipfs", "commands/http", "supernode/proxy", "diagnostics", "dht.pb", "mockrouter", "dagio", "ipfsaddr", "routing/record", "command", "node", "cmds/files", "tour", "config", "importer", "flatfs", "fuse/ipns" ] } ``` ## tail [GET /log/tail] `ipfs log tail` is a utility command used to read log output as it is written. + Request #### curl curl -i "http://localhost:5001/api/v0/log/tail" + Body ``` curl -i "http://localhost:5001/api/v0/log/tail" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Wed, 20 Apr 2016 19:39:05 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - event (string) - peerID (Multihash) - session (string) - system (string) - time (string) + Body ``` { "event": "updatePeer", "peerID": "QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", "session": "90950f01-a408-455a-a560-767f326b7331", "system": "dht", "time": "2016-02-05T21:36:44.191536188Z" } ``` # Group ls List links from an object. ## ls [GET /ls{?arg}{&resolve-type}] Displays the links an IPFS or IPNS object(s) contains, with the following format: + Parameters + arg (string, required) - The path to the IPFS object or objects to list links from + resolve-type (boolean, optional) - Resolve linked objects to find out their types. Default: true. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/ls" + Body ``` curl -i "http://localhost:5001/api/v0/ls" ``` + Response 400 + Headers ``` Vary: Origin Date: Wed, 29 Jun 2016 09:28:07 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'ipfs-path' is required ``` + Request With Empty Argument The response is the same if there is an invalid argument. For example: curl -i "http://localhost:5001/api/v0/ls?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/ls?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/ls?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Wed, 29 Jun 2016 09:28:23 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Wed, 29 Jun 2016 09:28:41 GMT Transfer-Encoding: chunked ``` + Attributes (object) + `Objects` (array) + (object) - `Hash` (string) + `Links` (array) + (object) - `Name` (string) - `Hash` (string) - `Size` (number) - `Type` (number) + Body ``` { "Objects": [ { "Hash": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ", "Links": [ { "Name": "cat.jpg", "Hash": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Size": 443362, "Type": 2 } ] } ] } ``` + Request With Argument And Resolve Type #### curl curl -i "http://localhost:5001/api/v0/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&resolve-type=false" + Body ``` curl -i "http://localhost:5001/api/v0/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&resolve-type=false" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Fri, 01 Jul 2016 11:08:35 GMT Transfer-Encoding: chunked ``` + Attributes (object) + `Objects` (array) + (object) - `Hash` (string) + `Links` (array) + (object) - `Name` (string) - `Hash` (string) - `Size` (number) - `Type` (number) + Body ``` { "Objects": [ { "Hash": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ", "Links": [ { "Name": "cat.jpg", "Hash": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Size": 443362, "Type": 2 } ] } ] } ``` # Group name IPFS namespace (IPNS) tool. IPNS is a PKI namespace, where names are the hashes of public keys, and the private key enables publishing new (signed) values. This command can't be called directly. ## publish [POST /name/publish{?arg}{&resolve,lifetime,ttl}] Publish an object to IPNS. #### Bugs + Parameters + arg (string, required) - IPFS path of the object to be published. Default: your own identity public key. + resolve (boolean, optional) - Resolve given path before publishing + Default: `true` + lifetime (time, optional) - Time duration that the record will be valid for. Default: 24h. + ttl (time, optional) - Time duration this record should be cached for. Caution: experimental. + Request Without Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/name/publish" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/name/publish" ``` + Response 400 + Headers ``` Date: Sun, 07 Feb 2016 00:40:01 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'ipfs-path' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i -X POST "http://localhost:5001/api/v0/name/publish?arg=kitten" #### curl curl -i -X POST "http://localhost:5001/api/v0/name/publish?arg=" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/name/publish?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:08:37 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/name/publish?arg=" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/name/publish?arg=" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:08:46 GMT Transfer-Encoding: chunked ``` + Attributes + Name (Multihash) - IPFS hash + Value (Multihash) - IPFS path + Body ``` { "Name": "Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH", "Value": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" } ``` ## resolve [GET /name/resolve] Gets the value currently published at an IPNS name. + Parameters + arg (string, required) - The IPNS name to resolve. Defaults to your node's peerID. + recursive (boolean, optional) - Resolve until the result is not an IPNS name. Default: false. + nocache (boolean, optional) - Do not used cached entries. Default: false. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/name/resolve" + Body ``` curl -i "http://localhost:5001/api/v0/name/resolve" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:09:16 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Body ``` { "Path": "/ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" } ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/name/resolve?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/name/resolve?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/name/resolve?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:09:28 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "could not resolve name." - Code: 0 + Body ``` { "Message": "could not resolve name.", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/name/resolve?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/name/resolve?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:19:20 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Path (MultiAddr) + Body ``` { "Path": "/ipfs/QmSiTko9JZyabH56y2fussEt1A5oDqsFXB3CkvAqraFryz" } ``` # Group object Interact with ipfs objects. `ipfs object` is a plumbing command used to manipulate DAG objects directly. This command can't be called directly. ## data [GET /object/data{?arg}] Outputs the raw bytes in an IPFS object. + Parameters + arg (required, string) - Key of the object to retrieve, in base58-encoded multihash format + Request Without Arguments #### curl curl -i http://localhost:5001/api/v0/object/data + Body ``` curl -i http://localhost:5001/api/v0/object/data ``` + Response 400 + Headers ``` Date: Wed, 03 Feb 2016 19:09:38 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Body ``` Argument 'key' is required ``` + Request With Empty Argument #### curl curl -i "http://localhost:5001/api/v0/object/data?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/object/data?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:29:12 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/object/data?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/object/data?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:29:29 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/object/data?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/object/data?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error X-Stream-Output: 1 Date: Tue, 15 Mar 2016 17:29:51 GMT Transfer-Encoding: chunked ``` + Body ``` ``` ## diff [GET /object/diff{?arg1,arg2}] Takes a diff of the two given objects. This is used to show the differences between two ipfs objects. + Parameters + arg1 (string, required) - Object to diff against. + arg2 (string, required) - Object to diff. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/object/diff" + Body ``` curl -i "http://localhost:5001/api/v0/object/diff" ``` + Response 400 + Headers ``` Date: Tue, 10 May 2016 19:38:44 GMT Content-Length: 28 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'obj_a' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/ls?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/object/diff?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/object/diff?arg=" ``` + Response 400 + Headers ``` Date: Tue, 10 May 2016 19:39:23 GMT Content-Length: 28 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'obj_b' is required ``` + Request With Empty Arguments The response is the same if either argument is invalid. For example: curl -i "http://localhost:5001/api/v0/ls?arg=kitten&arg=" curl -i "http://localhost:5001/api/v0/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&arg=" #### curl curl -i "http://localhost:5001/api/v0/object/diff?arg=&arg=" + Body ``` curl -i "http://localhost:5001/api/v0/object/diff?arg=&arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Tue, 10 May 2016 19:39:58 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" (string) - Code: 0 (number) + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Tue, 10 May 2016 19:44:01 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Objects (array) - Hash (Multihash) + Links (array) - Name (string) - Hash (Multihash) - Size (number) - Type (number) + Body ``` { "Objects": [ { "Hash": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ", "Links": [ { "Name": "cat.jpg", "Hash": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Size": 443362, "Type": 2 } ] }, { "Hash": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ", "Links": [ { "Name": "cat.jpg", "Hash": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Size": 443362, "Type": 2 } ] } ] } ``` ## get [POST /object/get{?arg}{&encoding}] Get and serialize the DAG node named by . + Parameters + arg (string, required) - Key of the object to retrieve (in base58-encoded multihash format). + encoding (enum[string], optional) - Serializes the DAG node to the format specified. Alias: `enc`. + Default: `json` + Members + `json` + `protobuf` + `xml` + Request Without Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/object/get" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/get" ``` + Response 400 + Headers ``` Date: Wed, 03 Feb 2016 20:58:03 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Attributes + Body ``` Argument 'key' is required ``` + Request With Empty Argument This, and all calls with options, has the same response as it would if an invalid argument is supplied. #### curl curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:30:10 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Invalid Argument And XML Encoding #### curl curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=kitten&encoding=xml" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=kitten&encoding=xml" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/xml Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:30:20 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` invalid ipfs ref path0 ``` + Request With Invalid Argument And Protobuf Encoding #### curl curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=kitten&encoding=protobuf" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=kitten&encoding=protobuf" ``` + Response 500 + Headers ``` Date: Wed, 03 Feb 2016 21:12:39 GMT Content-Length: 0 Content-Type: text/plain; charset=utf-8 ``` + Attributes + Body ``` ``` + Request With Argument This is the same response as if `encoding=json` were added to the request. #### curl curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:30:42 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Links (array) - (object) - Name: "cat.jpg" (string) - Hash (Multihash) - Size: 443362 (number) + Data: "\u0008\u0001" (string) + Body ``` { "Links": [ { "Name": "cat.jpg", "Hash": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Size": 443362 } ], "Data": "\u0008\u0001" } ``` + Request With Argument And XML Encoding #### curl curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&encoding=xml" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&encoding=xml" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/xml Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:30:53 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` cat.jpgQmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u443362�� ``` + Request With Argument And Protobuf Encoding #### curl curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&encoding=protobuf" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/get?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&encoding=protobuf" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/protobuf Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Date: Mon, 30 May 2016 14:12:01 GMT Transfer-Encoding: chunked ``` + Body ``` 1 " ? :?^?E???p??\?|?.??t|d??U??cat.jpg? ``` ## links [GET /object/links{?arg}] Outputs the links pointed to by the specified object. + Parameters + arg (string, required) - Key of the object to retrieve, in base58-encoded multihash format + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/object/links" + Body ``` curl -i "http://localhost:5001/api/v0/object/links" ``` + Response 400 + Headers ``` Date: Wed, 03 Feb 2016 21:34:30 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'key' is required ``` + Request With Empty Argument The response is the same if an invalid argument is supplied. #### curl curl -i "http://localhost:5001/api/v0/object/links?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/object/links?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:31:24 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/object/links?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/object/links?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:32:00 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) + Links (array) + (object) - Name: "cat.jpg" (string) - Hash (Multihash) - Size: 443362 (number) + Body ``` { "Hash": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ", "Links": [ { "Name": "cat.jpg", "Hash": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Size": 443362 } ] } ``` ## new [GET /object/new{?arg}] Creates a new object from an ipfs template. By default it creates and returns a new empty merkledag node, but you may pass an optional template argument to create a preformatted node. + Parameters + arg (enum[string], optional) - Template to use. + Members - unixfs-dir + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/object/new" + Body ``` curl -i "http://localhost:5001/api/v0/object/new" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:32:19 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) - Links (array, nullable) + Body ``` { "Hash": "QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n", "Links": null } ``` + Request With Empty Argument The response is identical to a command with an invalid argument. For example: curl -i "http://localhost:5001/api/v0/object/new?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/object/new?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/object/new?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:34:30 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "template '' not found" - Code: 0 + Body ``` { "Message": "template '' not found", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/object/new?arg=unixfs-dir" + Body ``` curl -i "http://localhost:5001/api/v0/object/new?arg=unixfs-dir" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:34:48 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) - Links (array, nullable) + Body ``` { "Hash": "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn", "Links": null } ``` ## patch append-data [GET /object/patch/append-data{?arg1,arg2}] Append data to the data segment of a dag node. Append data to what already exists in the data segment in the given object. Note: This does not append data to a file - it modifies the actual raw data within an object. Objects have a max size of 1MB and objects larger than the limit will not be respected by the network. + Parameters + arg1 (string, required) - The hash of the node to modify. + arg2 (string, required) - Data to append. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/object/patch/append-data" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/append-data" ``` + Response 400 + Headers ``` Date: Fri, 26 Feb 2016 21:19:26 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'root' is required ``` + Request With Only One Argument The response is the same if the given argument is invalid. For example: curl -i "http://localhost:5001/api/v0/object/patch/append-data?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/object/patch/append-data?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/append-data?arg=" ``` + Response 400 + Headers ``` Date: Fri, 26 Feb 2016 21:19:54 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` File argument 'data' is required ``` + Request With Invalid First Argument #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/patch/append-data?arg=kitten" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/patch/append-data?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 18:20:03 GMT Connection: close Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Code": 0, "Message": "invalid ipfs ref path" } ``` + Request With Valid Arguments #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/patch/append-data?arg=/ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/patch/append-data?arg=/ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 18:20:18 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) + Body ``` { "Hash": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u" } ``` ## patch add-link [POST /object/patch/add-link{?arg1,arg2,arg3}{&create}] Add a link to a given object. Add a Merkle-link to the given object and return the hash of the result. + Parameters + arg1 (string, required) - The hash of the node to modify. + arg2 (string, required) - Name of link to create. + arg3 (string, required) - IPFS object to add link to. + create (boolean, optional) - Create intermediary nodes. Default: false. Alias: `p`. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/object/patch/add-link" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/add-link" ``` + Response 400 + Headers ``` Date: Fri, 26 Feb 2016 21:19:26 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'root' is required ``` + Request With Only One Argument The response is the same if the given argument is invalid. For example: curl -i "http://localhost:5001/api/v0/object/patch/add-link?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/object/patch/add-link?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/add-link?arg=" ``` + Response 400 + Headers ``` Date: Fri, 26 Feb 2016 21:19:54 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'name' is required ``` + Request With Invalid First Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=&arg=foo&arg=QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=&arg=foo&arg=QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 18:28:23 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Code": 0, "Message": "invalid ipfs ref path" } ``` + Request With Empty Second Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn&arg=&arg=QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn&arg=&arg=QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 18:33:00 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "cannot create link with no name!" - Code: 0 + Body ``` { "Code": 0, "Message": "cannot create link with no name!" } ``` + Request With Missing Third Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn&arg=foo&arg=" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn&arg=foo&arg=" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 18:31:31 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) + Body ``` { "Hash": "QmSt5pTDuoZ5xi1iqroo8W57Fvp4U23h5gXfj6X7rWLcbn" } ``` + Request With Invalid Third Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn&arg=foo&arg=kitten" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn&arg=foo&arg=kitten" ``` + Request With Valid Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn&arg=foo&arg=QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn&arg=foo&arg=QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 18:27:15 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) + Body ``` { "Hash": "QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx" } ``` ## patch rm-link [POST /object/patch/rm-link{?arg1,arg2}] Remove a link from an object. + Parameters + arg1 (string, required) - The hash of the node to modify. + arg2 (string, required) - Name of the link to remove. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/object/patch/rm-link" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/rm-link" ``` + Response 400 + Headers ``` Date: Fri, 26 Feb 2016 21:19:26 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'root' is required ``` + Request With Only One Argument The response is the same if the given argument is invalid or empty. For example: curl -i "http://localhost:5001/api/v0/object/patch/rm-link?arg=" Or: curl -i "http://localhost:5001/api/v0/object/patch/rm-link?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/object/patch/rm-link?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/rm-link?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx" ``` + Response 400 + Headers ``` Date: Fri, 26 Feb 2016 21:19:54 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'link' is required ``` + Request with Invalid Second Argument The response is the same if the given argument is empty. For example: curl -i "http://localhost:5001/api/v0/object/patch/rm-link?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx&arg=" #### curl curl -i "http://localhost:5001/api/v0/object/patch/rm-link?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx&arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/rm-link?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx&arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 18:55:32 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "merkledag not found" - Code: 0 + Body ``` { "Code": 0, "Message": "merkledag: not found" } ``` + Request With Valid Arguments #### curl curl -i "http://localhost:5001/api/v0/object/patch/rm-link?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx&arg=foo" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/rm-link?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx&arg=foo" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 18:57:37 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) + Body ``` { "Hash": "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn" } ``` ## patch set-data [POST /object/patch/set-data{?arg1,arg2}] Set the data field of an ipfs object. + Parameters + arg1 (string, required) - The hash of the node to modify. + arg2 (string, required) - Data to set the object to. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/object/patch/set-data" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/set-data" ``` + Response 400 + Headers ``` Date: Fri, 26 Feb 2016 21:19:26 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'root' is required ``` + Request With Invalid Root Argument #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/patch/set-data?arg=" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/patch/set-data?arg=" ``` + Response 400 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 19:10:00 GMT Connection: close Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With No Data Argument #### curl curl -i "http://localhost:5001/api/v0/object/patch/set-data?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx" + Body ``` curl -i "http://localhost:5001/api/v0/object/patch/set-data?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx" ``` + Response 400 + Headers ``` Date: Fri, 26 Feb 2016 21:19:54 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'data' is required ``` + Request With Valid Arguments #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/patch/set-data?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/patch/set-data?arg=QmZKetgwm4o3LhNaoLSHv32wBhTwj9FBwAdSchDMKyFQEx" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 19:08:54 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) + Body ``` { "Hash": "QmeKqPZ1JDHQetqntjuXAUw6G3X5rm7HBsSpjBn23yttMM" } ``` ## put [GET /object/put{?arg}{&inputenc}] Stores input as a DAG object, outputs its key. + Parameters + arg (string, required) - Data to be stored as a DAG object. + inputenc (enum[string], optional) - Encoding type of input data. + Default: `json` + Members + `protobuf` + `json` + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/object/put" + Body ``` curl -i "http://localhost:5001/api/v0/object/put" ``` + Response 400 + Headers ``` Date: Thu, 04 Feb 2016 15:50:59 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` File argument 'data' is required ``` + Request With Empty Argument The response is identical to a command with an invalid argument. For example: curl -i "http://localhost:5001/api/v0/object/put?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/object/put?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/object/put?arg=" ``` + Response 400 + Headers ``` Date: Thu, 04 Feb 2016 15:50:59 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` File argument 'data' is required ``` + Request With Argument This assumes that 'test' is a file that is correctly-coded JSON with a 'Data' field, like so: ``` { "Data": "hello world" } ``` #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/put" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/put" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:44:18 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) - Links (array, nullable) + Body ``` { "Hash": "QmU1Sq1B7RPQD2XcQNLB58qJUyJffVJqihcxmmN1STPMxf", "Links": [] } ``` + Request With Argument And Inputenc Option This assumes that 'test' is a file that is correctly-coded JSON with a 'Data' field, like so: ``` { "data": "hello world" } ``` #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/put?inputenc=json" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/object/put?inputenc=json" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Sun, 20 Mar 2016 23:32:13 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Hash (Multihash) - Links (array, nullable) + Body ``` { "Hash": "QmU1Sq1B7RPQD2XcQNLB58qJUyJffVJqihcxmmN1STPMxf", "Links": [] } ``` ## stat [GET /object/stat{?arg}] Get stats for the DAG node named by . + Parameters + arg (string, required) - Key of the object to retrieve, in base58-encoded multihash format. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/object/stat" + Body ``` curl -i "http://localhost:5001/api/v0/object/stat" ``` + Response 400 + Headers ``` Date: Thu, 04 Feb 2016 17:15:20 GMT Content-Length: 26 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'key' is required ``` + Request With Empty Argument The response is identical to a command with an invalid argument. For example: curl -i "http://localhost:5001/api/v0/object/stat?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/object/stat?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/object/stat?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:57:12 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/object/stat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/object/stat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Tue, 15 Mar 2016 17:57:27 GMT Transfer-Encoding: chunked ``` + Attributes - `Hash`: "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" (Multihash) - `NumLinks`: 1 (number) - Number of links in link table. - `BlockSize`: 53 (number) - Size of the raw, encoded data. - `LinksSize`: 53 (number) - Size of the links segment. - `DataSize`: 2 (number) - Size of the data segment, - `CumulativeSize`: 443417 (number) - Cumulative size of object and its references. + Body ``` { "Hash": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ", "NumLinks": 1, "BlockSize": 55, "LinksSize": 53, "DataSize": 2, "CumulativeSize": 443417 } ``` # Group pin Pin (and unpin) objects to local storage. This command can't be called directly. ## add [GET /pin/add{?arg}{&recursive}] Pins objects to local storage. Stores an IPFS object(s) from a given path locally to disk. + Parameters + arg (string, required) - Path to object or objects to be pinned. + recursive (boolean, optional) - Recursively pin the object linked to by the specified object or objects. Default: true. + Request Without Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/pin/add" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/pin/add" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 20:55:28 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'ipfs-path' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i -X POST "http://localhost:5001/api/v0/pin/add?arg=kitten" #### curl curl -i -X POST "http://localhost:5001/api/v0/pin/add?arg=" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/pin/add?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 13:35:19 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "pin: invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "pin: invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/pin/add?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/pin/add?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 13:35:43 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Pinned (array) - (Multihash) + Body ``` { "Pinned": [ "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ] } ``` ## ls [POST /pin/ls{&type,count,quiet}] List objects pinned to local storage. + Parameters + type (enum[string], optional) - The type of pinned keys to list. Default: `all` Members: + `all` + `direct` + `indirect` + `recursive` + count (boolean, optional) - Show refcount when listing indirect pins. + quiet (boolean, optional) - Write just hashes of objects. + Request Without Arguments #### curl curl -i -X POST "http://localhost:5001/api/v0/pin/ls" + Body ``` curl-i -X POST "http://localhost:5001/api/v0/pin/ls" ``` + Response 200 + Headers ``` Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 13:36:18 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Keys (object) + *Multihash* (object) - Type (string) + Body ``` { "Keys": { "QmPEKipMh6LsXzvtLxunSPP7ZsBM8y9xQ2SQQwBXy5UY6e": { "Type": "indirect" }, "QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB": { "Type": "recursive" }, "QmT8onRUfPgvkoPMdMvCHPYxh98iKCfFkBYM1ufYpnkHJn": { "Type": "indirect" }, "QmTumTjvcYCAvRRwQ8sDRxh8ezmrcr88YFU7iYNroGGTBZ": { "Type": "recursive" }, "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn": { "Type": "recursive" }, "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ": { "Type": "recursive" }, "QmXarR6rgkQ2fDSHjSY5nM2kuCXKYGViky5nohtwgF65Ec": { "Type": "recursive" }, "QmXifYTiYxz8Nxt3LmjaxtQNLYkjdh324L4r81nZSadoST": { "Type": "recursive" }, "QmY5heUM5qgRubMDD1og9fhCPA6QdkMp3QCwd4s7gJsyE7": { "Type": "recursive" }, "QmYCvbfNbCwFR45HiNP45rwJgvatpiW38D961L5qAhUM5Y": { "Type": "recursive" }, "QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V": { "Type": "recursive" }, "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u": { "Type": "indirect" } } } ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i -X POST "http://localhost:5001/api/v0/pin/ls?arg=kitten" #### curl curl -i -X POST "http://localhost:5001/api/v0/pin/ls?arg=" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/pin/ls?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 13:37:27 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i -X POST "http://localhost:5001/api/v0/pin/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/pin/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 13:37:42 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Keys (object) + *Multihash* (object) - Type (string) + Body ``` { "Keys": { "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ": { "Type": "recursive" } } } ``` ## rm [GET /pin/rm{?arg}{&recursive}] Removes the pinned object from local storage. + Parameters + arg (string, required) - Path to object or objects to be unpinned. + recursive (boolean, optional) - Recursively unpin the object linked to by the specified object or objects. Default: true. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/pin/rm" + Body ``` curl -i "http://localhost:5001/api/v0/pin/rm" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 21:20:08 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'ipfs-path' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/pin/rm?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/pin/rm?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/pin/rm?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 13:38:41 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/pin/rm?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/pin/rm?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 13:38:56 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Pinned (array) - (Multihash) + Body ``` { "Pinned": [ "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ] } ``` + Request With Previously Unpinned Argument #### curl curl -i "http://localhost:5001/api/v0/pin/rm?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/pin/rm?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.0-dev Trailer: X-Stream-Error Date: Wed, 13 Apr 2016 13:39:09 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "not pinned" - Code: 0 + Body ``` { "Message": "not pinned", "Code": 0 } ``` # Group ping Send echo request packets to IPFS hosts. Send pings to a peer to verify connectivity and determine latency. ## ping [GET /ping{?arg}{&count}] A tool to test sending data to other nodes. It finds nodes via the routing system, sends pings, waits for pongs, and prints out round- trip latency information. + Parameters + arg (string, required) - ID of peer to be pinged. + count (number, required) - Number of ping messages to send. Default: 10. Alias: n. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/ping" + Body ``` curl -i "http://localhost:5001/api/v0/ping" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 21:32:09 GMT Content-Length: 30 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'peer ID' is required ``` + Request With Empty Argument #### curl curl -i "http://localhost:5001/api/v0/ping?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/ping?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:26:25 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "multihash too short. must be > 3 bytes" - Code: 0 + Body ``` { "Message": "multihash too short. must be > 3 bytes", "Code": 0 } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/ping?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/ping?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:26:35 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "multihash length inconsistent: &{6 174 [128 54 35]}" - Code: 0 + Body ``` { "Message": "multihash length inconsistent: &{6 174 [128 54 35]}", "Code": 0 } ``` + Request With Invalid Peer Lookup #### curl curl -i "http://localhost:5001/api/v0/ping?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/ping?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:26:43 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Success (boolean) - Time (number) - Text (string) + Body ``` { "Success": false, "Time": 0, "Text": "Looking up peer QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" } { "Success": false, "Time": 0, "Text": "Peer lookup error: routing: not found" } ``` + Request With Valid Peer Argument And Count #### curl curl -i "http://localhost:5001/api/v0/ping?arg=QmT19P4HExyfDqZAU65LWyuuJU31G8uWKPoFkQPEcqYGD2&count=3" + Body ``` curl -i "http://localhost:5001/api/v0/ping?arg=QmT19P4HExyfDqZAU65LWyuuJU31G8uWKPoFkQPEcqYGD2&count=3" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Thu, 28 Apr 2016 17:27:04 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Success (boolean) - Time (number) - Text (string) + Body ``` { "Success": false, "Time": 0, "Text": "PING QmT19P4HExyfDqZAU65LWyuuJU31G8uWKPoFkQPEcqYGD2." } { "Success": true, "Time": 1074991663, "Text": "" } { "Success": true, "Time": 175805337, "Text": "" } { "Success": true, "Time": 175803520, "Text": "" } { "Success": false, "Time": 0, "Text": "Average latency: 475.53ms" } ``` # Group refs Lists the hashes of all the links an IPFS or IPNS object(s) contains, with the following format: ## refs [GET /refs{?arg}{&format,edges,unique,recursive}] Lists links (references) from an object. + Parameters + arg (string, required) - Path to the object or objects to list refs from. + format (string, optional) - Emit edges with given format. Available tokens: ``, ``, ``. + Default: `` + edges (boolean, optional) - Emit edge format: ` -> `. Alias: e. + unique (boolean, optional) - Omit duplicate refs from output. Alias: u. + recursive (boolean, optional) - Recursively list links of child nodes. Alias: r. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/refs" + Body ``` curl -i "http://localhost:5001/api/v0/refs" ``` + Response 400 + Headers ``` Vary: Origin Date: Mon, 13 Jun 2016 10:56:22 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'ipfs-path' is required ``` + Request With Empty Argument The response is the same if there is an invalid argument. For example: curl -i "http://localhost:5001/api/v0/refs?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/refs?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/refs?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Mon, 13 Jun 2016 10:56:45 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/refs?arg=QmPEKipMh6LsXzvtLxunSPP7ZsBM8y9xQ2SQQwBXy5UY6e" + Body ``` curl -i "http://localhost:5001/api/v0/refs?arg=QmPEKipMh6LsXzvtLxunSPP7ZsBM8y9xQ2SQQwBXy5UY6e" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin X-Chunked-Output: 1 Date: Mon, 13 Jun 2016 10:57:06 GMT Transfer-Encoding: chunked ``` + Attributes + Body ``` ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/refs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/refs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin X-Chunked-Output: 1 Date: Mon, 13 Jun 2016 10:57:18 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Ref (Multihash) - Err (string) + Body ``` { "Ref": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Err": "" } ``` + Request With Argument And Edge Option #### curl curl -i "http://localhost:5001/api/v0/refs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&edges" + Body ``` curl -i "http://localhost:5001/api/v0/refs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&edges" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin X-Chunked-Output: 1 Date: Mon, 13 Jun 2016 10:57:34 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Ref (string) - Err (string) + Body ``` { "Ref": "QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ -\u003e Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Err": "" } ``` + Request With Argument And Recursive Option #### curl curl -i "http://localhost:5001/api/v0/refs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&recursive" + Body ``` curl -i "http://localhost:5001/api/v0/refs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&recursive" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin X-Chunked-Output: 1 Date: Mon, 13 Jun 2016 10:57:53 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Ref (Multihash) - Err (string) + Body ``` { "Ref": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u", "Err": "" } { "Ref": "QmPEKipMh6LsXzvtLxunSPP7ZsBM8y9xQ2SQQwBXy5UY6e", "Err": "" } { "Ref": "QmT8onRUfPgvkoPMdMvCHPYxh98iKCfFkBYM1ufYpnkHJn", "Err": "" } ``` + Request With Argument And Recursive Option #### curl curl -i "http://localhost:5001/api/v0/refs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&format=%20%20" + Body ``` curl -i "http://localhost:5001/api/v0/refs?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ&format=%20%20" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin X-Chunked-Output: 1 Date: Mon, 13 Jun 2016 10:58:05 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Ref (string) - In this format, ` `. - Err (string) + Body ``` { "Ref": "cat.jpg Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ", "Err": "" } ``` ## local [GET /refs/local] Lists all local references. Displays the hashes of all local objects. + Request #### curl curl -i http://localhost:5001/api/v0/refs/local + Body ``` curl -i http://localhost:5001/api/v0/refs/local ``` + Response 200 The response has been truncated, to show only a sample of identically-formatted ndjson objects. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin X-Chunked-Output: 1 Date: Mon, 13 Jun 2016 10:58:20 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Ref (Multihash) - Err (string) + Body ``` { "Ref": "QmNLxtKFa66yoRQHWa4FXkwCMqVpWGhg2XBXAfwKvSmJFp", "Err": "" } { "Ref": "QmNXFHU3KzhzXN9pZ5Bdghk3LYGj58Xzi7WvMVVoykdLxA", "Err": "" } ``` # Group repo Manipulate the IPFS repo. This command can't be called directly. ## fsck [GET /repo/fsck] Removes repo lockfiles. This is a plumbing command that will remove repo and level db lockfiles, as well as the api file. This command can only run when no ipfs daemons are running. + Request #### curl curl -i "http://localhost:5001/api/v0/repo/fsck" + Body ``` curl -i "http://localhost:5001/api/v0/repo/fsck" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 21:03:12 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Message (string) + Body ``` { "Message": "Lockfiles have been removed.\n" } ``` ## gc [GET /repo/gc] Sweep the local set of stored objects and remove ones that are not pinned in order to reclaim hard disk space. + Request #### curl curl -i "http://localhost:5001/api/v0/repo/gc" + Body ``` curl -i "http://localhost:5001/api/v0/repo/gc" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Tue, 19 Apr 2016 15:44:31 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Key (Multihash) The key which has been removed. + Body ``` {"Key":"QmNLvkCDV6ZjUJsEwGNporYBuZdhWT6q7TBVYQwwRv12HT"} {"Key":"QmNMkhF7m6CjJiNLsDbGrhfTbpjfTUu6qG3SVSMQ32isWb"} ``` ## stat [GET /repo/stat] Get stats for the currently used repo. This is a plumbing command that will scan the local set of stored objects and print repo statistics. + Request #### curl curl -i "http://localhost:5001/api/v0/repo/stat" + Body ``` curl -i "http://localhost:5001/api/v0/repo/stat" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Mon, 13 Jun 2016 11:08:59 GMT Transfer-Encoding: chunked ``` + Attributes (object) - NumObjects (number) Number of objects in the local repo. - RepoPath (number) Size in bytes that the repo is currently taking. - RepoSize (string) The path to the repo being currently used. - Version (string) The repo version. + Body ``` { "NumObjects": 412, "RepoSize": 68689750, "RepoPath": "/Users/richard/.ipfs", "Version": "fs-repo@3" } ``` ## verify [GET /repo/verify] Verify all blocks in repo are not corrupted. + Request #### curl curl -i "http://localhost:5001/api/v0/repo/verify" + Body ``` curl -i "http://localhost:5001/api/v0/repo/verify" ``` + Response 200 The response has been truncated. + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.3-dev Trailer: X-Stream-Error Vary: Origin X-Chunked-Output: 1 Date: Wed, 27 Jul 2016 21:26:38 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - Message: "" (string) - Progress: 1 (number) + Body ``` { "Message": "", "Progress": 1 } { "Message": "", "Progress": 2 } ... { "Message": "", "Progress": 143 } { "Message": "", "Progress": 144 } { "Message": "verify complete, all blocks validated.", "Progress": 0 } ``` ## version [GET /repo/version] Show the repo version. + Request #### curl curl -i "http://localhost:5001/api/v0/repo/version" + Body ``` curl -i "http://localhost:5001/api/v0/repo/version" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Tue, 28 Jun 2016 11:13:47 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Version: "3" (string) + Body ``` { "Version": "3" } ``` # Group resolve Resolve the value of names to IPFS. ## resolve [GET /resolve{?arg}{&resolve}] There are a number of mutable name protocols that can link among themselves and into IPNS. For example IPNS references can (currently) point at an IPFS object, and DNS links can point at other DNS links, IPNS entries, or IPFS objects. This command accepts any of these identifiers and resolves them to the referenced item. + Parameters + arg (string, required) - The name to resolve. + recursive (boolean, optional) - Resolve until the result is an IPFS name. Default: false. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/resolve" + Body ``` curl -i "http://localhost:5001/api/v0/resolve" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 21:49:48 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'name' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/resolve?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/resolve?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/resolve?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:29:29 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/resolve?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/resolve?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:29:37 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Path (MultiAddr) + Body ``` { "Path": "/ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" } ``` # Group stats Query IPFS statistics. This command can't be called directly. ## bitswap [GET /stats/bitswap] Show some diagnostic information on the bitswap agent. This command is identical to '/bitswap/stat'. + Request #### curl curl -i http://localhost:5001/api/v0/stats/bitswap + Body ``` curl -i http://localhost:5001/api/v0/stats/bitswap ``` + Response 200 + Attributes (object) + ProvideBufLen: 0 (number) + Wantlist (array, nullable) + Peers (array) - QmNjRVohhWBX31EoaAXkrj5mPF9vQNcTVvQgWHNwdxweCN (Multihash) + BlocksReceived: 0 (number) + DupBlksReceived: 0 (number) + DupDataReceived: 0 (number) + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Mon, 13 Jun 2016 11:06:46 GMT Transfer-Encoding: chunked ``` + Body ``` { "ProvideBufLen": 0, "Wantlist": null, "Peers": [ "QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM", "QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z", "QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm" ], "BlocksReceived": 0, "DupBlksReceived": 0, "DupDataReceived": 0 } ``` ## bw [POST /stats/bw{&peer,proto,poll,interval}] Print ipfs bandwidth information. By default, overall bandwidth and all protocols are shown. To limit bandwidth to a particular peer, use the 'peer' parameter along with that peer's multihash id. To specify a specific protocol, use the 'proto' parameter. The 'peer' and 'proto' params cannot be specified simultaneously. The protocols that are queried using this method are outlined in the specification: https://github.com/ipfs/specs/blob/master/libp2p/7-properties.md#757-protocol-multicodecs Example protocol options: - /ipfs/id/1.0.0 - /ipfs/bitswap - /ipfs/dht + Parameters + peer (string, optional) - Specify a peer to print bandwidth for. + proto (string, optional) - Specify a protocol to print bandwidth for. + poll (boolean, optional) - Print bandwidth at an interval. Default: false. + interval (time, optional) - Time interval to wait between updating output, if `poll` is true. Default: `1s`. + Request Without Arguments The response format is the same if `peer` is specified as an option. Specifying a peer changes the returned data to show bandwidth utilization between your peer and the given peer. Otherwise, it shows overall bandwidth. Example command: curl -i -X POST "http://localhost:5001/api/v0/stats/bw?peer=QmdoxVqayD8z9aummFscKq56hX58VWD4axGYqF7uTdQ2h3" The response format is similarly the same if a protocol is provided. Example command: curl -i -X POST "http://localhost:5001/api/v0/stats/bw?proto=/ipfs/dht" #### curl curl -i -X POST "http://localhost:5001/api/v0/stats/bw" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/stats/bw" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Tue, 19 Apr 2016 15:51:41 GMT Transfer-Encoding: chunked ``` + Attributes (object) - TotalIn: 119395 (number) - TotalOut: 47349 (number) - RateIn: 296.8016259649661 (number) - RateOut: 199.70053032537362 (number) + Body ``` { "TotalIn": 65845, "TotalOut": 41110, "RateIn": 42.05674059848161, "RateOut": 38.231572699901825 } ``` + Request With Poll #### curl curl -i -X POST "http://localhost:5001/api/v0/stats/bw?poll=true" + Body ``` curl -i -X POST "http://localhost:5001/api/v0/stats/bw?poll=true" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error X-Chunked-Output: 1 Date: Tue, 19 Apr 2016 15:51:56 GMT Transfer-Encoding: chunked ``` + Attributes (ndjson) - TotalIn: 119395 (number) - TotalOut: 47349 (number) - RateIn: 296.8016259649661 (number) - RateOut: 199.70053032537362 (number) + Body ``` { "TotalIn": 915924, "TotalOut": 1447341, "RateIn": 645.9019575524085, "RateOut": 785.6200405093209 } { "TotalIn": 917684, "TotalOut": 1450578, "RateIn": 550.0080313689939, "RateOut": 738.0719064674622 } ``` ## repo [GET /stats/repo] Get stats for the currently used repo. This is a plumbing command that will scan the local set of stored objects and print repo statistics. This command is identical to '/repo/stat'. + Request #### curl curl -i "http://localhost:5001/api/v0/stats/repo" + Body ``` curl -i "http://localhost:5001/api/v0/stats/repo" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Vary: Origin Date: Mon, 13 Jun 2016 11:08:59 GMT Transfer-Encoding: chunked ``` + Attributes (object) - NumObjects (number) Number of objects in the local repo. - RepoPath (number) Size in bytes that the repo is currently taking. - RepoSize (string) The path to the repo being currently used. - Version (string) The repo version. + Body ``` { "NumObjects": 412, "RepoSize": 68689750, "RepoPath": "/Users/richard/.ipfs", "Version": "fs-repo@3" } ``` # Group swarm Swarm inspection tool. This command can't be called directly. ## addrs [GET /swarm/addrs] List known addresses. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/swarm/addrs" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/addrs" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:18:52 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Addrs (SwarmAddrs) + Body ``` { "Addrs": { "QmNfCubGpwYZAQxX8LQDsYgB48C4GbfZHuYdexpX9mbNyT": [ "/ip4/127.0.0.1/tcp/4001", "/ip4/192.168.0.101/tcp/4001", "/ip4/70.81.176.29/tcp/48695", "/ip6/::1/tcp/4001" ], ... } } ``` ## addrs local [GET /swarm/addrs/local{&id}] List all local addresses the node is listening on. + Parameters + id (boolean, optional) - Show peer ID in addresses. Default: false. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/swarm/addrs/local" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/addrs/local" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:20:39 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Strings (array) - (MultiAddr) + Body ``` { "Strings": [ "/ip4/127.0.0.1/tcp/4001", "/ip4/192.168.1.16/tcp/4001", "/ip4/71.174.227.206/tcp/4001", "/ip6/::1/tcp/4001" ] } ``` + Request With ID Option #### curl curl -i "http://localhost:5001/api/v0/swarm/addrs/local?id=true" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/addrs/local?id=true" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:21:43 GMT Transfer-Encoding: chunked ``` + Attributes (object) + Strings (array) - (MultiAddr) + Body ``` { "Strings": [ "/ip4/127.0.0.1/tcp/4001/ipfs/QmdYnTGEjDHHvbcT6TucgDLBCF3f6cYZUDqMbUVr9bvTh2", "/ip4/192.168.1.16/tcp/4001/ipfs/QmdYnTGEjDHHvbcT6TucgDLBCF3f6cYZUDqMbUVr9bvTh2", "/ip4/71.174.227.206/tcp/4001/ipfs/QmdYnTGEjDHHvbcT6TucgDLBCF3f6cYZUDqMbUVr9bvTh2", "/ip6/::1/tcp/4001/ipfs/QmdYnTGEjDHHvbcT6TucgDLBCF3f6cYZUDqMbUVr9bvTh2" ] } ``` ## connect [GET /swarm/connect{?arg}] Open a connection to the given address. + Parameters + arg (MultiAddr, required) - Address of peer to connect to. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/swarm/connect" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/connect" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 23:05:00 GMT Content-Length: 30 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'address' is required ``` + Request With Empty Argument #### curl curl -i "http://localhost:5001/api/v0/swarm/connect?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/connect?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:22:04 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid peer address: invalid ipfs address" - Code: 0 + Body ``` { "Message": "invalid peer address: invalid ipfs address", "Code": 0 } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/swarm/disconnect?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/disconnect?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:22:23 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid peer address: invalid multiaddr, must begin with /" - Code: 0 + Body ``` { "Message": "invalid peer address: invalid multiaddr, must begin with /", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/swarm/connect?arg=/ip4/40.78.22.28/tcp/4001/ipfs/QmXsaWN5ygTqHwtfoLk5gX1uvrJrYvgKtwa6TUAh4PpAKW" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/connect?arg=/ip4/40.78.22.28/tcp/4001/ipfs/QmXsaWN5ygTqHwtfoLk5gX1uvrJrYvgKtwa6TUAh4PpAKW" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:22:50 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Strings (array) - (string) + Body ``` { "Strings": [ "connect QmXsaWN5ygTqHwtfoLk5gX1uvrJrYvgKtwa6TUAh4PpAKW success" ] } ``` ## disconnect [GET /swarm/disconnect{?arg}] Close the connection to a given address. The disconnect is not permanent; if ipfs needs to talk to that address later, it will reconnect. + Parameters + arg (MultiAddr, required) - Address of peer to disconnect from. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/swarm/disconnect" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/disconnect" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 23:05:00 GMT Content-Length: 30 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'address' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: #### curl curl -i "http://localhost:5001/api/v0/swarm/disconnect?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/disconnect?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:23:18 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid peer address: invalid ipfs address" - Code: 0 + Body ``` { "Message": "invalid peer address: invalid ipfs address", "Code": 0 } ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/swarm/disconnect?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/disconnect?arg=kitten" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:23:29 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid peer address: invalid multiaddr, must begin with /" - Code: 0 + Body ``` { "Message": "invalid peer address: invalid multiaddr, must begin with /", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/swarm/disconnect?arg=/ip4/40.78.22.28/tcp/4001/ipfs/QmXsaWN5ygTqHwtfoLk5gX1uvrJrYvgKtwa6TUAh4PpAKW" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/disconnect?arg=/ip4/40.78.22.28/tcp/4001/ipfs/QmXsaWN5ygTqHwtfoLk5gX1uvrJrYvgKtwa6TUAh4PpAKW" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:23:42 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Strings (array) - (string) + Body ``` { "Strings": [ "disconnect QmXsaWN5ygTqHwtfoLk5gX1uvrJrYvgKtwa6TUAh4PpAKW success" ] } ``` ## filters [GET /swarm/filters] List out all currently applied filters. The subcommands can be used to add or remove said filters. Filters are specified using the multiaddr-filter format: **Example:** ``` /ip4/192.168.0.0/ipcidr/16 ``` Where the above is equivalent to the standard CIDR: ``` 192.168.0.0/16 ``` Filters default to those specified under the `"Swarm.AddrFilters"` config key. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/swarm/filters" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/filters" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:29:50 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Strings (array, nullable) - "/ip4/192.168.0.0/ipcidr/16" (MultiAddr) + Body ``` { "Strings": null } ``` ## filters add [GET /swarm/filters/add{?arg}] Add the given multiaddr to the filter list. 'ipfs swarm filters add' will add an address filter to the daemon's swarm. Filters applied this way will not persist daemon reboots, to achieve that, add your filters to the IPFS config file. + Parameters + arg (MultiAddr, required) - Address to add to the filter list + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/swarm/filters/add" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/filters/add" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 23:17:09 GMT Content-Length: 30 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'address' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/swarm/filters/add?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/swarm/filters/add?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/filters/add?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:30:02 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid multiaddr-filter format" - Code: 0 + Body ``` { "Message": "invalid multiaddr-filter format", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/swarm/filters/add?arg=/ip4/192.168.0.0/ipcidr/16" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/filters/add?arg=/ip4/192.168.0.0/ipcidr/16" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:30:11 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` ## filters rm [GET /swarm/filters/rm{?arg}] Remove the given multiaddr from the filter list. 'ipfs swarm filters rm' will remove an address filter from the daemons swarm. Filters removed this way will not persist daemon reboots, to achieve that, remove your filters from the IPFS config file. + Parameters + arg (MultiAddr, required) - Address to remove from the filter list + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/swarm/filters/rm" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/filters/rm" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 23:17:09 GMT Content-Length: 30 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'address' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/swarm/filters/rm?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/swarm/filters/rm?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/filters/rm?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:29:31 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid multiaddr-filter format" - Code: 0 + Body ``` { "Message": "invalid multiaddr-filter format", "Code": 0 } ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/swarm/filters/rm?arg=/ip4/192.168.0.0/ipcidr/16" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/filters/rm?arg=/ip4/192.168.0.0/ipcidr/16" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1-dev Trailer: X-Stream-Error Date: Tue, 19 Apr 2016 16:29:41 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` ## peers [GET /swarm/peers{?verbose}] List the set of peers the node is connected to. + Parameters + verbose (boolean, optional) - Also display latency along with peer information in the following form: . Alias: v. Default: false. + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/swarm/peers" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/peers" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Date: Wed, 01 Jun 2016 14:47:02 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Strings (array, nullable) - (MultiAddr) + Body ``` { "Strings": [ "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z", "/ip4/144.76.172.110/tcp/4001/ipfs/QmcqtYSXyK4LtFoTm43UYLDrPtodP7aVX2qDGjFuVLZuaW", "/ip4/158.69.48.74/tcp/4001/ipfs/QmWYP5a1UDgFRJY1jXa9jMvnkLsZ45ivABq1nsYFfWqE7u", "/ip4/178.62.158.247/tcp/14001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", "/ip4/185.14.30.146/tcp/4001/ipfs/QmRmkky7qQBjCAU2gFUqfy3NXD7BPq8YVLPM7GHXBz7b5P", "/ip4/192.241.197.120/tcp/4001/ipfs/QmSGYB8socm1hcrFg4gibMYWNcjTh37xRLRVtgoU9vmg3w", "/ip4/193.219.36.233/tcp/4001/ipfs/QmVjEQAUXCEQMDmvgtsd5f2EsgTbg33Cpis5TDM3uVP9Vs", "/ip4/37.187.116.23/tcp/4001/ipfs/QmbqE6UfCJaXST3i65zbr649s8cJCUoP9m3UFUrXcNgeDn", "/ip4/45.55.151.20/tcp/4001/ipfs/QmdkJZUWnVkEc6yfptVu4LWY8nHkEnGwsxqQ233QSGj8UP", "/ip4/46.101.230.105/tcp/4001/ipfs/QmNSkXT3CdFs4WpKDxPpkXyYSbBoJBGuAM4bE9jDAMDdKq", "/ip4/5.9.59.34/tcp/4001/ipfs/QmRv1GNseNP1krEwHDjaQMeQVJy41879QcDwpJVhY8SWve", "/ip4/52.34.140.240/tcp/4001/ipfs/QmbCs2voAqpHZSecVtqRnfkMu2QW8JoSGAqHoch6no1YYP", "/ip4/52.36.247.108/tcp/4001/ipfs/QmPPd5xtYnJHYS8LxV6UNTGwLTvRhYR9VMDJrP8NscPQd8", "/ip4/52.63.206.249/tcp/4001/ipfs/QmWBLbdfH2KvrjkSzAYknqM3bDnAEFLAqUGbKzFUUjkDAu", "/ip4/65.19.134.244/udp/4001/utp/ipfs/Qmd8m2mmgdB9eRFyumGgj97FvPR3GJRPjSVKtiwcrdop4K", "/ip4/82.221.106.113/tcp/4001/ipfs/QmdoxVqayD8z9aummFscKq56hX58VWD4axGYqF7uTdQ2h3", "/ip4/86.120.53.110/tcp/24429/ipfs/QmNcYn35QuRXCUqWrjNXC6GdDa81xyp8FWJzqyum2D5jMp", "/ip4/95.129.55.173/tcp/4001/ipfs/QmZ86ow1byeyhNRJEatWxGPJKcnQKG7s51MtbHdxxUddTH", "/ip4/95.27.70.121/tcp/32513/ipfs/QmQs6Poz3c8h3PG3UujQi1z4zfDJY6pa3YonUvkE3RvgYu" ] } ``` + Request With Verbose #### curl curl -i "http://localhost:5001/api/v0/swarm/peers?verbose=true" + Body ``` curl -i "http://localhost:5001/api/v0/swarm/peers?verbose=true" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.2 Trailer: X-Stream-Error Date: Wed, 01 Jun 2016 14:49:22 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Strings (array, nullable) - (string) - Multiaddr with latency information in time format. + Body ``` { "Strings": [ "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ 740.111388ms", "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z 376.679609ms", "/ip4/144.76.172.110/tcp/4001/ipfs/QmcqtYSXyK4LtFoTm43UYLDrPtodP7aVX2qDGjFuVLZuaW 218.785157ms", "/ip4/158.69.21.139/tcp/4001/ipfs/QmPz9uv4HUP1er5TGaaoc4NVCbN8VFMrf5gwvxfmtSAmGv 221.844286ms", "/ip4/158.69.48.74/tcp/4001/ipfs/QmWYP5a1UDgFRJY1jXa9jMvnkLsZ45ivABq1nsYFfWqE7u 423.110302ms", "/ip4/163.172.157.39/tcp/4001/ipfs/QmP9Pxn13GiAufcXfjGgXF4ktfD4Easj9j9RKfFEbqrKjz 59.928358ms", "/ip4/172.245.99.11/tcp/34001/ipfs/QmTv99LaBwegvtRgUaUUy6JSzF6q8i2FCJdy7fJQxqAtU8 352.173945ms", "/ip4/178.62.158.247/tcp/14001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd 91.905421ms", "/ip4/185.14.30.146/tcp/4001/ipfs/QmRmkky7qQBjCAU2gFUqfy3NXD7BPq8YVLPM7GHXBz7b5P 122.556197ms", "/ip4/188.166.146.223/tcp/4001/ipfs/Qmbjn4xnJmpf3G3iQ9zJYEKKYxjB8diG3a2CT7FS1ZgtMx 88.385637ms", "/ip4/192.241.197.120/tcp/4001/ipfs/QmSGYB8socm1hcrFg4gibMYWNcjTh37xRLRVtgoU9vmg3w 416.255574ms", "/ip4/193.219.36.233/tcp/4001/ipfs/QmVjEQAUXCEQMDmvgtsd5f2EsgTbg33Cpis5TDM3uVP9Vs 296.449158ms", "/ip4/213.138.110.195/tcp/4001/ipfs/QmairS6YvvdhVcPmWM6juu12A8UixjrknFVDKBn8tZ7R1Z 83.910351ms", "/ip4/37.187.116.23/tcp/4001/ipfs/QmbqE6UfCJaXST3i65zbr649s8cJCUoP9m3UFUrXcNgeDn 133.655682ms", "/ip4/45.55.151.20/tcp/4001/ipfs/QmdkJZUWnVkEc6yfptVu4LWY8nHkEnGwsxqQ233QSGj8UP 974.919025ms", "/ip4/46.101.230.105/tcp/4001/ipfs/QmNSkXT3CdFs4WpKDxPpkXyYSbBoJBGuAM4bE9jDAMDdKq 182.658883ms", "/ip4/5.9.59.34/tcp/4001/ipfs/QmRv1GNseNP1krEwHDjaQMeQVJy41879QcDwpJVhY8SWve 71.508445ms", "/ip4/50.161.3.114/tcp/4001/ipfs/QmSsrEQN8mZeGFb5ZmjK5Ec2BCE7wLRmpzeLcnPUH3RLaL 203.250386ms", "/ip4/52.34.140.240/tcp/4001/ipfs/QmbCs2voAqpHZSecVtqRnfkMu2QW8JoSGAqHoch6no1YYP 841.227969ms", "/ip4/52.36.247.108/tcp/4001/ipfs/QmPPd5xtYnJHYS8LxV6UNTGwLTvRhYR9VMDJrP8NscPQd8 920.241856ms", "/ip4/52.39.237.57/tcp/4001/ipfs/Qma1KPdFYfDKB7peA8v9KgiibweDY2tWwC9KPQ2uC86yjB 320.427224ms", "/ip4/52.63.206.249/tcp/4001/ipfs/QmWBLbdfH2KvrjkSzAYknqM3bDnAEFLAqUGbKzFUUjkDAu 1.322415139s", "/ip4/65.19.134.244/udp/4001/utp/ipfs/Qmd8m2mmgdB9eRFyumGgj97FvPR3GJRPjSVKtiwcrdop4K 363.342377ms", "/ip4/65.34.170.14/tcp/4001/ipfs/QmdGXJE9U9wway6PoLZdzkZtkxwN7kvqgHa1SYps54U61a 312.207797ms", "/ip4/71.204.170.241/tcp/4001/ipfs/QmbW7bf7DdF7MMsoFi1vwxtTgka2pmibME5xSzwgi4tzW2 360.15412ms", "/ip4/81.241.186.204/tcp/60633/ipfs/QmNcsekuFFcQHYuuqE1d9uZgSfqLSa3WaxqMcbKkK4vyQD 76.519066ms", "/ip4/82.221.106.113/tcp/4001/ipfs/QmdoxVqayD8z9aummFscKq56hX58VWD4axGYqF7uTdQ2h3 150.14925ms", "/ip4/86.120.53.110/tcp/24429/ipfs/QmNcYn35QuRXCUqWrjNXC6GdDa81xyp8FWJzqyum2D5jMp 138.966261ms", "/ip4/91.121.16.67/tcp/4001/ipfs/QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 56.652597ms", "/ip4/94.23.12.202/tcp/4001/ipfs/QmfKhDQk8PRS7NDFtjrvNvqbXdstEpPWMewnmw7hUwx6fD 46.961408ms", "/ip4/95.129.55.173/tcp/4001/ipfs/QmZ86ow1byeyhNRJEatWxGPJKcnQKG7s51MtbHdxxUddTH 94.666187ms", "/ip4/95.27.70.121/tcp/32513/ipfs/QmQs6Poz3c8h3PG3UujQi1z4zfDJY6pa3YonUvkE3RvgYu 395.265568ms" ] } ``` # Group tar Utility functions for tar files in ipfs This command can't be called directly. ## add [POST /tar/add{?arg}] Import a tar file into IPFS. 'ipfs tar add' will parse a tar file and create a merkledag structure to represent it. + Parameters + arg (string, required) - Tar file to add. + Request Without Arguments The response is the same if the argument is invalid. For example: curl -i -F "data=@test" -X POST "http://localhost:5001/api/v0/tar/add" Where 'test' is not a tarball. #### curl curl -i "http://localhost:5001/api/v0/tar/add" + Body ``` curl -i "http://localhost:5001/api/v0/tar/add" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 22:03:51 GMT Content-Length: 32 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` File argument 'file' is required ``` + Request With Argument Where 'test' is a tarball in the current directory. #### curl curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/tar/add?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i -X POST -F "data=@test" "http://localhost:5001/api/v0/tar/add?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:30:41 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Name (string) - Hash (Multihash) + Body ``` { "Name": "test", "Hash": "QmUkwXfkw4mHH9PB53b5fR5C1YsjhLxz3LbjBehB9Q6LAG" } ``` ## cat [GET /tar/cat{?arg}] Export a tar file from IPFS 'ipfs tar cat' will export a tar file from a previously imported one in IPFS. + Parameters + arg (string, required) - IPFS path of archive to export + Request Without Arguments #### curl curl -i "http://localhost:5001/api/v0/tar/cat" + Body ``` curl -i "http://localhost:5001/api/v0/tar/cat" ``` + Response 400 + Headers ``` Date: Thu, 11 Feb 2016 22:11:47 GMT Content-Length: 27 Content-Type: text/plain; charset=utf-8 ``` + Attributes (string) + Body ``` Argument 'path' is required ``` + Request With Empty Argument The response is the same if the argument is invalid. For example: curl -i "http://localhost:5001/api/v0/tar/cat?arg=kitten" #### curl curl -i "http://localhost:5001/api/v0/tar/cat?arg=" + Body ``` curl -i "http://localhost:5001/api/v0/tar/cat?arg=" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:30:55 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "invalid ipfs ref path" - Code: 0 + Body ``` { "Message": "invalid ipfs ref path", "Code": 0 } ``` + Request With Valid IPFS Hash But Not A Tarfile #### curl curl -i "http://localhost:5001/api/v0/tar/cat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/tar/cat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 500 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:31:05 GMT Transfer-Encoding: chunked ``` + Attributes (Error) - Message: "not an ipfs archive" - Code: 0 + Body ``` { "Message": "not an ipfs tarchive", "Code": 0 } ``` + Request With Argument This call depends on the given hash being a tar file. #### curl curl -i "http://localhost:5001/api/v0/tar/cat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" + Body ``` curl -i "http://localhost:5001/api/v0/tar/cat?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Stream-Output: 1 Date: Thu, 28 Apr 2016 17:31:33 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` input0000644000076500000240000000200012657203016012731 0ustar00richardstaff00000000000000 ``` # Group tour This is a tour that takes you through various IPFS concepts, features, and tools to make sure you get up to speed with IPFS very quickly. ## tour [GET /tour{?arg}] Start the tour + Parameters + arg (string, optional) - Topic id to go to + Request Without Arguments The response is the same if the argument is empty. For example: curl -i "http://localhost:5001/api/v0/tour?arg=" #### curl curl -i "http://localhost:5001/api/v0/tour" + Body ``` curl -i "http://localhost:5001/api/v0/tour" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Stream-Output: 1 Date: Thu, 28 Apr 2016 17:31:46 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` Tour 0.0 - Hello Mars check things work ``` + Request With Invalid Argument #### curl curl -i "http://localhost:5001/api/v0/tour?arg=kitten" + Body ``` curl -i "http://localhost:5001/api/v0/tour?arg=kitten" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Stream-Output: 1 Date: Thu, 28 Apr 2016 17:32:00 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ERROR no topic with id: kitten - * 0.0 Hello Mars - 0.1 Hello Mars - 0.2 About IPFS - 1.1 Filesystem - 1.2 Getting Files - 1.3 Adding Files - 1.4 Directories - 1.5 Distributed - 1.6 Getting Files - 2.0 Basics - init - 2.1 Basics - help - 2.2 Basics - update - 2.3 Basics - config - 3.0 - 3.1 - 3.2 - 3.3 - 3.4 - 3.5 - 3.6 Immutability - 3.7 - 3.8 - 3.9 - 4.0 - 4.1 - 4.2 - 4.3 - 4.4 - 4.5 - 5.0 - 5.1 - 5.2 - 6.0 - 6.1 - 6.2 - 6.3 - 6.4 - 7.0 - 7.1 - 7.2 - 7.3 - 8.0 - 8.1 - 8.2 PKI Review - 8.3 - 8.4 - 8.5 - 8.6 - 9.0 - 9.1 - 9.2 - 10.0 - 10.1 - 10.2 - 10.3 - 10.4 - 10.5 - 11.0 - 11.1 - 11.2 - 11.3 - 11.4 - 11.5 - 11.6 ``` + Request With Argument #### curl curl -i "http://localhost:5001/api/v0/tour?arg=11.5" + Body ``` curl -i "http://localhost:5001/api/v0/tour?arg=11.5" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Stream-Output: 1 Date: Thu, 28 Apr 2016 17:33:05 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` Tour 11.5 - ``` ## list [GET /tour/list] Show a list of all tour topics. + Request #### curl curl -i "http://localhost:5001/api/v0/tour/list" + Body ``` curl -i "http://localhost:5001/api/v0/tour/list" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Stream-Output: 1 Date: Thu, 28 Apr 2016 17:33:13 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` - * 0.0 Hello Mars - 0.1 Hello Mars - 0.2 About IPFS - 1.1 Filesystem - 1.2 Getting Files - 1.3 Adding Files - 1.4 Directories - 1.5 Distributed - 1.6 Getting Files - 2.0 Basics - init - 2.1 Basics - help - 2.2 Basics - update - 2.3 Basics - config - 3.0 - 3.1 - 3.2 - 3.3 - 3.4 - 3.5 - 3.6 Immutability - 3.7 - 3.8 - 3.9 - 4.0 - 4.1 - 4.2 - 4.3 - 4.4 - 4.5 - 5.0 - 5.1 - 5.2 - 6.0 - 6.1 - 6.2 - 6.3 - 6.4 - 7.0 - 7.1 - 7.2 - 7.3 - 8.0 - 8.1 - 8.2 PKI Review - 8.3 - 8.4 - 8.5 - 8.6 - 9.0 - 9.1 - 9.2 - 10.0 - 10.1 - 10.2 - 10.3 - 10.4 - 10.5 - 11.0 - 11.1 - 11.2 - 11.3 - 11.4 - 11.5 - 11.6 ``` ## next [GET /tour/next] Show the next tour topic. + Request #### curl curl -i "http://localhost:5001/api/v0/tour/next" + Body ``` curl -i "http://localhost:5001/api/v0/tour/next" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: text/plain Server: go-ipfs/0.4.1 Trailer: X-Stream-Error X-Stream-Output: 1 Date: Thu, 28 Apr 2016 17:33:24 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` Tour 0.1 - Hello Mars how this works ``` ## restart [GET /tour/restart] Restart the IPFS Tour + Request #### curl curl -i "http://localhost:5001/api/v0/tour/restart" + Body ``` curl -i "http://localhost:5001/api/v0/tour/restart" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.1 Trailer: X-Stream-Error Date: Thu, 28 Apr 2016 17:33:33 GMT Transfer-Encoding: chunked ``` + Attributes (string) + Body ``` ``` # Group update # Group version Shows ipfs version information. ## version [GET /version] Returns the current version of ipfs and exits. + Request #### curl curl -i "http://localhost:5001/api/v0/version" + Body ``` curl -i "http://localhost:5001/api/v0/version" ``` + Response 200 + Headers ``` Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output, X-Content-Length Content-Type: application/json Server: go-ipfs/0.4.3-dev Trailer: X-Stream-Error Vary: Origin Date: Thu, 01 Sep 2016 00:17:20 GMT Transfer-Encoding: chunked ``` + Attributes (object) - Commit: "d742fb1" (string) - Golang: "go1.5.2" (string) - Repo: "3" (string) - System: "amd64/darwin" (string) - Version: "0.4.3-dev" (string) + Body ``` { "Commit": "d742fb1", "Golang": "go1.5.2", "Repo": "4", "System": "amd64/darwin", "Version": "0.4.3-dev" } # Data Structures ## Error (object) The IPFS error object + message (string) - the error message + code (enum[number]) - the status code + Members + `0` + `1` ## Time (string) The time format used in some commands. Note that this is not technically an enumerated type, as multiple time formats can be joined. For example, '3h30m'. + (string) - The time format, composed of a number followed by an enumerated list with the following members: `ns`, `us` or `µs`, `ms`, `s`, `m`, and `h`. ## ndjson (object) Newline delimited JSON ### Sample + Body ``` { "Name": "test/test", "Bytes": 12 } { "Name": "test/test", "Hash": "QmePw8gVcBMb8x6kAep6aMBAX23hCSk6iZW3i9VKkiFhu1" } { "Name": "test", "Hash": "QmV7sQezAjKh9pokjUPLL7ebuMF5t56UmfhK4cJncCcrNZ" } ``` ## Multihash (string) A hash as defined [here](https://github.com/multiformats/multihash). ### Sample + Body ``` QmNjRVohhWBX31EoaAXkrj5mPF9vQNcTVvQgWHNwdxweCN ``` ## SwarmAddrs (object) A list of swarm addresses. ### Sample + Body ``` "QmNRCEwFMgCcbjNk5bFud9oqjJduvjBNbkiM8SuxuLh3GS": [ "/ip4/127.0.0.1/tcp/4001", "/ip4/172.17.42.1/tcp/4001", "/ip4/192.168.2.3/tcp/4001", "/ip6/::1/tcp/4001" ], "QmNRV7kyUxYaQ4KQxFXPYm8EfuzJbtGn1wSFenjXL6LD8y": [ "/ip4/127.0.0.1/tcp/4001", "/ip4/172.17.42.1/tcp/4001", "/ip4/5.9.33.222/tcp/4001", "/ip6/2a01:4f8:161:124a::1337:cafe/tcp/4001", "/ip6/2a01:4f8:161:124a::2/tcp/4001", "/ip6/::1/tcp/4001", "/ip6/fcfc:762a:e12a:245d:8e5b:6a40:f65:acab/tcp/4001" ] ``` ## MultiAddr (string) A multiaddr as defined [here](https://github.com/multiformats/multiaddr). ### Sample + Body ``` /ip6/fcfc:762a:e12a:245d:8e5b:6a40:f65:acab/tcp/4001 ```