enr

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MultiaddrENRField = "multiaddrs"

MultiaddrENRField is the name of the ENR field that will contain multiaddresses that cannot be described using the already available ENR fields (i.e. in the case of websocket connections)

View Source
const ShardingBitVectorEnrField = "rsv"
View Source
const ShardingIndicesListEnrField = "rs"
View Source
const WakuENRField = "waku2"

WakuENRField is the name of the ENR field that contains information about which protocols are supported by the node

Variables

This section is empty.

Functions

func ContainsRelayShard added in v0.7.0

func ContainsRelayShard(record *enr.Record, topic protocol.StaticShardingPubsubTopic) bool

func ContainsShard

func ContainsShard(record *enr.Record, cluster uint16, index uint16) bool

func ContainsShardTopic

func ContainsShardTopic(record *enr.Record, topic string) bool

func ContainsShardWithWakuTopic added in v0.9.0

func ContainsShardWithWakuTopic(record *enr.Record, topic protocol.WakuPubSubTopic) bool

func EnodeToPeerInfo

func EnodeToPeerInfo(node *enode.Node) (*peer.AddrInfo, error)

EnodeToPeerInfo extracts the peer ID and multiaddresses defined in an ENR

func Multiaddress

func Multiaddress(node *enode.Node) (peer.ID, []multiaddr.Multiaddr, error)

Multiaddress is used to extract all the multiaddresses that are part of a ENR record

func NewLocalnode

func NewLocalnode(priv *ecdsa.PrivateKey) (*enode.LocalNode, error)

func RelayShardList added in v0.9.0

func RelayShardList(record *enr.Record) (*protocol.RelayShards, error)

func RelaySharding

func RelaySharding(record *enr.Record) (*protocol.RelayShards, error)

func RelayShardingBitVector

func RelayShardingBitVector(record *enr.Record) (*protocol.RelayShards, error)

func Update

func Update(localnode *enode.LocalNode, enrOptions ...ENROption) error

Types

type ENROption

type ENROption func(*enode.LocalNode) error

func WithCapabilities

func WithCapabilities(lightpush, filter, store, relay bool) ENROption

func WithIP

func WithIP(ipAddr *net.TCPAddr) ENROption

func WithMultiaddress

func WithMultiaddress(multiaddrs ...multiaddr.Multiaddr) ENROption

func WithUDPPort

func WithUDPPort(udpPort uint) ENROption

func WithWakuBitfield

func WithWakuBitfield(flags WakuEnrBitfield) ENROption

func WithWakuRelayShardList added in v0.9.0

func WithWakuRelayShardList(rs protocol.RelayShards) ENROption

func WithWakuRelaySharding added in v0.7.0

func WithWakuRelaySharding(rs protocol.RelayShards) ENROption

func WithWakuRelayShardingBitVector

func WithWakuRelayShardingBitVector(rs protocol.RelayShards) ENROption

func WithWakuRelayShardingTopics added in v0.7.0

func WithWakuRelayShardingTopics(topics ...string) ENROption

type WakuEnrBitfield

type WakuEnrBitfield = uint8

WakuEnrBitfield is a8-bit flag field to indicate Waku capabilities. Only the 4 LSBs are currently defined according to RFC31 (https://rfc.vac.dev/spec/31/).

func NewWakuEnrBitfield

func NewWakuEnrBitfield(lightpush, filter, store, relay bool) WakuEnrBitfield

NewWakuEnrBitfield creates a WakuEnrBitField whose value will depend on which protocols are enabled in the node

Jump to

Keyboard shortcuts

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