progress

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL