Documentation ¶
Index ¶
- Constants
- type BlockChain
- type ChainDataFetcher
- func (f *ChainDataFetcher) APIs() []rpc.API
- func (f *ChainDataFetcher) Components() []interface{}
- func (f *ChainDataFetcher) Protocols() []p2p.Protocol
- func (f *ChainDataFetcher) SetComponents(components []interface{})
- func (f *ChainDataFetcher) Start(server p2p.Server) error
- func (f *ChainDataFetcher) Stop() error
- type ChainDataFetcherConfig
- type ChainDataFetcherMode
- type CheckpointDB
- type ComponentSetter
- type HandleChainEventFn
- type PublicChainDataFetcherAPI
- func (api *PublicChainDataFetcherAPI) GetConfig() *ChainDataFetcherConfig
- func (api *PublicChainDataFetcherAPI) ReadCheckpoint() (int64, error)
- func (api *PublicChainDataFetcherAPI) StartFetching() error
- func (api *PublicChainDataFetcherAPI) StartRangeFetching(start, end uint64, reqType interface{}) error
- func (api *PublicChainDataFetcherAPI) Status() string
- func (api *PublicChainDataFetcherAPI) StopFetching() error
- func (api *PublicChainDataFetcherAPI) StopRangeFetching() error
- func (api *PublicChainDataFetcherAPI) WriteCheckpoint(checkpoint int64) error
- type Repository
Constants ¶
View Source
const ( ModeKAS = ChainDataFetcherMode(iota) ModeKafka )
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 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 NewChainDataFetcher ¶
func NewChainDataFetcher(ctx *node.ServiceContext, cfg *ChainDataFetcherConfig) (*ChainDataFetcher, error)
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) 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 `toml:",omitempty"` }
func DefaultChainDataFetcherConfig ¶
func DefaultChainDataFetcherConfig() *ChainDataFetcherConfig
type ChainDataFetcherMode ¶ added in v1.5.3
type ChainDataFetcherMode int
type CheckpointDB ¶ added in v1.5.3
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 ¶
func (api *PublicChainDataFetcherAPI) GetConfig() *ChainDataFetcherConfig
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 interface{}) 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
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
mocks
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. |
Click to show internal directories.
Click to hide internal directories.