Versions in this module Expand all Collapse all v1 v1.0.0 Jan 16, 2024 Changes in this version + const BlockBodiesMsg + const BlockHeadersMsg + const ETH67 + const ETH68 + const GetBlockBodiesMsg + const GetBlockHeadersMsg + const GetPooledTransactionsMsg + const GetReceiptsMsg + const NewBlockHashesMsg + const NewBlockMsg + const NewPooledTransactionHashesMsg + const PooledTransactionsMsg + const ProtocolName + const ReceiptsMsg + const StatusMsg + const TransactionsMsg + var ProtocolVersions = []uint + func Handle(backend Backend, peer *Peer) error + func MakeProtocols(backend Backend, network uint64, dnsdisc enode.Iterator) []p2p.Protocol + func ServiceGetBlockBodiesQuery(chain *core.BlockChain, query GetBlockBodiesRequest) []rlp.RawValue + func ServiceGetBlockHeadersQuery(chain *core.BlockChain, query *GetBlockHeadersRequest, peer *Peer) []rlp.RawValue + func ServiceGetReceiptsQuery(chain *core.BlockChain, query GetReceiptsRequest) []rlp.RawValue + func StartENRUpdater(chain *core.BlockChain, ln *enode.LocalNode) + type Backend interface + AcceptTxs func() bool + Chain func() *core.BlockChain + Handle func(peer *Peer, packet Packet) error + PeerInfo func(id enode.ID) interface{} + RunPeer func(peer *Peer, handler Handler) error + TxPool func() TxPool + type BlockBodiesPacket struct + RequestId uint64 + type BlockBodiesRLPPacket struct + RequestId uint64 + type BlockBodiesRLPResponse []rlp.RawValue + type BlockBodiesResponse []*BlockBody + func (*BlockBodiesResponse) Kind() byte + func (*BlockBodiesResponse) Name() string + func (p *BlockBodiesResponse) Unpack() ([][]*types.Transaction, [][]*types.Header, [][]*types.Withdrawal) + type BlockBody struct + Transactions []*types.Transaction + Uncles []*types.Header + Withdrawals []*types.Withdrawal + type BlockHeadersPacket struct + RequestId uint64 + type BlockHeadersRLPPacket struct + RequestId uint64 + type BlockHeadersRLPResponse []rlp.RawValue + type BlockHeadersRequest []*types.Header + func (*BlockHeadersRequest) Kind() byte + func (*BlockHeadersRequest) Name() string + type Decoder interface + Decode func(val interface{}) error + Time func() time.Time + type GetBlockBodiesPacket struct + RequestId uint64 + type GetBlockBodiesRequest []common.Hash + func (*GetBlockBodiesRequest) Kind() byte + func (*GetBlockBodiesRequest) Name() string + type GetBlockHeadersPacket struct + RequestId uint64 + type GetBlockHeadersRequest struct + Amount uint64 + Origin HashOrNumber + Reverse bool + Skip uint64 + func (*GetBlockHeadersRequest) Kind() byte + func (*GetBlockHeadersRequest) Name() string + type GetPooledTransactionsPacket struct + RequestId uint64 + type GetPooledTransactionsRequest []common.Hash + func (*GetPooledTransactionsRequest) Kind() byte + func (*GetPooledTransactionsRequest) Name() string + type GetReceiptsPacket struct + RequestId uint64 + type GetReceiptsRequest []common.Hash + func (*GetReceiptsRequest) Kind() byte + func (*GetReceiptsRequest) Name() string + type Handler func(peer *Peer) error + type HashOrNumber struct + Hash common.Hash + Number uint64 + func (hn *HashOrNumber) DecodeRLP(s *rlp.Stream) error + func (hn *HashOrNumber) EncodeRLP(w io.Writer) error + type NewBlockHashesPacket []struct + func (*NewBlockHashesPacket) Kind() byte + func (*NewBlockHashesPacket) Name() string + func (p *NewBlockHashesPacket) Unpack() ([]common.Hash, []uint64) + type NewBlockPacket struct + Block *types.Block + TD *big.Int + func (*NewBlockPacket) Kind() byte + func (*NewBlockPacket) Name() string + type NewPooledTransactionHashesPacket67 []common.Hash + func (*NewPooledTransactionHashesPacket67) Kind() byte + func (*NewPooledTransactionHashesPacket67) Name() string + type NewPooledTransactionHashesPacket68 struct + Hashes []common.Hash + Sizes []uint32 + Types []byte + func (*NewPooledTransactionHashesPacket68) Kind() byte + func (*NewPooledTransactionHashesPacket68) Name() string + type NodeInfo struct + Config *params.ChainConfig + Difficulty *big.Int + Genesis common.Hash + Head common.Hash + Network uint64 + type Packet interface + Kind func() byte + Name func() string + type Peer struct + func NewPeer(version uint, p *p2p.Peer, rw p2p.MsgReadWriter, txpool TxPool) *Peer + func (p *Peer) AsyncSendNewBlock(block *types.Block, td *big.Int) + func (p *Peer) AsyncSendNewBlockHash(block *types.Block) + func (p *Peer) AsyncSendPooledTransactionHashes(hashes []common.Hash) + func (p *Peer) AsyncSendTransactions(hashes []common.Hash) + func (p *Peer) Close() + func (p *Peer) Handshake(network uint64, td *big.Int, head common.Hash, genesis common.Hash, ...) error + func (p *Peer) Head() (hash common.Hash, td *big.Int) + func (p *Peer) ID() string + func (p *Peer) KnownBlock(hash common.Hash) bool + func (p *Peer) KnownTransaction(hash common.Hash) bool + func (p *Peer) ReplyBlockBodiesRLP(id uint64, bodies []rlp.RawValue) error + func (p *Peer) ReplyBlockHeadersRLP(id uint64, headers []rlp.RawValue) error + func (p *Peer) ReplyPooledTransactionsRLP(id uint64, hashes []common.Hash, txs []rlp.RawValue) error + func (p *Peer) ReplyReceiptsRLP(id uint64, receipts []rlp.RawValue) error + func (p *Peer) RequestBodies(hashes []common.Hash, sink chan *Response) (*Request, error) + func (p *Peer) RequestHeadersByHash(origin common.Hash, amount int, skip int, reverse bool, sink chan *Response) (*Request, error) + func (p *Peer) RequestHeadersByNumber(origin uint64, amount int, skip int, reverse bool, sink chan *Response) (*Request, error) + func (p *Peer) RequestOneHeader(hash common.Hash, sink chan *Response) (*Request, error) + func (p *Peer) RequestReceipts(hashes []common.Hash, sink chan *Response) (*Request, error) + func (p *Peer) RequestTxs(hashes []common.Hash) error + func (p *Peer) SendNewBlock(block *types.Block, td *big.Int) error + func (p *Peer) SendNewBlockHashes(hashes []common.Hash, numbers []uint64) error + func (p *Peer) SendTransactions(txs types.Transactions) error + func (p *Peer) SetHead(hash common.Hash, td *big.Int) + func (p *Peer) Version() uint + type PooledTransactionsPacket struct + RequestId uint64 + type PooledTransactionsRLPPacket struct + RequestId uint64 + type PooledTransactionsRLPResponse []rlp.RawValue + type PooledTransactionsResponse []*types.Transaction + func (*PooledTransactionsResponse) Kind() byte + func (*PooledTransactionsResponse) Name() string + type ReceiptsPacket struct + RequestId uint64 + type ReceiptsRLPPacket struct + RequestId uint64 + type ReceiptsRLPResponse []rlp.RawValue + type ReceiptsResponse [][]*types.Receipt + func (*ReceiptsResponse) Kind() byte + func (*ReceiptsResponse) Name() string + type Request struct + Peer string + Sent time.Time + func (r *Request) Close() error + type Response struct + Done chan error + Meta interface{} + Req *Request + Res interface{} + Time time.Duration + type StatusPacket struct + ForkID forkid.ID + Genesis common.Hash + Head common.Hash + NetworkID uint64 + ProtocolVersion uint32 + TD *big.Int + func (*StatusPacket) Kind() byte + func (*StatusPacket) Name() string + type TransactionsPacket []*types.Transaction + func (*TransactionsPacket) Kind() byte + func (*TransactionsPacket) Name() string + type TxPool interface + Get func(hash common.Hash) *types.Transaction