SYNOPSIS
This provides an efficent way to build and manipulate IPLD DAGs as JSON. This is accomplished by only producing merkle roots when flush
ing the DAG. If any object has a "/" property, its value will be replaced with the merkle hash of that value when flushed. This allows you to build object anyway you like.
LEAD MAINTAINER
INSTALL
npm install ipld-graph-builder
USAGE
const IPFS = const Graph = const ipfs = ipfs
Additonally you can define the encoding of each link by adding the follow options
property to un-merklized links. options
will be used as the options argument for DAG.put
. For Example:
{
'my-link': {
'/': {
'some': 'stuff here'
},
'options': {
format: 'dag-cbor',
hashAlg: 'sha2-256'
}
}
}
API
TESTS
npm run tests