mimicry

package
v0.0.0-...-1d67017 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

eth protocol block bodies https://github.com/ethereum/devp2p/blob/master/caps/eth.md#blockbodies-0x06

eth protocol block headers https://github.com/ethereum/devp2p/blob/master/caps/eth.md#blockheaders-0x04

RLPx disconnect https://github.com/ethereum/devp2p/blob/master/rlpx.md#disconnect-0x01

eth protocol get get block headers https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getblockbodies-0x05

eth protocol get get block headers https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getblockheaders-0x03

eth protocol get get block headers https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getblockheaders-0x03

eth protocol get get block headers https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getblockreceipts-0x05

RLPx hello https://github.com/ethereum/devp2p/blob/master/rlpx.md#hello-0x00

eth protocol new pooled transaction hashes https://github.com/ethereum/devp2p/blob/master/caps/eth.md#newpooledtransactionhashes-0x08

RLPx ping https://github.com/ethereum/devp2p/blob/master/rlpx.md#ping-0x02

RLPx pong https://github.com/ethereum/devp2p/blob/master/rlpx.md#pong-0x03

eth protocol get get block headers https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getblockheaders-0x03

eth protocol block receipts https://github.com/ethereum/devp2p/blob/master/caps/eth.md#blockreceipts-0x06

eth protocol status https://github.com/ethereum/devp2p/blob/master/caps/eth.md#status-0x00

eth protocol transactions https://github.com/ethereum/devp2p/blob/master/caps/eth.md#transactions-0x02

Index

Constants

View Source
const (
	HelloCode          = 0x00
	P2PProtocolVersion = 5

	ETHCapName = "eth"
)
View Source
const (
	BlockBodiesCode = 0x16
)
View Source
const (
	BlockHeadersCode = 0x14
)
View Source
const (
	DisconnectCode = 0x01
)
View Source
const (
	GetBlockBodiesCode = 0x15
)
View Source
const (
	GetBlockHeadersCode = 0x13
)
View Source
const (
	GetPooledTransactionsCode = 0x19
)
View Source
const (
	GetReceiptsCode = 0x1f
)
View Source
const (
	NewPooledTransactionHashesCode = 0x18
)
View Source
const (
	PingCode = 0x02
)
View Source
const (
	PongCode = 0x03
)
View Source
const (
	PooledTransactionsCode = 0x1a
)
View Source
const (
	ReceiptsCode = 0x20
)
View Source
const (
	StatusCode = 0x10
)
View Source
const (
	TransactionsCode = 0x12
)

Variables

This section is empty.

Functions

func SupportedEthCaps

func SupportedEthCaps() []p2p.Cap

Types

type BlockBodies

type BlockBodies eth.BlockBodiesPacket66

func (*BlockBodies) Code

func (msg *BlockBodies) Code() int

func (*BlockBodies) ReqID

func (msg *BlockBodies) ReqID() uint64

type BlockHeaders

type BlockHeaders eth.BlockHeadersPacket66

func (*BlockHeaders) Code

func (msg *BlockHeaders) Code() int

func (*BlockHeaders) ReqID

func (msg *BlockHeaders) ReqID() uint64

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, log logrus.FieldLogger, record, name string) (*Client, error)

func (*Client) GetPooledTransactions

func (c *Client) GetPooledTransactions(ctx context.Context, hashes []common.Hash) (*PooledTransactions, error)

func (*Client) OnDisconnect

func (c *Client) OnDisconnect(ctx context.Context, handler func(ctx context.Context, reason *Disconnect) error)

func (*Client) OnHello

func (c *Client) OnHello(ctx context.Context, handler func(ctx context.Context, status *Hello) error)

func (*Client) OnNewPooledTransactionHashes

func (c *Client) OnNewPooledTransactionHashes(ctx context.Context, handler func(ctx context.Context, hashes *NewPooledTransactionHashes) error)

func (*Client) OnNewPooledTransactionHashes68

func (c *Client) OnNewPooledTransactionHashes68(ctx context.Context, handler func(ctx context.Context, hashes *NewPooledTransactionHashes68) error)

func (*Client) OnStatus

func (c *Client) OnStatus(ctx context.Context, handler func(ctx context.Context, status *Status) error)

func (*Client) OnTransactions

func (c *Client) OnTransactions(ctx context.Context, handler func(ctx context.Context, transactions *Transactions) error)

func (*Client) Start

func (c *Client) Start(ctx context.Context, hexkey string) error

func (*Client) Stop

func (c *Client) Stop(ctx context.Context) error

func (*Client) Transactions

func (c *Client) Transactions(ctx context.Context, transactions *Transactions) error

type Disconnect

type Disconnect struct {
	Reason p2p.DiscReason
}

func (*Disconnect) Code

func (h *Disconnect) Code() int

func (*Disconnect) ReqID

func (h *Disconnect) ReqID() uint64

type GetBlockBodies

type GetBlockBodies eth.GetBlockBodiesPacket66

func (*GetBlockBodies) Code

func (msg *GetBlockBodies) Code() int

func (*GetBlockBodies) ReqID

func (msg *GetBlockBodies) ReqID() uint64

type GetBlockHeaders

type GetBlockHeaders eth.GetBlockHeadersPacket66

func (*GetBlockHeaders) Code

func (msg *GetBlockHeaders) Code() int

func (*GetBlockHeaders) ReqID

func (msg *GetBlockHeaders) ReqID() uint64

type GetPooledTransactions

type GetPooledTransactions eth.GetPooledTransactionsPacket66

func (*GetPooledTransactions) Code

func (msg *GetPooledTransactions) Code() int

func (*GetPooledTransactions) ReqID

func (msg *GetPooledTransactions) ReqID() uint64

type GetReceipts

type GetReceipts eth.GetReceiptsPacket66

func (*GetReceipts) Code

func (msg *GetReceipts) Code() int

func (*GetReceipts) ReqID

func (msg *GetReceipts) ReqID() uint64

type Hello

type Hello struct {
	Version    uint64
	Name       string
	Caps       []p2p.Cap
	ListenPort uint64
	ID         []byte // secp256k1 public key

	// Ignore additional fields (for forward compatibility).
	Rest []rlp.RawValue `rlp:"tail"`
}

https://github.com/ethereum/go-ethereum/blob/master/cmd/devp2p/internal/ethtest/types.go

func (*Hello) Code

func (h *Hello) Code() int

func (*Hello) ETHCap

func (h *Hello) ETHCap() *p2p.Cap

func (*Hello) ETHProtocolVersion

func (h *Hello) ETHProtocolVersion() uint

func (*Hello) ReqID

func (h *Hello) ReqID() uint64

func (*Hello) Validate

func (h *Hello) Validate() error

type NewPooledTransactionHashes

type NewPooledTransactionHashes eth.NewPooledTransactionHashesPacket

func (*NewPooledTransactionHashes) Code

func (msg *NewPooledTransactionHashes) Code() int

func (*NewPooledTransactionHashes) ReqID

func (msg *NewPooledTransactionHashes) ReqID() uint64

type NewPooledTransactionHashes68

type NewPooledTransactionHashes68 struct {
	Types        [][1]byte
	Sizes        [][4]byte
	Transactions eth.NewPooledTransactionHashesPacket
}

TODO: eth68 type

func (*NewPooledTransactionHashes68) Code

func (msg *NewPooledTransactionHashes68) Code() int

func (*NewPooledTransactionHashes68) ReqID

func (msg *NewPooledTransactionHashes68) ReqID() uint64

type Ping

type Ping struct{}

func (*Ping) Code

func (h *Ping) Code() int

func (*Ping) ReqID

func (h *Ping) ReqID() uint64

type Pong

type Pong struct{}

func (*Pong) Code

func (h *Pong) Code() int

func (*Pong) ReqID

func (h *Pong) ReqID() uint64

type PooledTransactions

type PooledTransactions eth.PooledTransactionsPacket66

func (*PooledTransactions) Code

func (msg *PooledTransactions) Code() int

func (*PooledTransactions) ReqID

func (msg *PooledTransactions) ReqID() uint64

type Receipts

type Receipts eth.ReceiptsPacket66

func (*Receipts) Code

func (msg *Receipts) Code() int

func (*Receipts) ReqID

func (msg *Receipts) ReqID() uint64

type Status

type Status eth.StatusPacket

func (*Status) Code

func (msg *Status) Code() int

func (*Status) ReqID

func (msg *Status) ReqID() uint64

type Transactions

type Transactions eth.TransactionsPacket

func (*Transactions) Code

func (msg *Transactions) Code() int

func (*Transactions) ReqID

func (msg *Transactions) ReqID() uint64

Jump to

Keyboard shortcuts

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