Versions in this module Expand all Collapse all v1 v1.0.0 Mar 23, 2023 Changes in this version + const FirstEpoch + const FirstFrame + var ErrNoGenesis = errors.New("genesis not applied") + var ErrWrongFrame = errors.New("claimed frame mismatched with calculated") + type Config struct + func DefaultConfig() Config + func LiteConfig() Config + type DagIndex interface + type DagIndexer interface + Add func(dag.Event) error + DropNotFlushed func() + Flush func() + Reset func(validators *pos.Validators, db kvdb.Store, getEvent func(hash.Event) dag.Event) + type EpochDBProducer func(epoch idx.Epoch) kvdb.DropableStore + type EpochState struct + Epoch idx.Epoch + Validators *pos.Validators + type EventSource interface + GetEvent func(hash.Event) dag.Event + HasEvent func(hash.Event) bool + type Genesis struct + Epoch idx.Epoch + Validators *pos.Validators + type IndexedLachesis struct + func NewIndexedLachesis(store *Store, input EventSource, dagIndexer DagIndexer, crit func(error), ...) *IndexedLachesis + func (p *IndexedLachesis) Bootstrap(callback lachesis.ConsensusCallbacks) error + func (p *IndexedLachesis) Build(e dag.MutableEvent) error + func (p *IndexedLachesis) Process(e dag.Event) (err error) + type Lachesis struct + func NewLachesis(store *Store, input EventSource, dagIndex DagIndex, crit func(error), ...) *Lachesis + func (p *Lachesis) Bootstrap(callback lachesis.ConsensusCallbacks) error + func (p *Lachesis) BootstrapWithOrderer(callback lachesis.ConsensusCallbacks, ordererCallbacks OrdererCallbacks) error + func (p *Lachesis) OrdererCallbacks() OrdererCallbacks + type LastDecidedState struct + LastDecidedFrame idx.Frame + type Orderer struct + func NewOrderer(store *Store, input EventSource, dagIndex OrdererDagIndex, crit func(error), ...) *Orderer + func (p *Orderer) Bootstrap(callback OrdererCallbacks) error + func (p *Orderer) Build(e dag.MutableEvent) error + func (p *Orderer) Process(e dag.Event) (err error) + type OrdererCallbacks struct + ApplyAtropos func(decidedFrame idx.Frame, atropos hash.Event) (sealEpoch *pos.Validators) + EpochDBLoaded func(idx.Epoch) + type OrdererDagIndex interface + type Store struct + func NewMemStore() *Store + func NewStore(mainDB kvdb.Store, getDB EpochDBProducer, crit func(error), cfg StoreConfig) *Store + func (s *Store) AddRoot(selfParentFrame idx.Frame, root dag.Event) + func (s *Store) ApplyGenesis(g *Genesis) error + func (s *Store) Close() error + func (s *Store) GetEpoch() idx.Epoch + func (s *Store) GetEpochState() *EpochState + func (s *Store) GetEventConfirmedOn(e hash.Event) idx.Frame + func (s *Store) GetFrameRoots(f idx.Frame) []election.RootAndSlot + func (s *Store) GetLastDecidedFrame() idx.Frame + func (s *Store) GetLastDecidedState() *LastDecidedState + func (s *Store) GetValidators() *pos.Validators + func (s *Store) SetEpochState(e *EpochState) + func (s *Store) SetEventConfirmedOn(e hash.Event, on idx.Frame) + func (s *Store) SetLastDecidedState(v *LastDecidedState) + type StoreCacheConfig struct + RootsFrames int + RootsNum uint + type StoreConfig struct + Cache StoreCacheConfig + func DefaultStoreConfig(scale cachescale.Func) StoreConfig + func LiteStoreConfig() StoreConfig