Version: v1.9.1 Latest Latest

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

Go to latest
Published: Aug 19, 2022 License: GPL-3.0 Imports: 20 Imported by: 0




View Source
const (
	ModeKAS = ChainDataFetcherMode(iota)
View Source
const (
	DefaultNumHandlers           = 10
	DefaultJobChannelSize        = 50
	DefaultBlockChannelSize      = 500
	DefaultDBPort                = "3306"
	DefaultMaxProcessingDataSize = 500 // in MB
	DefaultThrottlingInterval    = 300 * time.Millisecond
View Source
const (
	InsertRetryInterval = 500 * time.Millisecond
	InsertMaxRetry      = 100


View Source
var DefaultChainDataFetcherConfig = &ChainDataFetcherConfig{
	EnabledChainDataFetcher: false,
	Mode:                    ModeKAS,
	NoDefaultStart:          false,
	NumHandlers:             DefaultNumHandlers,
	JobChannelSize:          DefaultJobChannelSize,
	BlockChannelSize:        DefaultBlockChannelSize,
	MaxProcessingDataSize:   DefaultMaxProcessingDataSize,

	KasConfig:   kas.DefaultKASConfig,
	KafkaConfig: kafka.GetDefaultKafkaConfig(),


This section is empty.


type BlockChain

type BlockChain interface {
	SubscribeChainEvent(ch chan<- blockchain.ChainEvent) event.Subscription
	CurrentHeader() *types.Header
	GetBlockByNumber(number uint64) *types.Block
	GetReceiptsByBlockHash(blockHash common.Hash) types.Receipts

type ChainDataFetcher

type ChainDataFetcher struct {
	// contains filtered or unexported fields

func (*ChainDataFetcher) APIs

func (f *ChainDataFetcher) APIs() []rpc.API

func (*ChainDataFetcher) Components

func (f *ChainDataFetcher) Components() []interface{}

func (*ChainDataFetcher) Protocols

func (f *ChainDataFetcher) Protocols() []p2p.Protocol

func (*ChainDataFetcher) SetComponents

func (f *ChainDataFetcher) SetComponents(components []interface{})

func (*ChainDataFetcher) Start

func (f *ChainDataFetcher) Start(server p2p.Server) error

func (*ChainDataFetcher) Stop

func (f *ChainDataFetcher) Stop() error

type ChainDataFetcherConfig

type ChainDataFetcherConfig struct {
	EnabledChainDataFetcher bool
	Mode                    ChainDataFetcherMode
	NoDefaultStart          bool
	NumHandlers             int
	JobChannelSize          int
	BlockChannelSize        int
	MaxProcessingDataSize   int

	KasConfig   *kas.KASConfig `json:"-"` // Deprecated: This configuration is not used anymore.
	KafkaConfig *kafka.KafkaConfig

type ChainDataFetcherMode added in v1.5.3

type ChainDataFetcherMode int

type CheckpointDB added in v1.5.3

type CheckpointDB interface {
	ReadCheckpoint() (int64, error)
	WriteCheckpoint(checkpoint int64) error

type ComponentSetter added in v1.5.3

type ComponentSetter interface {
	SetComponent(component interface{})

type HandleChainEventFn added in v1.5.3

type HandleChainEventFn func(blockchain.ChainEvent, types.RequestType) error

type PublicChainDataFetcherAPI

type PublicChainDataFetcherAPI struct {
	// contains filtered or unexported fields

func NewPublicChainDataFetcherAPI

func NewPublicChainDataFetcherAPI(f *ChainDataFetcher) *PublicChainDataFetcherAPI

func (*PublicChainDataFetcherAPI) GetConfig

GetConfig returns the configuration setting of the launched chaindata fetcher.

func (*PublicChainDataFetcherAPI) ReadCheckpoint

func (api *PublicChainDataFetcherAPI) ReadCheckpoint() (int64, error)

func (*PublicChainDataFetcherAPI) StartFetching

func (api *PublicChainDataFetcherAPI) StartFetching() error

func (*PublicChainDataFetcherAPI) StartRangeFetching

func (api *PublicChainDataFetcherAPI) StartRangeFetching(start, end uint64, reqType uint) error

func (*PublicChainDataFetcherAPI) Status

func (api *PublicChainDataFetcherAPI) Status() string

func (*PublicChainDataFetcherAPI) StopFetching

func (api *PublicChainDataFetcherAPI) StopFetching() error

func (*PublicChainDataFetcherAPI) StopRangeFetching

func (api *PublicChainDataFetcherAPI) StopRangeFetching() error

func (*PublicChainDataFetcherAPI) WriteCheckpoint

func (api *PublicChainDataFetcherAPI) WriteCheckpoint(checkpoint int64) error

type Repository

type Repository interface {
	HandleChainEvent(event blockchain.ChainEvent, dataType types.RequestType) error


Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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