Documentation ¶
Index ¶
- Constants
- Variables
- type CheckpointSyncConfig
- type Node
- func (n *Node) Cleanup()
- func (n *Node) GetLastSynced() (uint64, storageApi.Root, storageApi.Root)
- func (n *Node) GetLocalStorage() storageApi.LocalBackend
- 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) HandlePeerTx(ctx context.Context, tx []byte) error
- func (n *Node) HandleRuntimeHostEventLocked(ev *host.Event)
- func (n *Node) Initialized() <-chan struct{}
- func (n *Node) Name() string
- func (n *Node) PauseCheckpointer(pause bool) error
- func (n *Node) Quit() <-chan struct{}
- func (n *Node) Start() error
- func (n *Node) Stop()
Constants ¶
const (
// LogEventCheckpointSyncSuccess is a log event value that signals that checkpoint sync was successful.
LogEventCheckpointSyncSuccess = "worker/storage/checkpoint-sync-success"
)
const ( // RoundLatest is a magic value for the latest round. RoundLatest = math.MaxUint64 )
Variables ¶
var ErrNoUsableCheckpoints = errors.New("storage: no checkpoint could be synced")
ErrNoUsableCheckpoints is the error returned when none of the checkpoints could be synced.
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 CheckpointSyncConfig ¶ added in v0.2200.0
type CheckpointSyncConfig struct { // Disabled specifies whether checkpoint sync should be disabled. In this case the node will // only sync by applying all diffs from genesis. Disabled bool // ChunkFetcherCount specifies the number of parallel checkpoint chunk fetchers. ChunkFetcherCount uint }
CheckpointSyncConfig is the checkpoint sync configuration.
func (*CheckpointSyncConfig) Validate ¶ added in v0.2200.0
func (cfg *CheckpointSyncConfig) Validate() error
Validate performs configuration checks.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node watches blocks for storage changes.
func NewNode ¶
func NewNode( commonNode *committee.Node, fetchPool *workerpool.Pool, roleProvider registration.RoleProvider, rpcRoleProvider registration.RoleProvider, workerCommonCfg workerCommon.Config, localStorage storageApi.LocalBackend, checkpointerCfg *checkpoint.CheckpointerConfig, checkpointSyncCfg *CheckpointSyncConfig, ) (*Node, error)
func (*Node) Cleanup ¶
func (n *Node) Cleanup()
Cleanup cleans up any leftover state after the worker is stopped.
func (*Node) GetLastSynced ¶
func (n *Node) GetLastSynced() (uint64, storageApi.Root, storageApi.Root)
GetLastSynced returns the height, IORoot hash and StateRoot hash of the last block that was fully synced to.
func (*Node) GetLocalStorage ¶ added in v0.2102.0
func (n *Node) GetLocalStorage() storageApi.LocalBackend
GetLocalStorage returns the local storage backend used by this storage node.
func (*Node) HandleEpochTransitionLocked ¶
func (n *Node) HandleEpochTransitionLocked(snapshot *committee.EpochSnapshot)
HandleEpochTransitionLocked is guarded by CrossNode.
func (*Node) HandleNewBlockEarlyLocked ¶
HandleNewBlockEarlyLocked is guarded by CrossNode.
func (*Node) HandleNewBlockLocked ¶
HandleNewBlockLocked is guarded by CrossNode.
func (*Node) HandleNewEventLocked ¶
func (n *Node) HandleNewEventLocked(*roothashApi.Event)
HandleNewEventLocked is guarded by CrossNode.
func (*Node) HandlePeerTx ¶ added in v0.2200.0
func (*Node) HandleRuntimeHostEventLocked ¶ added in v0.2202.0
HandleRuntimeHostEventLocked is guarded by CrossNode.
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) PauseCheckpointer ¶ added in v0.2102.0
func (*Node) Quit ¶
func (n *Node) Quit() <-chan struct{}
Quit returns a channel that will be closed when the worker stops.