Documentation
¶
Index ¶
- type CoreRpcClient
- func (c *CoreRpcClient) BoostQueryEpochData(ctx context.Context, fromEpoch, toEpoch uint64) (res []*store.EpochData, err error)
- func (c *CoreRpcClient) GetFinalizationStatus(ctx context.Context) (*FinalizationStatus, error)
- func (c *CoreRpcClient) QueryEpochData(ctx context.Context, fromEpoch, toEpoch uint64) (res []*store.EpochData, err error)
- func (c *CoreRpcClient) Space() string
- type EvmRpcClient
- func (c *EvmRpcClient) BoostQueryEpochData(ctx context.Context, fromBlock, toBlock uint64) ([]*store.EpochData, error)
- func (e *EvmRpcClient) ChainId() (uint64, error)
- func (e *EvmRpcClient) GetFinalizationStatus(ctx context.Context) (*FinalizationStatus, error)
- func (c *EvmRpcClient) QueryEpochData(ctx context.Context, fromBlock, toBlock uint64) ([]*store.EpochData, error)
- func (c *EvmRpcClient) Space() string
- type FinalizationStatus
- type IRpcClient
- type SyncOption
- type Syncer
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) BoostQueryEpochData ¶
func (*CoreRpcClient) GetFinalizationStatus ¶
func (c *CoreRpcClient) GetFinalizationStatus(ctx context.Context) (*FinalizationStatus, error)
func (*CoreRpcClient) QueryEpochData ¶
func (*CoreRpcClient) Space ¶
func (c *CoreRpcClient) Space() string
type EvmRpcClient ¶
func NewEvmRpcClient ¶
func NewEvmRpcClient(w3c *web3go.Client) *EvmRpcClient
func (*EvmRpcClient) BoostQueryEpochData ¶
func (*EvmRpcClient) ChainId ¶
func (e *EvmRpcClient) ChainId() (uint64, error)
func (*EvmRpcClient) GetFinalizationStatus ¶
func (e *EvmRpcClient) GetFinalizationStatus(ctx context.Context) (*FinalizationStatus, error)
func (*EvmRpcClient) QueryEpochData ¶
func (*EvmRpcClient) Space ¶
func (c *EvmRpcClient) Space() string
type FinalizationStatus ¶
type IRpcClient ¶
type IRpcClient interface {
GetFinalizationStatus(ctx context.Context) (*FinalizationStatus, error)
QueryEpochData(ctx context.Context, from, to uint64) ([]*store.EpochData, error)
BoostQueryEpochData(ctx context.Context, from, to uint64) ([]*store.EpochData, error)
Space() string
Close()
}
func MustNewCoreRpcClient ¶
func MustNewCoreRpcClient(nodeUrl string) IRpcClient
func MustNewEvmRpcClient ¶
func MustNewEvmRpcClient(nodeUrl string) IRpcClient
type SyncOption ¶
type SyncOption func(*Syncer)
functional options for syncer
func WithBenchmark ¶
func WithBenchmark(benchmark bool) SyncOption
func WithBoostConfig ¶
func WithBoostConfig(config boostConfig) SyncOption
func WithMaxDbRows ¶
func WithMaxDbRows(dbRows int) SyncOption
func WithMinBatchDbRows ¶
func WithMinBatchDbRows(dbRows int) SyncOption
func WithWorkers ¶
func WithWorkers(workers []*worker) SyncOption
type Syncer ¶
type Syncer 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.MysqlStore, elm election.LeaderManager, monitor *monitor.Monitor, epochFrom uint64, opts ...SyncOption) *Syncer
func MustNewEthSyncer ¶
func MustNewEthSyncer( clients []*web3go.Client, dbs *mysql.MysqlStore, elm election.LeaderManager, monitor *monitor.Monitor, epochFrom uint64, opts ...SyncOption) *Syncer
Click to show internal directories.
Click to hide internal directories.