Documentation ¶
Index ¶
- type ChainSyncType
- type Progression
- type ProgressionWrapper
- func (pw *ProgressionWrapper) GetProgression() *Progression
- func (pw *ProgressionWrapper) StartProgression(syncingPeer string, 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 // SyncingPeer is current syncing peer id SyncingPeer string // 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 *atomic.Uint64 // contains filtered or unexported fields }
Progression defines the status of the sync progression of the node
func (*Progression) GetHighestBlock ¶ added in v1.2.4
func (p *Progression) GetHighestBlock() uint64
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) StartProgression ¶
func (pw *ProgressionWrapper) StartProgression( syncingPeer string, 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.