Versions in this module Expand all Collapse all v1 v1.20.0 Jul 20, 2024 Changes in this version + const ENRRequestPacket + const ENRResponsePacket + const FindnodePacket + const MaxNeighbors + const NeighborsPacket + const PingPacket + const PongPacket + var ErrBadHash = errors.New("bad hash") + var ErrBadPoint = errors.New("invalid curve point") + var ErrPacketTooSmall = errors.New("too small") + func Decode(input []byte) (Packet, Pubkey, []byte, error) + func DecodePubkey(curve elliptic.Curve, e Pubkey) (*ecdsa.PublicKey, error) + func Encode(priv *ecdsa.PrivateKey, req Packet) (packet, hash []byte, err error) + func Expired(ts uint64) bool + type ENRRequest struct + Expiration uint64 + Rest []rlp.RawValue + func (req *ENRRequest) Kind() byte + func (req *ENRRequest) Name() string + type ENRResponse struct + Record enr.Record + ReplyTok []byte + Rest []rlp.RawValue + func (req *ENRResponse) Kind() byte + func (req *ENRResponse) Name() string + type Endpoint struct + IP net.IP + TCP uint16 + UDP uint16 + func NewEndpoint(addr *net.UDPAddr, tcpPort uint16) Endpoint + type Findnode struct + Expiration uint64 + Rest []rlp.RawValue + Target Pubkey + func (req *Findnode) Kind() byte + func (req *Findnode) Name() string + type Neighbors struct + Expiration uint64 + Nodes []Node + Rest []rlp.RawValue + func (req *Neighbors) Kind() byte + func (req *Neighbors) Name() string + type Node struct + ID Pubkey + IP net.IP + TCP uint16 + UDP uint16 + type Packet interface + Kind func() byte + Name func() string + type Ping struct + ENRSeq uint64 + Expiration uint64 + From Endpoint + Rest []rlp.RawValue + To Endpoint + Version uint + func (req *Ping) Kind() byte + func (req *Ping) Name() string + type Pong struct + ENRSeq uint64 + Expiration uint64 + ReplyTok []byte + Rest []rlp.RawValue + To Endpoint + func (req *Pong) Kind() byte + func (req *Pong) Name() string + type Pubkey [64]byte + func EncodePubkey(key *ecdsa.PublicKey) Pubkey + func (e Pubkey) ID() enode.ID