Versions in this module Expand all Collapse all v1 v1.0.1 Dec 19, 2019 Changes in this version + const BloomTrieFrequency + const CHTFrequencyClient + const CHTFrequencyServer + const HelperTrieConfirmations + const HelperTrieProcessConfirmations + var BloomTrieTablePrefix = "blt-" + var ChtTablePrefix = "cht-" + var ErrNoHeader = errors.New("Header not found") + var ErrNoTrustedBloomTrie = errors.New("No trusted bloom trie") + var ErrNoTrustedCht = errors.New("No trusted canonical hash trie") + var NoOdr = context.Background() + 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, bitIdx uint, sectionIdxList []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 GetChtV2Root(db ethdb.Database, sectionIdx uint64, sectionHead common.Hash) common.Hash + func GetHeaderByNumber(ctx context.Context, odr OdrBackend, number uint64) (*types.Header, error) + func NewBloomTrieIndexer(db ethdb.Database, clientMode bool) *core.ChainIndexer + func NewChtIndexer(db ethdb.Database, clientMode 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 + Number uint64 + Rlp []byte + func (req *BlockRequest) StoreResult(db ethdb.Database) + type BloomRequest struct + BitIdx uint + BloomBits [][]byte + BloomTrieNum uint64 + BloomTrieRoot common.Hash + Proofs *NodeSet + SectionIdxList []uint64 + func (req *BloomRequest) StoreResult(db ethdb.Database) + type BloomTrieIndexerBackend struct + func (b *BloomTrieIndexerBackend) Commit() error + func (b *BloomTrieIndexerBackend) Process(header *types.Header) + func (b *BloomTrieIndexerBackend) Reset(section uint64, lastSectionHead common.Hash) error + type ChtIndexerBackend struct + func (c *ChtIndexerBackend) Commit() error + func (c *ChtIndexerBackend) Process(header *types.Header) + func (c *ChtIndexerBackend) Reset(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 + Header *types.Header + Proof *NodeSet + 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 LightChain struct + func NewLightChain(odr OdrBackend, config *params.ChainConfig, engine consensus.Engine) (*LightChain, error) + func (bc *LightChain) Engine() consensus.Engine + func (bc *LightChain) Genesis() *types.Block + func (bc *LightChain) HasBlock(hash common.Hash, number uint64) bool + func (bc *LightChain) HasHeader(hash common.Hash, number uint64) bool + func (bc *LightChain) Reset() + func (bc *LightChain) ResetWithGenesisBlock(genesis *types.Block) + func (bc *LightChain) SetHead(head uint64) + func (bc *LightChain) State() (*state.StateDB, error) + func (bc *LightChain) StateCache() *state.Database + func (bc *LightChain) Stop() + func (self *LightChain) Config() *params.ChainConfig + func (self *LightChain) CurrentHeader() *types.Header + func (self *LightChain) GasLimit() uint64 + func (self *LightChain) GetBlock(ctx context.Context, hash common.Hash, number uint64) (*types.Block, error) + func (self *LightChain) GetBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) + func (self *LightChain) GetBlockByNumber(ctx context.Context, number uint64) (*types.Block, error) + func (self *LightChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash + func (self *LightChain) GetBody(ctx context.Context, hash common.Hash) (*types.Body, error) + func (self *LightChain) GetBodyRLP(ctx context.Context, hash common.Hash) (rlp.RawValue, error) + func (self *LightChain) GetHeader(hash common.Hash, number uint64) *types.Header + func (self *LightChain) GetHeaderByHash(hash common.Hash) *types.Header + func (self *LightChain) GetHeaderByNumber(number uint64) *types.Header + func (self *LightChain) GetHeaderByNumberOdr(ctx context.Context, number uint64) (*types.Header, error) + func (self *LightChain) GetTd(hash common.Hash, number uint64) *big.Int + func (self *LightChain) GetTdByHash(hash common.Hash) *big.Int + func (self *LightChain) InsertHeaderChain(chain []*types.Header, checkFreq int) (int, error) + func (self *LightChain) LockChain() + func (self *LightChain) Odr() OdrBackend + func (self *LightChain) Rollback(chain []common.Hash) + func (self *LightChain) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription + func (self *LightChain) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription + func (self *LightChain) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription + func (self *LightChain) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription + func (self *LightChain) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription + func (self *LightChain) SyncCht(ctx context.Context) bool + func (self *LightChain) UnlockChain() + type NodeList []rlp.RawValue + func (n *NodeList) Put(key []byte, value []byte) error + func (n NodeList) DataSize() int + func (n NodeList) NodeSet() *NodeSet + func (n NodeList) Store(db ethdb.Putter) + type NodeSet struct + func NewNodeSet() *NodeSet + func (db *NodeSet) DataSize() int + func (db *NodeSet) Get(key []byte) ([]byte, error) + func (db *NodeSet) Has(key []byte) (bool, error) + func (db *NodeSet) KeyCount() int + func (db *NodeSet) NodeList() NodeList + func (db *NodeSet) Put(key []byte, value []byte) error + func (db *NodeSet) Store(target ethdb.Putter) + type OdrBackend interface + BloomIndexer func() *core.ChainIndexer + BloomTrieIndexer func() *core.ChainIndexer + ChtIndexer func() *core.ChainIndexer + Database func() ethdb.Database + Retrieve func(ctx context.Context, req OdrRequest) error + type OdrRequest interface + StoreResult func(db ethdb.Database) + type ReceiptsRequest struct + Hash common.Hash + Number uint64 + Receipts types.Receipts + func (req *ReceiptsRequest) StoreResult(db ethdb.Database) + type TrieID struct + AccKey []byte + BlockHash common.Hash + BlockNumber uint64 + Root common.Hash + func StateTrieID(header *types.Header) *TrieID + func StorageTrieID(state *TrieID, addrHash, root common.Hash) *TrieID + type TrieRequest struct + Id *TrieID + Key []byte + Proof *NodeSet + func (req *TrieRequest) StoreResult(db ethdb.Database) + type TxPool struct + func NewTxPool(config *params.ChainConfig, chain *LightChain, relay TxRelayBackend) *TxPool + func (pool *TxPool) GetNonce(ctx context.Context, addr common.Address) (uint64, error) + 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 + func (self *TxPool) Add(ctx context.Context, tx *types.Transaction) error + func (self *TxPool) AddBatch(ctx context.Context, txs []*types.Transaction) + func (self *TxPool) Content() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) + func (self *TxPool) GetTransactions() (txs types.Transactions, err error) + func (self *TxPool) RemoveTransactions(txs types.Transactions) + func (tp *TxPool) GetTransaction(hash common.Hash) *types.Transaction + type TxRelayBackend interface + Discard func(hashes []common.Hash) + NewHead func(head common.Hash, mined []common.Hash, rollback []common.Hash) + Send func(txs types.Transactions)