You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: API/dag/README.md
+102-5
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,28 @@ dag API
13
13
14
14
-`dagNode` - a DAG node that follows one of the supported IPLD formats.
15
15
-`options` - a object that might contain the follwing values:
16
-
-`format` - The IPLD format multicodec.
17
-
-`hashAlg` - The hash algorithm to be used over the serialized dagNode.
18
-
-`cid` - the CID of the node passed.
16
+
-`format` - The IPLD format multicodec.
17
+
-`hashAlg` - The hash algorithm to be used over the serialized dagNode.
18
+
- or
19
+
-`cid` - the CID of the node passed.
19
20
-**Note** - You should only pass the CID or the format + hashAlg pair and not both
20
-
-`callback` must follow `function (err) {}` signature, where `err` is an error if the operation was not successful.
21
+
-`callback` must follow `function (err, cid) {}` signature, where `err` is an error if the operation was not successful and CID is the CID generated through the process or the one that was passed
21
22
22
23
If no `callback` is passed, a [promise][] is returned.
- a [CID](https://github.com/ipfs/js-cid) instance.
119
+
- a CID in its String format (i.e: zdpuAkxd9KzGwJFGhymCZRkPCXtBmBW7mB2tTuEH11HLbES9Y)
120
+
- a CID in its String format concatenated with the path to be resolved
121
+
-`path` - the path to be resolved. Optional.
122
+
-`options` - a object that might contain the following values:
123
+
-`recursive` - bool - if set to true, it will follow the links and continuously run tree on them, returning all the paths in the graph.
124
+
125
+
`callback` must follow `function (err, result) {}` signature, where `err` is an error if the operation was not successful and `result` is an Array with the paths passed.
126
+
127
+
If no `callback` is passed, a [promise][] is returned.
128
+
129
+
**Example:**
130
+
131
+
```JavaScript
132
+
```
133
+
134
+
A great source of [examples][] can be found in the tests for this API.
0 commit comments