-
Notifications
You must be signed in to change notification settings - Fork 22
Added more documentation #13
Changes from 1 commit
2ec619e
4efdaf8
99aba1c
e870bf2
438dd5d
55eaa43
f11186d
e02fe5e
b6da282
99b4397
51b7ec2
8f5337a
4089955
3804212
096a0d3
729117b
71e5f60
633ebdb
1001645
f3d47ae
1e6dc95
8e1d586
2e59d1a
a2369ce
291bcb7
266d53d
01123a5
b10cde3
99a336e
02ee57e
afc33e5
425f737
dcfe5be
13ff0c9
40ad96e
8c64bec
d91fba0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,41 @@ FORMAT: 1A | |
|
||
The API for interacting with IPFS nodes. | ||
|
||
# Group add | ||
# Group add [GET /add{?arg,&recursive,quiet,silent,progress,trickle,only-hash,wrap-with-directory,hidden,chunker,pin}] | ||
Add an object to ipfs. | ||
|
||
TODO | ||
Adds contents of <path> to ipfs. Use -r to add directories. | ||
Note that directories are added recursively, to form the ipfs | ||
MerkleDAG. A smarter partial add with a staging area (like git) | ||
remains to be implemented. | ||
|
||
+ Parameters | ||
+ arg (string, required) - The path to a file to be added to IPFS | ||
+ recursive (boolean, optional) - Add directory paths recursively | ||
+ quiet (boolean, optional) - Write minimal output | ||
+ silent (boolean, optional) - Write no output | ||
+ progress (boolean, optional) - Stream progress data | ||
+ trickle (boolean, optional) - Use trickle-dag format for dag generation | ||
+ only-hash (boolean, optional) - Only chunk and hash - do not write to disk | ||
+ wrap-with-directory (boolean, optional) - Wrap files with a directory object | ||
+ hidden (boolean, optional) - Include files that are hidden | ||
+ chunker (boolean, optional) - chunking algorithm to use | ||
+ pin (boolean, optional) - Pin this object when adding. Default true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure how to add shortcuts we use here, like -r for --recursive. Should I put them in the desc? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good question. desc works? not sure. others' thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there actually a need to have these shortcuts working/documented in the http api? Or should they simply be a bonus specific to the cli? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's make the alias be only available through the CLI :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
+ Response 200 (text/plain) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was unable to get "http://127.0.0.1:5001/api/v0/add?arg=/Users/richard/test" to work on Postman, so I honestly am not sure if this is the right response of not. It's what I get in the CLI, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path to a file will not work from http api, you have to send the file content via multipart if you want to add something via http There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you need to test adds in Postman, you can use the In curl, you can do:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, could be cool to show There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no option to select File instead of Text if I am using a GET command. If I use a PUT or a POST, there is, but I just get a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could include the curl command directly in the description, like this. I like it! What do you think? cc @dignifiedquire
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That would be because no one (i.e Apiary) is expecting for a file to be sent in a GET request and all the other methods are blocked by CORS, if the headers are not set. |
||
|
||
+ Body | ||
``` | ||
added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH test | ||
``` | ||
|
||
+ Response 400 (text/plain) | ||
|
||
+ Body | ||
|
||
``` | ||
File argument 'path' is required | ||
``` | ||
|
||
# Group bitswap | ||
A set of commands to manipulate the bitswap agent | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to indicate that there can be multiple
arg
values to add multiple files in one requestThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mappum Excuse me, I realize this is OT for here, but just a brief inquiry, do you have a status or roadmap for Mercury?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ABISprotocol Not sure why you're bringing that up here. My email address is on my profile, feel free to contact me there. 😄