Documentation ¶
Index ¶
- Constants
- Variables
- 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 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 uint) 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 ( DefaultNumHandlers = 10 DefaultJobChannelSize = 50 DefaultBlockChannelSize = 500 DefaultDBPort = "3306" )
View Source
const DBInsertRetryInterval = 500 * time.Millisecond
Variables ¶
View Source
var DefaultChainDataFetcherConfig = &ChainDataFetcherConfig{ EnabledChainDataFetcher: false, NoDefaultStart: false, NumHandlers: DefaultNumHandlers, JobChannelSize: DefaultJobChannelSize, BlockChannelSize: DefaultBlockChannelSize, KasConfig: kas.DefaultKASConfig, }
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 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 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 { InsertTransactions(event blockchain.ChainEvent) error InsertTokenTransfers(event blockchain.ChainEvent) error InsertTraceResults(event blockchain.ChainEvent) error InsertContracts(event blockchain.ChainEvent) error ReadCheckpoint() (int64, error) WriteCheckpoint(checkpoint int64) error SetComponent(component interface{}) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.