Documentation ¶
Index ¶
- Variables
- func EnodeToMultiAddr(node *enode.Node) (ma.Multiaddr, error)
- func EnodesToMultiAddrs(nodes []*enode.Node) ([]ma.Multiaddr, error)
- func EnrToEnode(record *enr.Record, verifySig bool) (*enode.Node, error)
- func EnrToString(record *enr.Record) (string, error)
- func MakeENR(ip net.IP, tcpPort uint16, udpPort uint16, priv *crypto.Secp256k1PrivateKey) *enr.Record
- func ParseEnode(v string) (*enode.Node, error)
- func ParseEnr(v string) (*enr.Record, error)
- func ParseEnrAttnets(n *enode.Node) (attnetbits *beacon.AttnetBits, exists bool, err error)
- func ParseEnrBytes(v string) ([]byte, error)
- func ParseEnrEth2Data(n *enode.Node) (data *beacon.Eth2Data, exists bool, err error)
- func ParseEnrOrEnode(v string) (*enode.Node, error)
- func ParseNodeID(v string) (enode.ID, error)
- func ParseNodeIDOrEnrOrEnode(v string) (enode.ID, error)
- func ParsePrivateKey(v string) (*crypto.Secp256k1PrivateKey, error)
- func ParsePubkey(v string) (*ecdsa.PublicKey, error)
- func PeerIDFromPubkey(pubkey *ecdsa.PublicKey) peer.ID
- func PrivKeysEqual(a *crypto.Secp256k1PrivateKey, b *crypto.Secp256k1PrivateKey) (ok bool, err error)
- type AttnetsENREntry
- type Eth2ENREntry
Constants ¶
This section is empty.
Variables ¶
View Source
var EnrEntries = map[string]func() (enr.Entry, func() string){ "secp256k1": func() (enr.Entry, func() string) { res := new(enode.Secp256k1) return res, func() string { var out [64]byte copy(out[:32], res.X.Bytes()) copy(out[32:], res.Y.Bytes()) return hex.EncodeToString(out[:]) } }, "tcp": func() (enr.Entry, func() string) { res := new(enr.TCP) return res, func() string { return fmt.Sprintf("%d", *res) } }, "tcp6": func() (enr.Entry, func() string) { res := new(enr.TCP6) return res, func() string { return fmt.Sprintf("%d", *res) } }, "udp": func() (enr.Entry, func() string) { res := new(enr.UDP) return res, func() string { return fmt.Sprintf("%d", *res) } }, "udp6": func() (enr.Entry, func() string) { res := new(enr.UDP6) return res, func() string { return fmt.Sprintf("%d", *res) } }, "id": func() (enr.Entry, func() string) { res := new(enr.ID) return res, func() string { return string(*res) } }, "ip": func() (enr.Entry, func() string) { res := new(enr.IP) return res, func() string { return ((*net.IP)(res)).String() } }, "ip6": func() (enr.Entry, func() string) { res := new(enr.IPv6) return res, func() string { return ((*net.IP)(res)).String() } }, "eth2": func() (enr.Entry, func() string) { res := new(Eth2ENREntry) return res, func() string { return res.String() } }, "attnets": func() (enr.Entry, func() string) { res := new(AttnetsENREntry) return res, func() string { return res.String() } }, }
Functions ¶
func MakeENR ¶
func MakeENR(ip net.IP, tcpPort uint16, udpPort uint16, priv *crypto.Secp256k1PrivateKey) *enr.Record
Create an ENR. All arguments are optional.
func ParseEnrAttnets ¶
func ParseEnrBytes ¶
func ParseEnrEth2Data ¶
func ParsePrivateKey ¶
func ParsePrivateKey(v string) (*crypto.Secp256k1PrivateKey, error)
func PrivKeysEqual ¶
func PrivKeysEqual(a *crypto.Secp256k1PrivateKey, b *crypto.Secp256k1PrivateKey) (ok bool, err error)
Types ¶
type AttnetsENREntry ¶
type AttnetsENREntry []byte
func NewAttnetsENREntry ¶
func NewAttnetsENREntry(dat *beacon.AttnetBits) AttnetsENREntry
func (AttnetsENREntry) AttnetBits ¶
func (aee AttnetsENREntry) AttnetBits() (beacon.AttnetBits, error)
func (AttnetsENREntry) ENRKey ¶
func (aee AttnetsENREntry) ENRKey() string
func (AttnetsENREntry) String ¶
func (aee AttnetsENREntry) String() string
type Eth2ENREntry ¶
type Eth2ENREntry []byte
func NewEth2DataEntry ¶
func NewEth2DataEntry(dat *beacon.Eth2Data) Eth2ENREntry
func (Eth2ENREntry) ENRKey ¶
func (eee Eth2ENREntry) ENRKey() string
func (Eth2ENREntry) String ¶
func (eee Eth2ENREntry) String() string
Click to show internal directories.
Click to hide internal directories.