Versions in this module Expand all Collapse all v1 v1.2.0 Jul 8, 2022 Changes in this version + const BlockBodiesMsg + const BlockHeadersMsg + const ETH65 + const ETH66 + const ETH67 + const GetBlockBodiesMsg + const GetBlockHeadersMsg + const GetNodeDataMsg + const GetPooledTransactionsMsg + const GetReceiptsMsg + const NewBlockHashesMsg + const NewBlockMsg + const NewPooledTransactionHashesMsg + const NodeDataMsg + const PooledTransactionsMsg + const ProtocolName + const ReceiptsMsg + const StatusMsg + const TransactionsMsg + const UpgradeStatusMsg + var ProtocolVersions = []uint + func Handle(backend Backend, peer *Peer) error + func MakeProtocols(backend Backend, network uint64, dnsdisc enode.Iterator) []p2p.Protocol + 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 + StateBloom func() *trie.SyncBloom + TxPool func() TxPool + type BlockBodiesPacket []*BlockBody + func (*BlockBodiesPacket) Kind() byte + func (*BlockBodiesPacket) Name() string + func (p *BlockBodiesPacket) Unpack() ([][]*types.Transaction, [][]*types.Header) + type BlockBodiesPacket66 struct + RequestId uint64 + type BlockBodiesRLPPacket []rlp.RawValue + type BlockBodiesRLPPacket66 struct + RequestId uint64 + type BlockBody struct + Transactions []*types.Transaction + Uncles []*types.Header + type BlockHeadersPacket []*types.Header + func (*BlockHeadersPacket) Kind() byte + func (*BlockHeadersPacket) Name() string + type BlockHeadersPacket66 struct + RequestId uint64 + type Decoder interface + Decode func(val interface{}) error + Time func() time.Time + type GetBlockBodiesPacket []common.Hash + func (*GetBlockBodiesPacket) Kind() byte + func (*GetBlockBodiesPacket) Name() string + type GetBlockBodiesPacket66 struct + RequestId uint64 + type GetBlockHeadersPacket struct + Amount uint64 + Origin HashOrNumber + Reverse bool + Skip uint64 + func (*GetBlockHeadersPacket) Kind() byte + func (*GetBlockHeadersPacket) Name() string + type GetBlockHeadersPacket66 struct + RequestId uint64 + type GetNodeDataPacket []common.Hash + func (*GetNodeDataPacket) Kind() byte + func (*GetNodeDataPacket) Name() string + type GetNodeDataPacket66 struct + RequestId uint64 + type GetPooledTransactionsPacket []common.Hash + func (*GetPooledTransactionsPacket) Kind() byte + func (*GetPooledTransactionsPacket) Name() string + type GetPooledTransactionsPacket66 struct + RequestId uint64 + type GetReceiptsPacket []common.Hash + func (*GetReceiptsPacket) Kind() byte + func (*GetReceiptsPacket) Name() string + type GetReceiptsPacket66 struct + RequestId uint64 + 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 NewPooledTransactionHashesPacket []common.Hash + func (*NewPooledTransactionHashesPacket) Kind() byte + func (*NewPooledTransactionHashesPacket) Name() string + type NodeDataPacket [][]byte + func (*NodeDataPacket) Kind() byte + func (*NodeDataPacket) Name() string + type NodeDataPacket66 struct + RequestId uint64 + 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) CloseTxBroadcast() + func (p *Peer) ExpectRequestHeadersByNumber(origin uint64, amount int, skip int, reverse bool) error + 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) ReplyBlockHeaders(id uint64, headers []*types.Header) error + func (p *Peer) ReplyNodeData(id uint64, data [][]byte) 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) error + func (p *Peer) RequestHeadersByHash(origin common.Hash, amount int, skip int, reverse bool) error + func (p *Peer) RequestHeadersByNumber(origin uint64, amount int, skip int, reverse bool) error + func (p *Peer) RequestNodeData(hashes []common.Hash) error + func (p *Peer) RequestOneHeader(hash common.Hash) error + func (p *Peer) RequestReceipts(hashes []common.Hash) error + func (p *Peer) RequestTxs(hashes []common.Hash) error + func (p *Peer) SendBlockBodiesRLP(bodies []rlp.RawValue) error + func (p *Peer) SendBlockHeaders(headers []*types.Header) 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) SendNodeData(data [][]byte) error + func (p *Peer) SendPooledTransactionsRLP(hashes []common.Hash, txs []rlp.RawValue) error + func (p *Peer) SendReceiptsRLP(receipts []rlp.RawValue) 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 []*types.Transaction + func (*PooledTransactionsPacket) Kind() byte + func (*PooledTransactionsPacket) Name() string + type PooledTransactionsPacket66 struct + RequestId uint64 + type PooledTransactionsRLPPacket []rlp.RawValue + type PooledTransactionsRLPPacket66 struct + RequestId uint64 + type ReceiptsPacket [][]*types.Receipt + func (*ReceiptsPacket) Kind() byte + func (*ReceiptsPacket) Name() string + type ReceiptsPacket66 struct + RequestId uint64 + type ReceiptsRLPPacket []rlp.RawValue + type ReceiptsRLPPacket66 struct + RequestId uint64 + 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 + type UpgradeStatusExtension struct + DisablePeerTxBroadcast bool + func (e *UpgradeStatusExtension) Encode() (*rlp.RawValue, error) + type UpgradeStatusPacket struct + Extension *rlp.RawValue + func (*UpgradeStatusPacket) Kind() byte + func (*UpgradeStatusPacket) Name() string + func (p *UpgradeStatusPacket) GetExtension() (*UpgradeStatusExtension, error)