Versions in this module Expand all Collapse all v0 v0.11.0 Mar 24, 2026 Changes in this version + const BlockEndorsementEvent + const BlockEvent + const BlockIDsEvent + const BlockSnapshotEvent + const ChangeSyncPeerEvent + const HaltEvent + const HaltStateName + const IdleStateName + const MicroBlockEvent + const MicroBlockInvEvent + const MicroBlockSnapshotEvent + const MinedBlockEvent + const NGStateName + const NewPeerEvent + const PeerErrorEvent + const PersistStateName + const ScoreEvent + const StartMiningEvent + const StopMiningEvent + const StopSyncEvent + const SyncStateName + const TaskEvent + const TransactionEvent + const WaitMicroSnapshotStateName + const WaitSnapshotStateName + var TimeoutErr = proto.NewInfoMsg(errors.New("timeout")) + func NewFSM(services services.Services, microblockInterval, obsolescence time.Duration, ...) (*FSM, Async, error) + type Actions interface + SendBlock func(block *proto.Block) + SendEndorseBlock func(endorse *proto.EndorseBlock) + SendScore func(currentScorer) + type ActionsImpl struct + func (a *ActionsImpl) SendBlock(block *proto.Block) + func (a *ActionsImpl) SendEndorseBlock(endorse *proto.EndorseBlock) + func (a *ActionsImpl) SendScore(s currentScorer) + type Async []tasks.Task + type BaseInfo struct + MicroBlockCache services.MicroBlockCache + MicroBlockInvCache services.MicroBlockInvCache + func (a *BaseInfo) AddToUtx(t proto.Transaction) error + func (a *BaseInfo) BroadcastTransaction(t proto.Transaction, receivedFrom peer.Peer) + func (a *BaseInfo) CancelCleanUTX() + func (a *BaseInfo) CleanUtx() + type BlocksApplier interface + Apply func(state storage.State, block []*proto.Block) (proto.Height, error) + ApplyMicro func(state storage.State, block *proto.Block) (proto.Height, error) + ApplyMicroWithSnapshots func(state storage.State, block *proto.Block, snapshots *proto.BlockSnapshot) (proto.Height, error) + ApplyWithSnapshots func(state storage.State, block []*proto.Block, snapshots []*proto.BlockSnapshot) (proto.Height, error) + BlockExists func(state storage.State, block *proto.Block) (bool, error) + type FSM struct + State *StateData + func (f *FSM) Block(p peer.Peer, block *proto.Block) (Async, error) + func (f *FSM) BlockEndorsement(endorseBlock *proto.EndorseBlock) (Async, error) + func (f *FSM) BlockIDs(peer peer.Peer, signatures []proto.BlockID) (Async, error) + func (f *FSM) BlockSnapshot(p peer.Peer, blockID proto.BlockID, snapshots proto.BlockSnapshot) (Async, error) + func (f *FSM) ChangeSyncPeer(p peer.Peer) (Async, error) + func (f *FSM) Halt() (Async, error) + func (f *FSM) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (Async, error) + func (f *FSM) MicroBlockInv(p peer.Peer, inv *proto.MicroBlockInv) (Async, error) + func (f *FSM) MicroBlockSnapshot(p peer.Peer, blockID proto.BlockID, snapshots proto.BlockSnapshot) (Async, error) + func (f *FSM) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, ...) (Async, error) + func (f *FSM) NewPeer(p peer.Peer) (Async, error) + func (f *FSM) PeerError(p peer.Peer, e error) (Async, error) + func (f *FSM) Score(p peer.Peer, score *proto.Score) (Async, error) + func (f *FSM) StartMining() (Async, error) + func (f *FSM) StopMining() (Async, error) + func (f *FSM) StopSync() (Async, error) + func (f *FSM) Task(task tasks.AsyncTask) (Async, error) + func (f *FSM) Transaction(p peer.Peer, t proto.Transaction) (Async, error) + type HaltState struct + func (a *HaltState) Errorf(err error) error + func (a *HaltState) String() string + type IdleState struct + func (a *IdleState) Errorf(err error) error + func (a *IdleState) Halt() (State, Async, error) + func (a *IdleState) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, ...) (State, Async, error) + func (a *IdleState) Score(p peer.Peer, score *proto.Score) (State, Async, error) + func (a *IdleState) StartMining() (State, Async, error) + func (a *IdleState) String() string + func (a *IdleState) Task(task tasks.AsyncTask) (State, Async, error) + func (a *IdleState) Transaction(p peer.Peer, t proto.Transaction) (State, Async, error) + type InvRequester interface + Add2Cache func(id proto.BlockID) (existed bool) + Request func(p types.MessageSender, id proto.BlockID) (existed bool) + type NGState struct + func (a *NGState) Block(peer peer.Peer, block *proto.Block) (State, Async, error) + func (a *NGState) BlockEndorsement(blockEndorsement *proto.EndorseBlock) (State, Async, error) + func (a *NGState) Endorse(parentBlockID proto.BlockID, height proto.Height, endorserPK bls.PublicKey, ...) error + func (a *NGState) EndorseParentWithEachKey(pks []bls.PublicKey, sks []bls.SecretKey, block *proto.Block, ...) error + func (a *NGState) Errorf(err error) error + func (a *NGState) Halt() (State, Async, error) + func (a *NGState) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (State, Async, error) + func (a *NGState) MicroBlockInv(p peer.Peer, inv *proto.MicroBlockInv) (State, Async, error) + func (a *NGState) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, ...) (State, Async, error) + func (a *NGState) Score(p peer.Peer, score *proto.Score) (State, Async, error) + func (a *NGState) StopMining() (State, Async, error) + func (a *NGState) String() string + func (a *NGState) Task(task tasks.AsyncTask) (State, Async, error) + func (a *NGState) Transaction(p peer.Peer, t proto.Transaction) (State, Async, error) + type PersistState struct + func (a *PersistState) Errorf(err error) error + func (a *PersistState) Halt() (State, Async, error) + func (a *PersistState) Score(p peer.Peer, score *proto.Score) (State, Async, error) + func (a *PersistState) StopMining() (State, Async, error) + func (a *PersistState) String() string + func (a *PersistState) Task(t tasks.AsyncTask) (State, Async, error) + type ReceivedScore struct + Peer peer.Peer + Score *proto.Score + type State interface + Errorf func(error) error + String func() string + type StateData struct + Name stateless.State + State State + type SyncState struct + func (a *SyncState) Block(p peer.Peer, block *proto.Block) (State, Async, error) + func (a *SyncState) BlockIDs(peer peer.Peer, signatures []proto.BlockID) (State, Async, error) + func (a *SyncState) BlockSnapshot(p peer.Peer, blockID proto.BlockID, snapshot proto.BlockSnapshot) (State, Async, error) + func (a *SyncState) ChangeSyncPeer(p peer.Peer) (State, Async, error) + func (a *SyncState) Errorf(err error) error + func (a *SyncState) Halt() (State, Async, error) + func (a *SyncState) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, ...) (State, Async, error) + func (a *SyncState) Score(p peer.Peer, score *proto.Score) (State, Async, error) + func (a *SyncState) StopSync() (State, Async, error) + func (a *SyncState) String() string + func (a *SyncState) Task(task tasks.AsyncTask) (State, Async, error) + func (a *SyncState) Transaction(p peer.Peer, t proto.Transaction) (State, Async, error) + type WaitMicroSnapshotState struct + func (a *WaitMicroSnapshotState) Errorf(err error) error + func (a *WaitMicroSnapshotState) MicroBlockSnapshot(_ peer.Peer, blockID proto.BlockID, snapshot proto.BlockSnapshot) (State, Async, error) + func (a *WaitMicroSnapshotState) Score(p peer.Peer, score *proto.Score) (State, Async, error) + func (a *WaitMicroSnapshotState) String() string + func (a *WaitMicroSnapshotState) Task(task tasks.AsyncTask) (State, Async, error) + type WaitSnapshotState struct + func (a *WaitSnapshotState) BlockSnapshot(_ peer.Peer, blockID proto.BlockID, snapshot proto.BlockSnapshot) (State, Async, error) + func (a *WaitSnapshotState) Errorf(err error) error + func (a *WaitSnapshotState) Score(p peer.Peer, score *proto.Score) (State, Async, error) + func (a *WaitSnapshotState) String() string + func (a *WaitSnapshotState) Task(task tasks.AsyncTask) (State, Async, error)