Versions in this module Expand all Collapse all v1 v1.0.0 Aug 18, 2018 Changes in this version + var ChtConfirmations = uint64(2048) + var ChtFrequency = uint64(4096) + var ErrNoHeader = errors.New("Header not found") + var ErrNoTrustedCht = errors.New("No trusted canonical hash trie") + var NoOdr = context.Background() + func DeleteTrustedCht(db ethdb.Database) + func GetBlock(ctx context.Context, odr OdrBackend, hash common.Hash, number uint64) (*types.Block, error) + func GetBlockReceipts(ctx context.Context, odr OdrBackend, hash common.Hash, number uint64) (types.Receipts, error) + 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 GetHeaderByNumber(ctx context.Context, odr OdrBackend, number uint64) (*types.Header, error) + 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 WriteTrustedCht(db ethdb.Database, cht TrustedCht) + type BlockRequest struct + Hash common.Hash + Number uint64 + Rlp []byte + func (req *BlockRequest) StoreResult(db ethdb.Database) + type ChtNode struct + Hash common.Hash + Td *big.Int + type ChtRequest struct + BlockNum uint64 + ChtNum uint64 + ChtRoot common.Hash + Header *types.Header + Proof []rlp.RawValue + 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) Stop() + func (self *LightChain) CurrentHeader() *types.Header + func (self *LightChain) GasLimit() *big.Int + 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) LastBlockHash() common.Hash + func (self *LightChain) LockChain() + func (self *LightChain) Odr() OdrBackend + func (self *LightChain) Rollback(chain []common.Hash) + func (self *LightChain) Status() (td *big.Int, currentBlock common.Hash, genesisBlock 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 OdrBackend interface + 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 []rlp.RawValue + func (req *TrieRequest) StoreResult(db ethdb.Database) + type TrustedCht struct + Number uint64 + Root common.Hash + func GetTrustedCht(db ethdb.Database) TrustedCht + 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) SubscribeTxPreEvent(ch chan<- core.TxPreEvent) 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)