packet

package
v0.0.0-...-041ef7d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusMsg                     = 0x00
	NewBlockHashesMsg             = 0x01
	TransactionsMsg               = 0x02
	GetBlockHeadersMsg            = 0x03
	BlockHeadersMsg               = 0x04
	GetBlockBodiesMsg             = 0x05
	BlockBodiesMsg                = 0x06
	NewBlockMsg                   = 0x07
	GetNodeDataMsg                = 0x0d
	NodeDataMsg                   = 0x0e
	GetReceiptsMsg                = 0x0f
	ReceiptsMsg                   = 0x10
	NewPooledTransactionHashesMsg = 0x08
	GetPooledTransactionsMsg      = 0x09
	PooledTransactionsMsg         = 0x0a
	UpgradeStatusMsg              = 0x0b
)
View Source
const MaxMessageSize = (10 * 1024 * 1024) // 10MB

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockBodiesPacket

type BlockBodiesPacket []*BlockBody

type BlockBodiesPacket66

type BlockBodiesPacket66 struct {
	RequestId uint64
	BlockBodiesPacket
}

type BlockBody

type BlockBody struct {
	Transactions []*types.Transaction
	Uncles       []*types.Header
}

type BlockHeadersPacket

type BlockHeadersPacket []*types.Header

type BlockHeadersPacket66

type BlockHeadersPacket66 struct {
	RequestId uint64
	BlockHeadersPacket
}

type GetBlockBodiesPacket

type GetBlockBodiesPacket []common.Hash

type GetBlockBodiesPacket66

type GetBlockBodiesPacket66 struct {
	RequestId uint64
	GetBlockBodiesPacket
}

type GetBlockHeadersPacket

type GetBlockHeadersPacket struct {
	Origin  HashOrNumber
	Amount  uint64
	Skip    uint64
	Reverse bool
}

type GetBlockHeadersPacket66

type GetBlockHeadersPacket66 struct {
	RequestId uint64
	*GetBlockHeadersPacket
}

type GetPooledTransactionsPacket

type GetPooledTransactionsPacket []common.Hash

type GetPooledTransactionsPacket66

type GetPooledTransactionsPacket66 struct {
	RequestId uint64
	GetPooledTransactionsPacket
}

type HashOrNumber

type HashOrNumber struct {
	Hash   common.Hash
	Number uint64
}

other

func (*HashOrNumber) DecodeRLP

func (hn *HashOrNumber) DecodeRLP(s *rlp.Stream) error

func (*HashOrNumber) EncodeRLP

func (hn *HashOrNumber) EncodeRLP(w io.Writer) error

type NewBlockHashesPacket

type NewBlockHashesPacket []struct {
	Hash   common.Hash
	Number uint64
}

type NewBlockPacket

type NewBlockPacket struct {
	Block *types.Block
	TD    *big.Int
}

block

type NewPooledTransactionHashesPacket

type NewPooledTransactionHashesPacket []common.Hash

type PooledTransactionsPacket

type PooledTransactionsPacket []*types.Transaction

type PooledTransactionsPacket66

type PooledTransactionsPacket66 struct {
	RequestId uint64
	PooledTransactionsPacket
}

type StatusPacket

type StatusPacket struct {
	ProtocolVersion uint32
	NetworkID       uint64
	TD              *big.Int
	Head            common.Hash
	Genesis         common.Hash
	ForkID          forkid.ID
}

status

type TransactionsPacket

type TransactionsPacket []*types.Transaction

transaction

type UpgradeStatusExtension

type UpgradeStatusExtension struct {
	DisablePeerTxBroadcast bool
}

func (*UpgradeStatusExtension) Encode

func (e *UpgradeStatusExtension) Encode() (*rlp.RawValue, error)

type UpgradeStatusPacket

type UpgradeStatusPacket struct {
	Extension *rlp.RawValue `rlp:"nil"`
}

func (*UpgradeStatusPacket) GetExtension

func (p *UpgradeStatusPacket) GetExtension() (*UpgradeStatusExtension, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL