This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from ipfs/awesome-ipld
Awesome IPLD endeavour
- Loading branch information
Showing
5 changed files
with
659 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
dag API | ||
======= | ||
|
||
#### `dag.put` | ||
|
||
> Store an IPLD format node | ||
##### `Go` **WIP** | ||
|
||
##### `JavaScript` - ipfs.dag.put(dagNode, formatMulticodec, hashAlg, callback) | ||
|
||
`dagNode` - a DAG node that follows one of the supported IPLD formats. | ||
|
||
`formatMulticodec` - The IPLD format multicodec. | ||
|
||
`hashAlg` - The hash algorithm to be used over the serialized dagNode. | ||
|
||
`callback` must follow `function (err) {}` signature, where `err` is an error if the operation was not successful. | ||
|
||
If no `callback` is passed, a [promise][] is returned. | ||
|
||
#### `dag.get` | ||
|
||
> Retrieve an IPLD format node | ||
##### `Go` **WIP** | ||
|
||
##### `JavaScript` - ipfs.object.get(cid, callback) | ||
|
||
`cid` is a [CID][https://github.com/ipfs/js-cid] instance. | ||
|
||
`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. | ||
|
||
If no `callback` is passed, a [promise][] is returned. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.