dag

package
v0.0.0-...-4966005 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Node

func Node(d []byte) *mdag.ProtoNode

Types

type AccDag

type AccDag struct {
	*DagService
	sync.Mutex
	Accumulator []*ProtoNode
	Size        int
	Depth       uint64
	Epoch       uint64
}

func NewAccDag

func NewAccDag(bs bserv.BlockService, size int) *AccDag

func (*AccDag) Append

func (ad *AccDag) Append(ctx context.Context, n *ProtoNode) (depth uint64, ok bool)

func (*AccDag) GetDepth

func (ad *AccDag) GetDepth() uint64

Store node - bypassing a position in Accumulator DAG

func (*AccDag) GetEpoch

func (ad *AccDag) GetEpoch() uint64

func (*AccDag) SetEpoch

func (ad *AccDag) SetEpoch(e uint64)

func (*AccDag) Store

func (ad *AccDag) Store(ctx context.Context, node *ProtoNode) error

Store node - bypassing a position in Accumulator DAG

func (*AccDag) Traverse

func (ad *AccDag) Traverse(n *ProtoNode, traverseFunc traverse.Func) error

walk the DAG w/ BFS

func (*AccDag) TruncateRoot

func (ad *AccDag) TruncateRoot(ctx context.Context) (n *ProtoNode, ok bool)

reduce the accumulator slice to produce a merkle root

type DagService

type DagService struct {
	Blocks bserv.BlockService
	Srv    dagService
}

func New

func New(bs bserv.BlockService) *DagService

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL