Documentation ¶
Index ¶
- Constants
- Variables
- type Node
- func (n *Node) Cleanup()
- func (n *Node) ForceFinalize(ctx context.Context, round uint64) error
- func (n *Node) GetLastSynced() (uint64, mkvsNode.Root, mkvsNode.Root)
- func (n *Node) GetStatus(ctx context.Context) (*api.Status, error)
- func (n *Node) HandleEpochTransitionLocked(snapshot *committee.EpochSnapshot)
- func (n *Node) HandleNewBlockEarlyLocked(*block.Block)
- func (n *Node) HandleNewBlockLocked(blk *block.Block)
- func (n *Node) HandleNewEventLocked(*roothashApi.Event)
- func (n *Node) HandleNodeUpdateLocked(update *runtimeCommittee.NodeUpdate, snapshot *committee.EpochSnapshot)
- func (n *Node) HandlePeerMessage(context.Context, *p2p.Message, bool) (bool, error)
- func (n *Node) Initialized() <-chan struct{}
- func (n *Node) Name() string
- func (n *Node) Quit() <-chan struct{}
- func (n *Node) Start() error
- func (n *Node) Stop()
Constants ¶
View Source
const (
// LogEventCheckpointSyncSuccess is a log event value that signals that checkpoint sync was successful.
LogEventCheckpointSyncSuccess = "worker/storage/checkpoint-sync-success"
)
View Source
const ( // RoundLatest is a magic value for the latest round. RoundLatest = math.MaxUint64 )
Variables ¶
View Source
var ErrNoUsableCheckpoints = errors.New("storage: no checkpoint could be synced")
ErrNoUsableCheckpoints is the error returned when none of the checkpoints could be synced.
View Source
var ( // ErrNonLocalBackend is the error returned when the storage backend doesn't implement the LocalBackend interface. ErrNonLocalBackend = errors.New("storage: storage backend doesn't support local storage") )
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node watches blocks for storage changes.
func NewNode ¶
func NewNode( commonNode *committee.Node, grpcPolicy *policy.DynamicRuntimePolicyChecker, fetchPool *workerpool.Pool, store *persistent.ServiceStore, roleProvider registration.RoleProvider, workerCommonCfg workerCommon.Config, checkpointerCfg checkpoint.CheckpointerConfig, checkpointSyncDisabled bool, ) (*Node, error)
func (*Node) Cleanup ¶
func (n *Node) Cleanup()
Cleanup cleans up any leftover state after the worker is stopped.
func (*Node) ForceFinalize ¶
ForceFinalize forces a storage finalization for the given round.
func (*Node) GetLastSynced ¶
GetLastSynced returns the height, IORoot hash and StateRoot hash of the last block that was fully synced to.
func (*Node) HandleEpochTransitionLocked ¶
func (n *Node) HandleEpochTransitionLocked(snapshot *committee.EpochSnapshot)
Guarded by CrossNode.
func (*Node) HandleNewBlockEarlyLocked ¶
Guarded by CrossNode.
func (*Node) HandleNewBlockLocked ¶
Guarded by CrossNode.
func (*Node) HandleNewEventLocked ¶
func (n *Node) HandleNewEventLocked(*roothashApi.Event)
Guarded by CrossNode.
func (*Node) HandleNodeUpdateLocked ¶
func (n *Node) HandleNodeUpdateLocked(update *runtimeCommittee.NodeUpdate, snapshot *committee.EpochSnapshot)
Guarded by CrossNode.
func (*Node) HandlePeerMessage ¶
func (*Node) Initialized ¶
func (n *Node) Initialized() <-chan struct{}
Initialized returns a channel that will be closed once the worker finished starting up.
func (*Node) Quit ¶
func (n *Node) Quit() <-chan struct{}
Quit returns a channel that will be closed when the worker stops.
Click to show internal directories.
Click to hide internal directories.