chaindatafetcher

package
v1.12.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

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 (*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 `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 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 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
}

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
kas
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.

Jump to

Keyboard shortcuts

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