Versions in this module Expand all Collapse all v1 v1.0.0 Aug 18, 2018 Changes in this version + const AnnounceMsg + const BlockBodiesMsg + const BlockHeadersMsg + const CodeMsg + const ErrDecode + const ErrExtraStatusMsg + const ErrGenesisBlockMismatch + const ErrHandshakeMissingKey + const ErrInvalidMsgCode + const ErrInvalidResponse + 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 GetProofsMsg + const GetReceiptsMsg + const HeaderProofsMsg + const MaxBodyFetch + const MaxCodeFetch + const MaxHeaderFetch + const MaxHeaderProofsFetch + const MaxProofsFetch + const MaxReceiptFetch + const MaxTxSend + const MsgBlockBodies + const MsgCode + const MsgHeaderProofs + const MsgProofs + const MsgReceipts + const NetworkId + const ProofsMsg + const ProtocolMaxMsgSize + const ReceiptsMsg + const SendTxMsg + const StatusMsg + var ErrNoPeers = errors.New("no suitable peers available") + var ProtocolLengths = []uint64 + var ProtocolVersions = []uint + type BlockChain interface + CurrentHeader func() *types.Header + Genesis func() *types.Block + GetBlockHashesFromHash func(hash common.Hash, max uint64) []common.Hash + GetHeader func(hash common.Hash, number uint64) *types.Header + GetHeaderByHash func(hash common.Hash) *types.Header + GetHeaderByNumber func(number uint64) *types.Header + GetTdByHash func(hash common.Hash) *big.Int + HasHeader func(hash common.Hash, number uint64) bool + InsertHeaderChain func(chain []*types.Header, checkFreq int) (int, error) + LastBlockHash func() common.Hash + Rollback func(chain []common.Hash) + Status func() (td *big.Int, currentBlock common.Hash, genesisBlock common.Hash) + 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 ChtReq struct + BlockNum uint64 + ChtNum uint64 + FromLevel uint64 + 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 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) 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, blockHash common.Hash) (types.Receipts, error) + func (b *LesApiBackend) GetTd(blockHash common.Hash) *big.Int + 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) 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) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription + func (b *LesApiBackend) SubscribeTxPreEvent(ch chan<- core.TxPreEvent) 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, retriever *retrieveManager) *LesOdr + func (odr *LesOdr) Database() ethdb.Database + func (odr *LesOdr) Stop() + func (self *LesOdr) Retrieve(ctx context.Context, req light.OdrRequest) (err error) + 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.Sagecity, config *eth.Config) (*LesServer, error) + func (s *LesServer) Protocols() []p2p.Protocol + 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 LightSagecity struct + ApiBackend *LesApiBackend + func New(ctx *node.ServiceContext, config *eth.Config) (*LightSagecity, error) + func (s *LightSagecity) APIs() []rpc.API + func (s *LightSagecity) BlockChain() *light.LightChain + func (s *LightSagecity) Downloader() *downloader.Downloader + func (s *LightSagecity) Engine() consensus.Engine + func (s *LightSagecity) EventMux() *event.TypeMux + func (s *LightSagecity) LesVersion() int + func (s *LightSagecity) Protocols() []p2p.Protocol + func (s *LightSagecity) ResetWithGenesisBlock(gb *types.Block) + func (s *LightSagecity) Start(srvr *p2p.Server) error + func (s *LightSagecity) Stop() error + func (s *LightSagecity) TxPool() *light.TxPool + type Msg struct + MsgType int + Obj interface{} + ReqID uint64 + type ProofReq struct + AccKey []byte + BHash common.Hash + FromLevel uint + Key []byte + type ProtocolManager struct + SubProtocols []p2p.Protocol + func NewProtocolManager(chainConfig *params.ChainConfig, lightSync bool, networkId uint64, ...) (*ProtocolManager, error) + func (pm *ProtocolManager) Start() + func (pm *ProtocolManager) Stop() + func (self *ProtocolManager) NodeInfo() *eth.EthNodeInfo + 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