Documentation ¶
Index ¶
- type ChainSyncType
- type Progression
- type ProgressionWrapper
- func (pw *ProgressionWrapper) GetProgression() *Progression
- func (pw *ProgressionWrapper) RunUpdateLoop(subscription blockchain.Subscription)
- func (pw *ProgressionWrapper) StartProgression(startingBlock uint64, subscription blockchain.Subscription)
- func (pw *ProgressionWrapper) StopProgression()
- func (pw *ProgressionWrapper) UpdateCurrentProgression(currentBlock uint64)
- func (pw *ProgressionWrapper) UpdateHighestProgression(highestBlock uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainSyncType ¶
type ChainSyncType string
const ( ChainSyncRestore ChainSyncType = "restore" ChainSyncBulk ChainSyncType = "bulk-sync" )
type Progression ¶
type Progression struct { // SyncType is indicating the sync method SyncType ChainSyncType // StartingBlock is the initial block that the node is starting // the sync from. It is reset after every sync batch StartingBlock uint64 // CurrentBlock is the last written block from the sync batch CurrentBlock uint64 // HighestBlock is the target block in the sync batch HighestBlock uint64 }
Progression defines the status of the sync progression of the node
type ProgressionWrapper ¶
type ProgressionWrapper struct {
// contains filtered or unexported fields
}
func NewProgressionWrapper ¶
func NewProgressionWrapper(syncType ChainSyncType) *ProgressionWrapper
func (*ProgressionWrapper) GetProgression ¶
func (pw *ProgressionWrapper) GetProgression() *Progression
GetProgression returns the latest sync progression
func (*ProgressionWrapper) RunUpdateLoop ¶
func (pw *ProgressionWrapper) RunUpdateLoop(subscription blockchain.Subscription)
runUpdateLoop starts the blockchain event monitoring loop and updates the currently written block in the batch sync
func (*ProgressionWrapper) StartProgression ¶
func (pw *ProgressionWrapper) StartProgression( startingBlock uint64, subscription blockchain.Subscription, )
startProgression initializes the progression tracking
func (*ProgressionWrapper) StopProgression ¶
func (pw *ProgressionWrapper) StopProgression()
StopProgression stops the progression tracking
func (*ProgressionWrapper) UpdateCurrentProgression ¶
func (pw *ProgressionWrapper) UpdateCurrentProgression(currentBlock uint64)
UpdateCurrentProgression sets the currently written block in the bulk sync
func (*ProgressionWrapper) UpdateHighestProgression ¶
func (pw *ProgressionWrapper) UpdateHighestProgression(highestBlock uint64)
UpdateHighestProgression sets the highest-known target block in the bulk sync
Click to show internal directories.
Click to hide internal directories.