catchup

package
v1.6.11-testnet Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoreRpcClient

type CoreRpcClient struct {
	sdk.ClientOperator
}

func NewCoreRpcClient

func NewCoreRpcClient(cfx sdk.ClientOperator) *CoreRpcClient

func (*CoreRpcClient) BoostQueryChainData

func (c *CoreRpcClient) BoostQueryChainData(ctx context.Context, fromEpoch, toEpoch uint64) (res []*store.EpochData, err error)

func (*CoreRpcClient) GetFinalizationStatus

func (c *CoreRpcClient) GetFinalizationStatus(ctx context.Context) (*FinalizationStatus, error)

func (*CoreRpcClient) QueryChainData

func (c *CoreRpcClient) QueryChainData(ctx context.Context, fromEpoch, toEpoch uint64) (res []*store.EpochData, err error)

func (*CoreRpcClient) Space

func (c *CoreRpcClient) Space() string

type EvmRpcClient

type EvmRpcClient struct {
	*web3go.Client
}

func NewEvmRpcClient

func NewEvmRpcClient(w3c *web3go.Client) *EvmRpcClient

func (*EvmRpcClient) BoostQueryChainData

func (c *EvmRpcClient) BoostQueryChainData(ctx context.Context, fromBlock, toBlock uint64) ([]*store.EthData, error)

func (*EvmRpcClient) GetFinalizationStatus

func (e *EvmRpcClient) GetFinalizationStatus(ctx context.Context) (*FinalizationStatus, error)

func (*EvmRpcClient) QueryChainData

func (c *EvmRpcClient) QueryChainData(ctx context.Context, fromBlock, toBlock uint64) ([]*store.EthData, error)

func (*EvmRpcClient) Space

func (c *EvmRpcClient) Space() string

type FinalizationStatus

type FinalizationStatus struct {
	LatestFinalized  uint64
	LatestCheckpoint uint64
}

type IRpcClient

type IRpcClient[T store.ChainData] interface {
	GetFinalizationStatus(ctx context.Context) (*FinalizationStatus, error)
	QueryChainData(ctx context.Context, from, to uint64) ([]T, error)
	BoostQueryChainData(ctx context.Context, from, to uint64) ([]T, error)
	Space() string
	Close()
}

func MustNewCoreRpcClient

func MustNewCoreRpcClient(nodeUrl string) IRpcClient[*store.EpochData]

func MustNewEvmRpcClient

func MustNewEvmRpcClient(nodeUrl string) IRpcClient[*store.EthData]

type Syncer

type Syncer[T store.ChainData] struct {
	// contains filtered or unexported fields
}

Syncer accelerates core space epoch data catch-up using concurrently workers. Specifically, each worker will be dispatched as round-robin load balancing.

func MustNewCfxSyncer

func MustNewCfxSyncer(
	clients []*sdk.Client,
	dbs *mysql.CfxStore,
	elm election.LeaderManager,
	monitor *monitor.Monitor,
	epochFrom uint64,
) *Syncer[*store.EpochData]

func MustNewEthSyncer

func MustNewEthSyncer(
	clients []*web3go.Client,
	dbs *mysql.EthStore,
	elm election.LeaderManager,
	monitor *monitor.Monitor,
	epochFrom uint64,
) *Syncer[*store.EthData]

func (*Syncer[T]) Close

func (s *Syncer[T]) Close() error

func (*Syncer[T]) Sync

func (s *Syncer[T]) Sync(ctx context.Context)

func (*Syncer[T]) SyncOnce

func (s *Syncer[T]) SyncOnce(ctx context.Context, start, end uint64)

func (*Syncer[T]) UseBoost

func (s *Syncer[T]) UseBoost() bool

Jump to

Keyboard shortcuts

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