Versions in this module Expand all Collapse all v1 v1.0.0 Jan 16, 2024 Changes in this version + var DefaultClientIndexerConfig = &IndexerConfig + var DefaultServerIndexerConfig = &IndexerConfig + var ErrNoPeers = errors.New("no suitable peers available") + var NoOdr = context.Background() + var TestClientIndexerConfig = &IndexerConfig + var TestServerIndexerConfig = &IndexerConfig + func GetBlock(ctx context.Context, odr OdrBackend, hash common.Hash, number uint64) (*types.Block, error) + func GetBlockLogs(ctx context.Context, odr OdrBackend, hash common.Hash, number uint64) ([][]*types.Log, error) + func GetBlockReceipts(ctx context.Context, odr OdrBackend, hash common.Hash, number uint64) (types.Receipts, error) + func GetBloomBits(ctx context.Context, odr OdrBackend, bit uint, sections []uint64) ([][]byte, error) + func GetBloomTrieRoot(db ethdb.Database, sectionIdx uint64, sectionHead common.Hash) common.Hash + func GetBody(ctx context.Context, odr OdrBackend, hash common.Hash, number uint64) (*types.Body, error) + func GetBodyRLP(ctx context.Context, odr OdrBackend, hash common.Hash, number uint64) (rlp.RawValue, error) + func GetCanonicalHash(ctx context.Context, odr OdrBackend, number uint64) (common.Hash, error) + func GetChtRoot(db ethdb.Database, sectionIdx uint64, sectionHead common.Hash) common.Hash + func GetHeaderByNumber(ctx context.Context, odr OdrBackend, number uint64) (*types.Header, error) + func GetTd(ctx context.Context, odr OdrBackend, hash common.Hash, number uint64) (*big.Int, error) + func GetTransaction(ctx context.Context, odr OdrBackend, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) + func NewBloomTrieIndexer(db ethdb.Database, odr OdrBackend, parentSize, size uint64, ...) *core.ChainIndexer + func NewChtIndexer(db ethdb.Database, odr OdrBackend, size, confirms uint64, disablePruning bool) *core.ChainIndexer + func NewState(ctx context.Context, head *types.Header, odr OdrBackend) *state.StateDB + func NewStateDatabase(ctx context.Context, head *types.Header, odr OdrBackend) state.Database + func StoreBloomTrieRoot(db ethdb.Database, sectionIdx uint64, sectionHead, root common.Hash) + func StoreChtRoot(db ethdb.Database, sectionIdx uint64, sectionHead, root common.Hash) + type BlockRequest struct + Hash common.Hash + Header *types.Header + Number uint64 + Rlp []byte + func (req *BlockRequest) StoreResult(db ethdb.Database) + type BloomRequest struct + BitIdx uint + BloomBits [][]byte + BloomTrieNum uint64 + BloomTrieRoot common.Hash + Config *IndexerConfig + Proofs *trienode.ProofSet + SectionIndexList []uint64 + func (req *BloomRequest) StoreResult(db ethdb.Database) + type BloomTrieIndexerBackend struct + func (b *BloomTrieIndexerBackend) Commit() error + func (b *BloomTrieIndexerBackend) Process(ctx context.Context, header *types.Header) error + func (b *BloomTrieIndexerBackend) Prune(threshold uint64) error + func (b *BloomTrieIndexerBackend) Reset(ctx context.Context, section uint64, lastSectionHead common.Hash) error + type ChtIndexerBackend struct + func (c *ChtIndexerBackend) Commit() error + func (c *ChtIndexerBackend) Process(ctx context.Context, header *types.Header) error + func (c *ChtIndexerBackend) Prune(threshold uint64) error + func (c *ChtIndexerBackend) Reset(ctx context.Context, section uint64, lastSectionHead common.Hash) error + type ChtNode struct + Hash common.Hash + Td *big.Int + type ChtRequest struct + BlockNum uint64 + ChtNum uint64 + ChtRoot common.Hash + Config *IndexerConfig + Header *types.Header + Proof *trienode.ProofSet + Td *big.Int + func (req *ChtRequest) StoreResult(db ethdb.Database) + type CodeRequest struct + Data []byte + Hash common.Hash + Id *TrieID + func (req *CodeRequest) StoreResult(db ethdb.Database) + type IndexerConfig struct + BloomConfirms uint64 + BloomSize uint64 + BloomTrieConfirms uint64 + BloomTrieSize uint64 + ChtConfirms uint64 + ChtSize uint64 + type LightChain struct + func NewLightChain(odr OdrBackend, config *params.ChainConfig, engine consensus.Engine) (*LightChain, error) + func (bc *LightChain) GetCanonicalHash(number uint64) common.Hash + func (lc *LightChain) Config() *params.ChainConfig + func (lc *LightChain) CurrentHeader() *types.Header + func (lc *LightChain) Engine() consensus.Engine + func (lc *LightChain) GasLimit() uint64 + func (lc *LightChain) Genesis() *types.Block + func (lc *LightChain) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) + func (lc *LightChain) GetBlock(ctx context.Context, hash common.Hash, number uint64) (*types.Block, error) + func (lc *LightChain) GetBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) + func (lc *LightChain) GetBlockByNumber(ctx context.Context, number uint64) (*types.Block, error) + func (lc *LightChain) GetBody(ctx context.Context, hash common.Hash) (*types.Body, error) + func (lc *LightChain) GetBodyRLP(ctx context.Context, hash common.Hash) (rlp.RawValue, error) + func (lc *LightChain) GetHeader(hash common.Hash, number uint64) *types.Header + func (lc *LightChain) GetHeaderByHash(hash common.Hash) *types.Header + func (lc *LightChain) GetHeaderByNumber(number uint64) *types.Header + func (lc *LightChain) GetHeaderByNumberOdr(ctx context.Context, number uint64) (*types.Header, error) + func (lc *LightChain) GetTd(hash common.Hash, number uint64) *big.Int + func (lc *LightChain) GetTdOdr(ctx context.Context, hash common.Hash, number uint64) *big.Int + func (lc *LightChain) HasBlock(hash common.Hash, number uint64) bool + func (lc *LightChain) HasHeader(hash common.Hash, number uint64) bool + func (lc *LightChain) HeaderChain() *core.HeaderChain + func (lc *LightChain) InsertHeader(header *types.Header) error + func (lc *LightChain) InsertHeaderChain(chain []*types.Header) (int, error) + func (lc *LightChain) LockChain() + func (lc *LightChain) Odr() OdrBackend + func (lc *LightChain) Reset() + func (lc *LightChain) ResetWithGenesisBlock(genesis *types.Block) + func (lc *LightChain) Rollback(chain []common.Hash) + func (lc *LightChain) SetCanonical(header *types.Header) error + func (lc *LightChain) SetHead(head uint64) error + func (lc *LightChain) SetHeadWithTimestamp(timestamp uint64) error + func (lc *LightChain) StateCache() state.Database + func (lc *LightChain) Stop() + func (lc *LightChain) StopInsert() + func (lc *LightChain) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription + func (lc *LightChain) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription + func (lc *LightChain) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription + func (lc *LightChain) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription + func (lc *LightChain) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription + func (lc *LightChain) UnlockChain() + type OdrBackend interface + BloomIndexer func() *core.ChainIndexer + BloomTrieIndexer func() *core.ChainIndexer + ChtIndexer func() *core.ChainIndexer + Database func() ethdb.Database + IndexerConfig func() *IndexerConfig + Retrieve func(ctx context.Context, req OdrRequest) error + RetrieveTxStatus func(ctx context.Context, req *TxStatusRequest) error + type OdrRequest interface + StoreResult func(db ethdb.Database) + type ReceiptsRequest struct + Hash common.Hash + Header *types.Header + Number uint64 + Receipts types.Receipts + func (req *ReceiptsRequest) StoreResult(db ethdb.Database) + type TrieID struct + AccountAddress []byte + BlockHash common.Hash + BlockNumber uint64 + Root common.Hash + StateRoot common.Hash + func StateTrieID(header *types.Header) *TrieID + func StorageTrieID(state *TrieID, address common.Address, root common.Hash) *TrieID + type TrieRequest struct + Id *TrieID + Key []byte + Proof *trienode.ProofSet + func (req *TrieRequest) StoreResult(db ethdb.Database) + type TxPool struct + func NewTxPool(config *params.ChainConfig, chain *LightChain, relay TxRelayBackend) *TxPool + func (pool *TxPool) Add(ctx context.Context, tx *types.Transaction) error + func (pool *TxPool) AddBatch(ctx context.Context, txs []*types.Transaction) + func (pool *TxPool) Content() (map[common.Address][]*types.Transaction, ...) + func (pool *TxPool) ContentFrom(addr common.Address) ([]*types.Transaction, []*types.Transaction) + func (pool *TxPool) GetNonce(ctx context.Context, addr common.Address) (uint64, error) + func (pool *TxPool) GetTransaction(hash common.Hash) *types.Transaction + func (pool *TxPool) GetTransactions() (txs types.Transactions, err error) + func (pool *TxPool) RemoveTransactions(txs types.Transactions) + func (pool *TxPool) RemoveTx(hash common.Hash) + func (pool *TxPool) Stats() (pending int) + func (pool *TxPool) Stop() + func (pool *TxPool) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription + type TxRelayBackend interface + Discard func(hashes []common.Hash) + NewHead func(head common.Hash, mined []common.Hash, rollback []common.Hash) + Send func(txs types.Transactions) + type TxStatus struct + Error string + Lookup *rawdb.LegacyTxLookupEntry + Status txpool.TxStatus + type TxStatusRequest struct + Hashes []common.Hash + Status []TxStatus + func (req *TxStatusRequest) StoreResult(db ethdb.Database)