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

Commit 64ba3de

Browse files
committed
feat: add resolve func
1 parent fc3f216 commit 64ba3de

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

API/dag/README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
dag API
22
=======
33

4+
> The dag API comes to replace the `object API`, it support the creation and manipulation of dag-pb object, as well as other IPLD formats (i.e dag-cbor, ethereum-block, git, etc)
5+
46
#### `dag.put`
57

68
> Store an IPLD format node
@@ -9,13 +11,10 @@ dag API
911

1012
##### `JavaScript` - ipfs.dag.put(dagNode, formatMulticodec, hashAlg, callback)
1113

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.
14+
- `dagNode` - a DAG node that follows one of the supported IPLD formats.
15+
- `formatMulticodec` - The IPLD format multicodec.
16+
- `hashAlg` - The hash algorithm to be used over the serialized dagNode.
17+
- `callback` must follow `function (err) {}` signature, where `err` is an error if the operation was not successful.
1918

2019
If no `callback` is passed, a [promise][] is returned.
2120

@@ -27,8 +26,23 @@ If no `callback` is passed, a [promise][] is returned.
2726

2827
##### `JavaScript` - ipfs.object.get(cid, callback)
2928

30-
`cid` is a [CID][https://github.com/ipfs/js-cid] instance.
29+
- `cid` is a [CID][https://github.com/ipfs/js-cid] instance.
3130

3231
`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.
3332

3433
If no `callback` is passed, a [promise][] is returned.
34+
35+
#### `dag.resolve`
36+
37+
> Resolves an IPLD path
38+
39+
##### `Go` **WIP**
40+
41+
##### `JavaScript` - ipfs.object.resolve(cid, path, callback)
42+
43+
- `cid` is a [CID][https://github.com/ipfs/js-cid] instance.
44+
- `path` is a String that represents a valid path to be resolved
45+
46+
`callback` must follow `function (err, value) {}` signature, where `err` is an error if the operation was not successful and `value` is the value it was retrieved.
47+
48+
If no `callback` is passed, a [promise][] is returned.

0 commit comments

Comments
 (0)