Versions in this module Expand all Collapse all v1 v1.0.1 Mar 1, 2020 Changes in this version + const AnnounceMsg + const BlockBodiesMsg + const BlockHeadersMsg + const CodeMsg + const ErrDecode + const ErrExtraStatusMsg + const ErrGenesisBlockMismatch + const ErrInvalidMsgCode + const ErrInvalidResponse + const ErrMissingKey + const ErrMsgTooLarge + const ErrNetworkIdMismatch + const ErrNoStatusMsg + const ErrProtocolVersionMismatch + const ErrRequestRejected + const ErrSuspendedPeer + const ErrTooManyTimeouts + const ErrUnexpectedResponse + const ErrUselessPeer + const GetBlockBodiesMsg + const GetBlockHeadersMsg + const GetCodeMsg + const GetHeaderProofsMsg + const GetHelperTrieProofsMsg + const GetProofsV1Msg + const GetProofsV2Msg + const GetReceiptsMsg + const GetTxStatusMsg + const HeaderProofsMsg + const HelperTrieProofsMsg + const MaxBodyFetch + const MaxCodeFetch + const MaxHeaderFetch + const MaxHelperTrieProofsFetch + const MaxProofsFetch + const MaxReceiptFetch + const MaxTxSend + const MaxTxStatus + const MsgBlockBodies + const MsgCode + const MsgHeaderProofs + const MsgHelperTrieProofs + const MsgProofsV1 + const MsgProofsV2 + const MsgReceipts + const NetworkId + const ProofsV1Msg + const ProofsV2Msg + const ProtocolMaxMsgSize + const ReceiptsMsg + const SendTxMsg + const SendTxV2Msg + const StatusMsg + const TxStatusMsg + var AdvertiseProtocolVersions = []uint + var ClientProtocolVersions = []uint + var ProtocolLengths = map[uint]uint64 + var ServerProtocolVersions = []uint + type BlockChain interface + Config func() *params.ChainConfig + CurrentHeader func() *types.Header + Genesis func() *types.Block + GetAncestor func(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) + GetHeader func(hash common.Hash, number uint64) *types.Header + GetHeaderByHash func(hash common.Hash) *types.Header + GetHeaderByNumber func(number uint64) *types.Header + GetTd func(hash common.Hash, number uint64) *big.Int + HasHeader func(hash common.Hash, number uint64) bool + InsertHeaderChain func(chain []*types.Header, checkFreq int) (int, error) + Rollback func(chain []common.Hash) + State func() (*state.StateDB, error) + SubscribeChainHeadEvent func(ch chan<- core.ChainHeadEvent) event.Subscription + type BlockRequest light.BlockRequest + func (r *BlockRequest) CanSend(peer *peer) bool + func (r *BlockRequest) GetCost(peer *peer) uint64 + func (r *BlockRequest) Request(reqID uint64, peer *peer) error + func (r *BlockRequest) Validate(db ethdb.Database, msg *Msg) error + type BloomReq struct + BitIdx uint64 + BloomTrieNum uint64 + FromLevel uint64 + SectionIndex uint64 + type BloomRequest light.BloomRequest + func (r *BloomRequest) CanSend(peer *peer) bool + func (r *BloomRequest) GetCost(peer *peer) uint64 + func (r *BloomRequest) Request(reqID uint64, peer *peer) error + func (r *BloomRequest) Validate(db ethdb.Database, msg *Msg) error + type ChtReq struct + BlockNum uint64 + ChtNum uint64 + FromLevel uint + type ChtRequest light.ChtRequest + func (r *ChtRequest) CanSend(peer *peer) bool + func (r *ChtRequest) GetCost(peer *peer) uint64 + func (r *ChtRequest) Request(reqID uint64, peer *peer) error + func (r *ChtRequest) Validate(db ethdb.Database, msg *Msg) error + type ChtResp struct + Header *types.Header + Proof []rlp.RawValue + type CodeData []struct + type CodeReq struct + AccKey []byte + BHash common.Hash + type CodeRequest light.CodeRequest + func (r *CodeRequest) CanSend(peer *peer) bool + func (r *CodeRequest) GetCost(peer *peer) uint64 + func (r *CodeRequest) Request(reqID uint64, peer *peer) error + func (r *CodeRequest) Validate(db ethdb.Database, msg *Msg) error + type HelperTrieReq struct + AuxReq uint + FromLevel uint + Key []byte + TrieIdx uint64 + Type uint + type HelperTrieResps struct + AuxData [][]byte + Proofs light.NodeList + type LesApiBackend struct + func (b *LesApiBackend) AccountManager() *accounts.Manager + func (b *LesApiBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error) + func (b *LesApiBackend) BloomStatus() (uint64, uint64) + func (b *LesApiBackend) ChainConfig() *params.ChainConfig + func (b *LesApiBackend) ChainDb() ethdb.Database + func (b *LesApiBackend) CurrentBlock() *types.Block + func (b *LesApiBackend) Downloader() *downloader.Downloader + func (b *LesApiBackend) EventMux() *event.TypeMux + func (b *LesApiBackend) GetBlock(ctx context.Context, blockHash common.Hash) (*types.Block, error) + func (b *LesApiBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, ...) (*vm.EVM, func() error, error) + func (b *LesApiBackend) GetHostEnodeURL() string + func (b *LesApiBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) + func (b *LesApiBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) + func (b *LesApiBackend) GetPoolTransaction(txHash common.Hash) *types.Transaction + func (b *LesApiBackend) GetPoolTransactions() (types.Transactions, error) + func (b *LesApiBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) + func (b *LesApiBackend) GetTd(hash common.Hash) *big.Int + func (b *LesApiBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) + func (b *LesApiBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error) + func (b *LesApiBackend) ProtocolVersion() int + func (b *LesApiBackend) RemoveTx(txHash common.Hash) + func (b *LesApiBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error + func (b *LesApiBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession) + func (b *LesApiBackend) SetHead(number uint64) + func (b *LesApiBackend) SignByNode(hash []byte) ([]byte, error) + func (b *LesApiBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error) + func (b *LesApiBackend) Stats() (pending int, queued int) + func (b *LesApiBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription + func (b *LesApiBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription + func (b *LesApiBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription + func (b *LesApiBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription + func (b *LesApiBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription + func (b *LesApiBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription + func (b *LesApiBackend) SuggestPrice(ctx context.Context) (*big.Int, error) + func (b *LesApiBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) + type LesOdr struct + func NewLesOdr(db ethdb.Database, config *light.IndexerConfig, retriever *retrieveManager) *LesOdr + func (odr *LesOdr) BloomIndexer() *core.ChainIndexer + func (odr *LesOdr) BloomTrieIndexer() *core.ChainIndexer + func (odr *LesOdr) ChtIndexer() *core.ChainIndexer + func (odr *LesOdr) Database() ethdb.Database + func (odr *LesOdr) IndexerConfig() *light.IndexerConfig + func (odr *LesOdr) Retrieve(ctx context.Context, req light.OdrRequest) (err error) + func (odr *LesOdr) SetIndexers(chtIndexer, bloomTrieIndexer, bloomIndexer *core.ChainIndexer) + func (odr *LesOdr) Stop() + type LesOdrRequest interface + CanSend func(*peer) bool + GetCost func(*peer) uint64 + Request func(uint64, *peer) error + Validate func(ethdb.Database, *Msg) error + func LesRequest(req light.OdrRequest) LesOdrRequest + type LesServer struct + func NewLesServer(eth *eth.Ethereum, config *eth.Config) (*LesServer, error) + func (s *LesServer) Protocols() []p2p.Protocol + func (s *LesServer) SetBloomBitsIndexer(bloomIndexer *core.ChainIndexer) + func (s *LesServer) Start(srvr *p2p.Server) + func (s *LesServer) Stop() + type LesTxRelay struct + func NewLesTxRelay(ps *peerSet, reqDist *requestDistributor) *LesTxRelay + func (self *LesTxRelay) Discard(hashes []common.Hash) + func (self *LesTxRelay) NewHead(head common.Hash, mined []common.Hash, rollback []common.Hash) + func (self *LesTxRelay) Send(txs types.Transactions) + type LightDummyAPI struct + func (s *LightDummyAPI) Coinbase() (common.Address, error) + func (s *LightDummyAPI) Etherbase() (common.Address, error) + func (s *LightDummyAPI) Hashrate() hexutil.Uint + func (s *LightDummyAPI) Mining() bool + type LightEthereum struct + ApiBackend *LesApiBackend + func New(ctx *node.ServiceContext, config *eth.Config) (*LightEthereum, error) + func (s *LightEthereum) APIs() []rpc.API + func (s *LightEthereum) AccountManager() *accounts.Manager + func (s *LightEthereum) BlockChain() *light.LightChain + func (s *LightEthereum) Downloader() *downloader.Downloader + func (s *LightEthereum) Engine() consensus.Engine + func (s *LightEthereum) EventMux() *event.TypeMux + func (s *LightEthereum) LesVersion() int + func (s *LightEthereum) Protocols() []p2p.Protocol + func (s *LightEthereum) ResetWithGenesisBlock(gb *types.Block) + func (s *LightEthereum) Start(srvr *p2p.Server) error + func (s *LightEthereum) Stop() error + func (s *LightEthereum) TxPool() *light.TxPool + type Msg struct + MsgType int + Obj interface{} + ReqID uint64 + type NodeInfo struct + CHT params.TrustedCheckpoint + Config *params.ChainConfig + Difficulty *big.Int + Genesis common.Hash + Head common.Hash + Network uint64 + type ProofReq struct + AccKey []byte + BHash common.Hash + FromLevel uint + Key []byte + type ProtocolManager struct + func NewProtocolManager(chainConfig *params.ChainConfig, indexerConfig *light.IndexerConfig, ...) (*ProtocolManager, error) + func (pm *ProtocolManager) Start(maxPeers int) + func (pm *ProtocolManager) Stop() + type ReceiptsRequest light.ReceiptsRequest + func (r *ReceiptsRequest) CanSend(peer *peer) bool + func (r *ReceiptsRequest) GetCost(peer *peer) uint64 + func (r *ReceiptsRequest) Request(reqID uint64, peer *peer) error + func (r *ReceiptsRequest) Validate(db ethdb.Database, msg *Msg) error + type RequestCostList []struct + type TrieRequest light.TrieRequest + func (r *TrieRequest) CanSend(peer *peer) bool + func (r *TrieRequest) GetCost(peer *peer) uint64 + func (r *TrieRequest) Request(reqID uint64, peer *peer) error + func (r *TrieRequest) Validate(db ethdb.Database, msg *Msg) error