func buildTestDag(ds dag.DAGService, spl chunk.Splitter) (*dag.Node, error) { // Start the splitter blkch, errs := chunk.Chan(spl) dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, } return BalancedLayout(dbp.New(blkch, errs)) }
func BuildTrickleDagFromReader(ds dag.DAGService, spl chunk.Splitter, ncb h.NodeCB) (*dag.Node, error) { // Start the splitter blkch, errch := chunk.Chan(spl) dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, NodeCB: ncb, } return trickle.TrickleLayout(dbp.New(blkch, errch)) }
func buildTestDag(ds merkledag.DAGService, spl chunk.Splitter) (*merkledag.Node, error) { // Start the splitter blkch, errs := chunk.Chan(spl) dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, } nd, err := TrickleLayout(dbp.New(blkch, errs)) if err != nil { return nil, err } return nd, VerifyTrickleDagStructure(nd, ds, dbp.Maxlinks, layerRepeat) }