enode

package
v0.0.0-...-8d666af Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

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