Documentation ¶
Index ¶
- Constants
- type Node
- func (n *Node) Cleanup()
- func (n *Node) GetRuntime() runtimeRegistry.Runtime
- func (n *Node) HandleEpochTransitionLocked(epoch *committee.EpochSnapshot)
- func (n *Node) HandleNewBlockEarlyLocked(blk *block.Block)
- func (n *Node) HandleNewBlockLocked(blk *block.Block)
- func (n *Node) HandleNewEventLocked(ev *roothash.Event)
- func (n *Node) HandleNodeUpdateLocked(update *nodes.NodeUpdate, snapshot *committee.EpochSnapshot)
- func (n *Node) HandlePeerMessage(ctx context.Context, message *p2p.Message, isOwn bool) (bool, error)
- func (n *Node) Initialized() <-chan struct{}
- func (n *Node) Name() string
- func (n *Node) NewRuntimeHostHandler() protocol.Handler
- func (n *Node) NewRuntimeHostNotifier(ctx context.Context, host host.Runtime) protocol.Notifier
- func (n *Node) Quit() <-chan struct{}
- func (n *Node) Start() error
- func (n *Node) Stop()
- func (n *Node) WatchStateTransitions() (<-chan NodeState, *pubsub.Subscription)
- type NodeState
- type StateName
- type StateNotReady
- type StateProcessingBatch
- type StateWaitingForBatch
- type StateWaitingForBlock
- type StateWaitingForEvent
- type StateWaitingForFinalize
Constants ¶
const ( // NotReady is the name of StateNotReady. NotReady StateName = "NotReady" // WaitingForBatch is the name of StateWaitingForBatch. WaitingForBatch = "WaitingForBatch" // WaitingForBlock is the name of StateWaitingForBlock. WaitingForBlock = "WaitingForBlock" // WaitingForEvent is the name of StateWaitingForEvent. WaitingForEvent = "WaitingForEvent" // ProcessingBatch is the name of StateProcessingBatch. ProcessingBatch = "ProcessingBatch" // WaitingForFinalize is the name of StateWaitingForFinalize. WaitingForFinalize = "WaitingForFinalize" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { *runtimeRegistry.RuntimeHostNode // contains filtered or unexported fields }
Node is a committee node.
func NewNode ¶
func NewNode( commonNode *committee.Node, commonCfg commonWorker.Config, roleProvider registration.RoleProvider, scheduleMaxTxPoolSize uint64, lastScheduledCacheSize uint64, checkTxMaxBatchSize uint64, ) (*Node, error)
NewNode initializes a new executor node.
func (*Node) Cleanup ¶
func (n *Node) Cleanup()
Cleanup performs the service specific post-termination cleanup.
func (*Node) GetRuntime ¶ added in v0.2103.9
func (n *Node) GetRuntime() runtimeRegistry.Runtime
Implements RuntimeHostHandlerFactory.
func (*Node) HandleEpochTransitionLocked ¶
func (n *Node) HandleEpochTransitionLocked(epoch *committee.EpochSnapshot)
HandleEpochTransitionLocked implements NodeHooks. Guarded by n.commonNode.CrossNode.
func (*Node) HandleNewBlockEarlyLocked ¶
HandleNewBlockEarlyLocked implements NodeHooks. Guarded by n.commonNode.CrossNode.
func (*Node) HandleNewBlockLocked ¶
HandleNewBlockLocked implements NodeHooks. Guarded by n.commonNode.CrossNode.
func (*Node) HandleNewEventLocked ¶
HandleNewEventLocked implements NodeHooks. Guarded by n.commonNode.CrossNode.
func (*Node) HandleNodeUpdateLocked ¶
func (n *Node) HandleNodeUpdateLocked(update *nodes.NodeUpdate, snapshot *committee.EpochSnapshot)
HandleNodeUpdateLocked implements NodeHooks. Guarded by n.commonNode.CrossNode.
func (*Node) HandlePeerMessage ¶
func (n *Node) HandlePeerMessage(ctx context.Context, message *p2p.Message, isOwn bool) (bool, error)
HandlePeerMessage implements NodeHooks.
func (*Node) Initialized ¶
func (n *Node) Initialized() <-chan struct{}
Initialized returns a channel that will be closed when the node is initialized and ready to service requests.
func (*Node) NewRuntimeHostHandler ¶ added in v0.2103.9
Implements RuntimeHostHandlerFactory.
func (*Node) NewRuntimeHostNotifier ¶ added in v0.2103.9
Implements RuntimeHostHandlerFactory.
func (*Node) Quit ¶
func (n *Node) Quit() <-chan struct{}
Quit returns a channel that will be closed when the service terminates.
func (*Node) WatchStateTransitions ¶
func (n *Node) WatchStateTransitions() (<-chan NodeState, *pubsub.Subscription)
WatchStateTransitions subscribes to the node's state transitions.
type NodeState ¶
type NodeState interface { // Name returns the name of the state. Name() StateName }
NodeState is a node's state.
type StateNotReady ¶
type StateNotReady struct{}
StateNotReady is the not ready state.
func (StateNotReady) Name ¶
func (s StateNotReady) Name() StateName
Name returns the name of the state.
func (StateNotReady) String ¶
func (s StateNotReady) String() string
String returns a string representation of the state.
type StateProcessingBatch ¶
type StateProcessingBatch struct {
// contains filtered or unexported fields
}
StateProcessingBatch is the processing batch state.
func (StateProcessingBatch) Name ¶
func (s StateProcessingBatch) Name() StateName
Name returns the name of the state.
func (StateProcessingBatch) String ¶
func (s StateProcessingBatch) String() string
String returns a string representation of the state.
type StateWaitingForBatch ¶
type StateWaitingForBatch struct {
// contains filtered or unexported fields
}
StateWaitingForBatch is the waiting for batch state.
func (StateWaitingForBatch) Name ¶
func (s StateWaitingForBatch) Name() StateName
Name returns the name of the state.
func (StateWaitingForBatch) String ¶
func (s StateWaitingForBatch) String() string
String returns a string representation of the state.
type StateWaitingForBlock ¶
type StateWaitingForBlock struct {
// contains filtered or unexported fields
}
StateWaitingForBlock is the waiting for block state.
func (StateWaitingForBlock) Name ¶
func (s StateWaitingForBlock) Name() StateName
Name returns the name of the state.
func (StateWaitingForBlock) String ¶
func (s StateWaitingForBlock) String() string
String returns a string representation of the state.
type StateWaitingForEvent ¶
type StateWaitingForEvent struct {
// contains filtered or unexported fields
}
StateWaitingForEvent is the waiting for event state.
func (StateWaitingForEvent) Name ¶
func (s StateWaitingForEvent) Name() StateName
Name returns the name of the state.
func (StateWaitingForEvent) String ¶
func (s StateWaitingForEvent) String() string
String returns a string representation of the state.
type StateWaitingForFinalize ¶
type StateWaitingForFinalize struct {
// contains filtered or unexported fields
}
StateWaitingForFinalize is the waiting for finalize state.
func (StateWaitingForFinalize) Name ¶
func (s StateWaitingForFinalize) Name() StateName
Name returns the name of the state.
func (StateWaitingForFinalize) String ¶
func (s StateWaitingForFinalize) String() string
String returns a string representation of the state.