Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit f76f4b6

Browse files
committed
docs: add base dag API interface
1 parent 8dad522 commit f76f4b6

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

API/dag/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
dag API
2+
=======
3+
4+
#### `dag.put`
5+
6+
> Store an IPLD format node
7+
8+
##### `Go` **WIP**
9+
10+
##### `JavaScript` - ipfs.dag.put(dagNode, formatMulticodec, hashAlg, callback)
11+
12+
`dagNode` - a DAG node that follows one of the supported IPLD formats.
13+
14+
`formatMulticodec` - The IPLD format multicodec.
15+
16+
`hashAlg` - The hash algorithm to be used over the serialized dagNode.
17+
18+
`callback` must follow `function (err) {}` signature, where `err` is an error if the operation was not successful.
19+
20+
If no `callback` is passed, a [promise][] is returned.
21+
22+
#### `dag.get`
23+
24+
> Retrieve an IPLD format node
25+
26+
##### `Go` **WIP**
27+
28+
##### `JavaScript` - ipfs.object.get(cid, callback)
29+
30+
`cid` is a [CID][https://github.com/ipfs/js-cid] instance.
31+
32+
`callback` must follow `function (err, dagNode) {}` signature, where `err` is an error if the operation was not successful and `dagNode` is the IPLD format DAG node retrieved.
33+
34+
If no `callback` is passed, a [promise][] is returned.

0 commit comments

Comments
 (0)