Documentation ¶
Index ¶
- type BranchesInfo
- type Callbacks
- type Engine
- func (vi *Engine) Add(e dag.Event) error
- func (vi *Engine) AtLeastOneFork() bool
- func (vi *Engine) BranchesInfo() *BranchesInfo
- func (vi *Engine) DfsSubgraph(head dag.Event, walk func(hash.Event) (godeeper bool)) error
- func (vi *Engine) DropNotFlushed()
- func (vi *Engine) Flush()
- func (vi *Engine) GetEventBranchID(id hash.Event) idx.Validator
- func (vi *Engine) GetMergedHighestBefore(id hash.Event) HighestBeforeI
- func (vi *Engine) InitBranchesInfo()
- func (vi *Engine) Reset(validators *pos.Validators, db kvdb.Store, getEvent func(hash.Event) dag.Event)
- func (vi *Engine) SetEventBranchID(id hash.Event, branchID idx.Validator)
- type HighestBeforeI
- type LowestAfterI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BranchesInfo ¶
type BranchesInfo struct { BranchIDLastSeq []idx.Event // branchID -> highest e.Seq in the branch BranchIDCreatorIdxs []idx.Validator // branchID -> validator idx BranchIDByCreators [][]idx.Validator // validator idx -> list of branch IDs }
BranchesInfo contains information about global branches of each validator
type Callbacks ¶
type Callbacks struct { GetHighestBefore func(hash.Event) HighestBeforeI GetLowestAfter func(hash.Event) LowestAfterI SetHighestBefore func(hash.Event, HighestBeforeI) SetLowestAfter func(hash.Event, LowestAfterI) NewHighestBefore func(idx.Validator) HighestBeforeI NewLowestAfter func(idx.Validator) LowestAfterI OnDbReset func(db kvdb.Store) OnDropNotFlushed func() }
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) AtLeastOneFork ¶
func (*Engine) BranchesInfo ¶
func (vi *Engine) BranchesInfo() *BranchesInfo
func (*Engine) DfsSubgraph ¶
DfsSubgraph iterates all the event which are observed by head, and accepted by a filter Excluding head filter MAY BE called twice for the same event.
func (*Engine) DropNotFlushed ¶
func (vi *Engine) DropNotFlushed()
DropNotFlushed not connected clocks. Call it if event has failed.
func (*Engine) GetEventBranchID ¶
GetEventBranchID reads the event's global branch ID
func (*Engine) GetMergedHighestBefore ¶
func (vi *Engine) GetMergedHighestBefore(id hash.Event) HighestBeforeI
func (*Engine) InitBranchesInfo ¶
func (vi *Engine) InitBranchesInfo()
InitBranchesInfo loads BranchesInfo from store
type HighestBeforeI ¶
type HighestBeforeI interface { InitWithEvent(i idx.Validator, e dag.Event) IsEmpty(i idx.Validator) bool IsForkDetected(i idx.Validator) bool Seq(i idx.Validator) idx.Event MinSeq(i idx.Validator) idx.Event SetForkDetected(i idx.Validator) CollectFrom(other HighestBeforeI, branches idx.Validator) GatherFrom(to idx.Validator, other HighestBeforeI, from []idx.Validator) }
Click to show internal directories.
Click to hide internal directories.