enode

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodeIDToPubKey

func NodeIDToPubKey(buf []byte) (*ecdsa.PublicKey, error)

NodeIDToPubKey returns the public key of the enode ID

Types

type Enode

type Enode struct {
	ID  ID
	TCP uint16
	UDP uint16
	IP  net.IP
}

Enode is the URL scheme description of an ethereum node.

func ParseURL

func ParseURL(rawurl string) (*Enode, error)

ParseURL parses an enode address

func (*Enode) PublicKey

func (n *Enode) PublicKey() (*ecdsa.PublicKey, error)

PublicKey returns the public key of the enode

func (*Enode) String

func (n *Enode) String() string

func (*Enode) TCPAddr

func (n *Enode) TCPAddr() net.TCPAddr

TCPAddr returns the TCP address

type ID

type ID [nodeIDBytes]byte

ID is the unique identifier of each node.

func PubkeyToEnode

func PubkeyToEnode(pub *ecdsa.PublicKey) ID

PubkeyToEnode converts a public key to an enode

func (ID) String

func (i ID) String() string

Jump to

Keyboard shortcuts

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