ethp2p

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DNSResolveHostname

func DNSResolveHostname(ctx context.Context, n *enode.Node) (*enode.Node, error)

DNSResolveHostname updates the given node from its DNS hostname. This is used to resolve static dial targets.

Types

type Client

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

Client represents an individual connection with a remote P2P Peer. This was adapted from go-ethereum/cmd/devp2p/internal/ethtest.

func Dial

func Dial(ctx context.Context, key *ecdsa.PrivateKey, dest *enode.Node) (Client, *eth.StatusPacket, error)

Dial dials the provided destination and performs required handshakes and exchanges using the given private key returning a Client to and the status of that instance.

func (Client) AccountRange

func (c Client) AccountRange(ctx context.Context, root, origin common.Hash, bytes uint64) (*snap.AccountRangePacket, error)

func (Client) AllAccountRanges added in v0.17.0

func (c Client) AllAccountRanges(ctx context.Context, blockHash common.Hash, batchBytes uint64) ([]*snap.AccountRangePacket, error)

AllAccountRanges returns all account ranges starting of the provided block hash (not state root).

func (Client) Disconnect

func (c Client) Disconnect() error

func (Client) HeadersDownFrom

func (c Client) HeadersDownFrom(ctx context.Context, blockHash common.Hash, count uint64) ([]*types.Header, error)

HeadersDownFrom requests a sequence of block headers starting from the specified head hash, going downwards. Results are ordered by height descending.

func (Client) SnapshotRange

func (c Client) SnapshotRange(ctx context.Context, blockHash common.Hash, max uint64) (int, error)

SnapshotRange returns the number of snapshots available down from the provided block hash.

Jump to

Keyboard shortcuts

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