Versions in this module Expand all Collapse all v0 v0.0.3 Jul 2, 2021 Changes in this version type LesServer + func (s *LesServer) SetBloomBitsIndexer(bloomIndexer *core.ChainIndexer) + func (s *LesServer) SetContractBackend(backend bind.ContractBackend) type LightEthereum + func (s *LightEthereum) SetContractBackend(backend bind.ContractBackend) v0.0.2 Jul 2, 2021 Changes in this version + const AnnounceMsg + const BlockBodiesMsg + const BlockHeadersMsg + const CodeMsg + const ErrDecode + const ErrExtraStatusMsg + const ErrForkIDRejected + 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 GetHelperTrieProofsMsg + const GetProofsV2Msg + const GetReceiptsMsg + const GetTxStatusMsg + const HelperTrieProofsMsg + const MaxBodyFetch + const MaxCodeFetch + const MaxHeaderFetch + const MaxHelperTrieProofsFetch + const MaxProofsFetch + const MaxReceiptFetch + const MaxTxSend + const MaxTxStatus + const MsgBlockBodies + const MsgBlockHeaders + const MsgCode + const MsgHelperTrieProofs + const MsgProofsV2 + const MsgReceipts + const MsgTxStatus + const NetworkId + const ProofsV2Msg + const ProtocolMaxMsgSize + const ReceiptsMsg + const ResumeMsg + const SendTxV2Msg + const StatusMsg + const StopMsg + const TxStatusMsg + var AdvertiseProtocolVersions = []uint + var ClientProtocolVersions = []uint + var Les3 = map[uint64]RequestType + var ProtocolLengths = map[uint]uint64 + var ServerProtocolVersions = []uint + func NewFuzzerPeer(version int) (p *clientPeer, closer func()) + type BlockRequest light.BlockRequest + func (r *BlockRequest) CanSend(peer *serverPeer) bool + func (r *BlockRequest) GetCost(peer *serverPeer) uint64 + func (r *BlockRequest) Request(reqID uint64, peer *serverPeer) 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 *serverPeer) bool + func (r *BloomRequest) GetCost(peer *serverPeer) uint64 + func (r *BloomRequest) Request(reqID uint64, peer *serverPeer) error + func (r *BloomRequest) Validate(db ethdb.Database, msg *Msg) error + type ChtRequest light.ChtRequest + func (r *ChtRequest) CanSend(peer *serverPeer) bool + func (r *ChtRequest) GetCost(peer *serverPeer) uint64 + func (r *ChtRequest) Request(reqID uint64, peer *serverPeer) error + func (r *ChtRequest) Validate(db ethdb.Database, msg *Msg) error + type CodeData []struct + type CodeReq struct + AccKey []byte + BHash common.Hash + type CodeRequest light.CodeRequest + func (r *CodeRequest) CanSend(peer *serverPeer) bool + func (r *CodeRequest) GetCost(peer *serverPeer) uint64 + func (r *CodeRequest) Request(reqID uint64, peer *serverPeer) error + func (r *CodeRequest) Validate(db ethdb.Database, msg *Msg) error + type Decoder interface + Decode func(val interface{}) error + type GetBlockBodiesPacket struct + Hashes []common.Hash + ReqID uint64 + type GetBlockHeadersData struct + Amount uint64 + Origin hashOrNumber + Reverse bool + Skip uint64 + type GetBlockHeadersPacket struct + Query GetBlockHeadersData + ReqID uint64 + type GetCodePacket struct + ReqID uint64 + Reqs []CodeReq + type GetHelperTrieProofsPacket struct + ReqID uint64 + Reqs []HelperTrieReq + type GetProofsPacket struct + ReqID uint64 + Reqs []ProofReq + type GetReceiptsPacket struct + Hashes []common.Hash + ReqID uint64 + type GetTxStatusPacket struct + Hashes []common.Hash + ReqID uint64 + 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) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) + func (b *LesApiBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error) + func (b *LesApiBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*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) CurrentHeader() *types.Header + func (b *LesApiBackend) Downloader() *downloader.Downloader + func (b *LesApiBackend) Engine() consensus.Engine + func (b *LesApiBackend) ExtRPCEnabled() bool + func (b *LesApiBackend) GetBorBlockLogs(ctx context.Context, hash common.Hash) ([]*types.Log, error) + func (b *LesApiBackend) GetBorBlockReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error) + func (b *LesApiBackend) GetBorBlockTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) + func (b *LesApiBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, ...) (*vm.EVM, func() error, error) + 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) GetRootHash(ctx context.Context, starBlockNr uint64, endBlockNr uint64) (string, error) + func (b *LesApiBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int + func (b *LesApiBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) + func (b *LesApiBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) + func (b *LesApiBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) + func (b *LesApiBackend) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error) + func (b *LesApiBackend) ProtocolVersion() int + func (b *LesApiBackend) RPCGasCap() uint64 + func (b *LesApiBackend) RPCTxFeeCap() float64 + 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) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error) + func (b *LesApiBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error) + func (b *LesApiBackend) StateAtBlock(ctx context.Context, block *types.Block, reexec uint64, base *state.StateDB, ...) (*state.StateDB, error) + func (b *LesApiBackend) StateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (core.Message, vm.BlockContext, *state.StateDB, 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) SubscribePendingLogsEvent(ch chan<- []*types.Log) event.Subscription + func (b *LesApiBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription + func (b *LesApiBackend) SubscribeStateSyncEvent(ch chan<- core.StateSyncEvent) 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) + func (b *LesApiBackend) UnprotectedAllowed() bool + type LesOdr struct + func NewLesOdr(db ethdb.Database, config *light.IndexerConfig, peers *serverPeerSet, ...) *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) RetrieveTxStatus(ctx context.Context, req *light.TxStatusRequest) error + func (odr *LesOdr) SetIndexers(chtIndexer, bloomTrieIndexer, bloomIndexer *core.ChainIndexer) + func (odr *LesOdr) Stop() + type LesOdrRequest interface + CanSend func(*serverPeer) bool + GetCost func(*serverPeer) uint64 + Request func(uint64, *serverPeer) error + Validate func(ethdb.Database, *Msg) error + func LesRequest(req light.OdrRequest) LesOdrRequest + type LesServer struct + func NewLesServer(node *node.Node, e ethBackend, config *ethconfig.Config) (*LesServer, error) + func (s *LesServer) APIs() []rpc.API + func (s *LesServer) Protocols() []p2p.Protocol + func (s *LesServer) Start() error + func (s *LesServer) Stop() error + 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(stack *node.Node, config *ethconfig.Config) (*LightEthereum, error) + func (s *LightEthereum) APIs() []rpc.API + 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() error + func (s *LightEthereum) Stop() error + func (s *LightEthereum) TxPool() *light.TxPool + func (s *LightEthereum) VfluxRequest(n *enode.Node, reqs vflux.Requests) vflux.Replies + 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 PeerInfo struct + Difficulty *big.Int + Head string + Version int + type PrivateDebugAPI struct + func NewPrivateDebugAPI(server *LesServer) *PrivateDebugAPI + func (api *PrivateDebugAPI) FreezeClient(node string) error + type PrivateLightAPI struct + func NewPrivateLightAPI(backend *lesCommons) *PrivateLightAPI + func (api *PrivateLightAPI) GetCheckpoint(index uint64) ([3]string, error) + func (api *PrivateLightAPI) GetCheckpointContractAddress() (string, error) + func (api *PrivateLightAPI) LatestCheckpoint() ([4]string, error) + type PrivateLightServerAPI struct + func NewPrivateLightServerAPI(server *LesServer) *PrivateLightServerAPI + func (api *PrivateLightServerAPI) AddBalance(node string, amount int64) (balance [2]uint64, err error) + func (api *PrivateLightServerAPI) Benchmark(setups []map[string]interface{}, passCount, length int) ([]map[string]interface{}, error) + func (api *PrivateLightServerAPI) ClientInfo(nodes []string) map[enode.ID]map[string]interface{} + func (api *PrivateLightServerAPI) PriorityClientInfo(start, stop enode.ID, maxCount int) map[enode.ID]map[string]interface{} + func (api *PrivateLightServerAPI) ServerInfo() map[string]interface{} + func (api *PrivateLightServerAPI) SetClientParams(nodes []string, params map[string]interface{}) error + func (api *PrivateLightServerAPI) SetConnectedBias(bias time.Duration) error + func (api *PrivateLightServerAPI) SetDefaultParams(params map[string]interface{}) error + type ProofReq struct + AccKey []byte + BHash common.Hash + FromLevel uint + Key []byte + type ReceiptsRequest light.ReceiptsRequest + func (r *ReceiptsRequest) CanSend(peer *serverPeer) bool + func (r *ReceiptsRequest) GetCost(peer *serverPeer) uint64 + func (r *ReceiptsRequest) Request(reqID uint64, peer *serverPeer) error + func (r *ReceiptsRequest) Validate(db ethdb.Database, msg *Msg) error + type RequestCostList []requestCostListItem + type RequestType struct + Handle func(msg Decoder) (serve serveRequestFn, reqID, amount uint64, err error) + InPacketsMeter metrics.Meter + InTrafficMeter metrics.Meter + MaxCount uint64 + Name string + OutPacketsMeter metrics.Meter + OutTrafficMeter metrics.Meter + ServingTimeMeter metrics.Timer + type SendTxPacket struct + ReqID uint64 + Txs []*types.Transaction + type TrieRequest light.TrieRequest + func (r *TrieRequest) CanSend(peer *serverPeer) bool + func (r *TrieRequest) GetCost(peer *serverPeer) uint64 + func (r *TrieRequest) Request(reqID uint64, peer *serverPeer) error + func (r *TrieRequest) Validate(db ethdb.Database, msg *Msg) error + type TxStatusRequest light.TxStatusRequest + func (r *TxStatusRequest) CanSend(peer *serverPeer) bool + func (r *TxStatusRequest) GetCost(peer *serverPeer) uint64 + func (r *TxStatusRequest) Request(reqID uint64, peer *serverPeer) error + func (r *TxStatusRequest) Validate(db ethdb.Database, msg *Msg) error