sync

package
v1.2.1-mainnet Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseSyncer

type DatabaseSyncer struct {
	// contains filtered or unexported fields
}

DatabaseSyncer is used to sync blockchain data into database against the latest confirmed epoch.

func MustNewDatabaseSyncer

func MustNewDatabaseSyncer(cfx sdk.ClientOperator, db *mysql.MysqlStore) *DatabaseSyncer

MustNewDatabaseSyncer creates an instance of DatabaseSyncer to sync blockchain data.

func (*DatabaseSyncer) Sync

func (syncer *DatabaseSyncer) Sync(ctx context.Context, wg *sync.WaitGroup)

Sync starts to sync epoch blockchain data.

type EthSyncer

type EthSyncer struct {
	// contains filtered or unexported fields
}

EthSyncer is used to synchronize evm space blockchain data into db store.

func MustNewEthSyncer

func MustNewEthSyncer(ethC *web3go.Client, db *mysql.MysqlStore) *EthSyncer

MustNewEthSyncer creates an instance of EthSyncer to sync Conflux EVM space chaindata.

func (*EthSyncer) Sync

func (syncer *EthSyncer) Sync(ctx context.Context, wg *sync.WaitGroup)

Sync starts to sync Conflux EVM space blockchain data.

type PruneConfig

type PruneConfig struct {
	PruneInterval  time.Duration  `mapstructure:"interval"`  // interval to run pruning
	Threshold      PruneThresHold `mapstructure:"threshold"` // threshold for pruning
	MaxPruneEpochs uint64         `mapstructure:"maxEpochs"` // max epochs to prune if threshold condition met
}

type PruneThresHold

type PruneThresHold struct {
	MaxBlocks uint64 `mapstructure:"maxBlocks"` // max number of blocks to trigger block pruning
	MaxTxs    uint64 `mapstructure:"maxTxs"`    // max number of transactions to trigger transaction pruning
	MaxLogs   uint64 `mapstructure:"maxLogs"`   // max number of logs to trigger log pruning
}

Threshold settings for pruner

type Pruner

type Pruner struct {
	// contains filtered or unexported fields
}

Pruner is used to prune blockchain data in store periodly. It will prune blockchain data in store with epoch as the smallest unit to retain data atomicity.

func MustNewKVCachePruner

func MustNewKVCachePruner(cache store.Prunable) *Pruner

MustNewKVCachePruner creates an instance of Pruner to prune blockchain data in kv cache

func (*Pruner) Prune

func (pruner *Pruner) Prune(ctx context.Context, wg *sync.WaitGroup)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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