Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustSubEpoch ¶
func MustSubEpoch(ctx context.Context, wg *sync.WaitGroup, cfx *sdk.Client, subscribers ...EpochSubscriber)
MustSubEpoch subscribes the latest mined epoch. Note, it will block the current thread.
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.
type EpochSubscriber ¶
type EpochSubscriber interface {
// contains filtered or unexported methods
}
EpochSubscriber is an interface to consume subscribed epochs.
func NewConsoleEpochSubscriber ¶
func NewConsoleEpochSubscriber(cfx sdk.ClientOperator) EpochSubscriber
NewConsoleEpochSubscriber creates an instance of EpochSubscriber to consume epoch.
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.
type KVCacheSyncer ¶
type KVCacheSyncer struct {
// contains filtered or unexported fields
}
KVCacheSyncer is used to sync core space blockchain data into kv cache against the latest state epoch.
func MustNewKVCacheSyncer ¶
func MustNewKVCacheSyncer(cfx sdk.ClientOperator, cache store.CacheStore) *KVCacheSyncer
MustNewKVCacheSyncer creates an instance of KVCacheSyncer to sync the latest state epoch 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 ¶
MustNewKVCachePruner creates an instance of Pruner to prune blockchain data in kv cache