chaindatafetcher

package
v1.5.2-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

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 (*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
	NoDefaultStart          bool
	NumHandlers             int
	JobChannelSize          int
	BlockChannelSize        int

	KasConfig *kas.KASConfig
}

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 {
	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{})
}

Directories

Path Synopsis
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