hypercore-dag
DAGs on top of hypercore, allowing verified random-access to graph nodes
Usage
'use strict' var assert = var hypercore = var memdb = var hypercoreDag = var core = var dag = // We're building the following graph (Time on x axis, depth on y axis)// 0 2// \- 1 \// \--\-- 3 dag
API
hypercoreDag(feed, [opts])
opts
being {lock: mutexify()}
dag.add(links, value, [callback])
dag.get(index, callback)
dag.createReadStream([opts])
Extras
require('hypercore-dag/bfs-stream')(startIndex, [opts])
Preform a Breadth-first search
from startIndex
require('hypercore-dag/dfs-stream')(startIndex, [opts])
Preform a Depth-first search
from startIndex
Install
npm install hypercore-dag