Documentation ¶
Index ¶
- Constants
- func ContainsRelayShard(record *enr.Record, topic protocol.StaticShardingPubsubTopic) bool
- func ContainsShard(record *enr.Record, cluster uint16, index uint16) bool
- func ContainsShardTopic(record *enr.Record, topic string) bool
- func ContainsShardWithWakuTopic(record *enr.Record, topic protocol.WakuPubSubTopic) bool
- func EnodeToPeerInfo(node *enode.Node) (*peer.AddrInfo, error)
- func Multiaddress(node *enode.Node) (peer.ID, []multiaddr.Multiaddr, error)
- func NewLocalnode(priv *ecdsa.PrivateKey) (*enode.LocalNode, error)
- func RelayShardList(record *enr.Record) (*protocol.RelayShards, error)
- func RelaySharding(record *enr.Record) (*protocol.RelayShards, error)
- func RelayShardingBitVector(record *enr.Record) (*protocol.RelayShards, error)
- func Update(localnode *enode.LocalNode, enrOptions ...ENROption) error
- type ENROption
- func WithCapabilities(lightpush, filter, store, relay bool) ENROption
- func WithIP(ipAddr *net.TCPAddr) ENROption
- func WithMultiaddress(multiaddrs ...multiaddr.Multiaddr) ENROption
- func WithUDPPort(udpPort uint) ENROption
- func WithWakuBitfield(flags WakuEnrBitfield) ENROption
- func WithWakuRelayShardList(rs protocol.RelayShards) ENROption
- func WithWakuRelaySharding(rs protocol.RelayShards) ENROption
- func WithWakuRelayShardingBitVector(rs protocol.RelayShards) ENROption
- func WithWakuRelayShardingTopics(topics ...string) ENROption
- type WakuEnrBitfield
Constants ¶
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)
const ShardingBitVectorEnrField = "rsv"
const ShardingIndicesListEnrField = "rs"
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 ContainsShardWithWakuTopic ¶ added in v0.9.0
func ContainsShardWithWakuTopic(record *enr.Record, topic protocol.WakuPubSubTopic) bool
func EnodeToPeerInfo ¶
EnodeToPeerInfo extracts the peer ID and multiaddresses defined in an ENR
func Multiaddress ¶
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)
Types ¶
type ENROption ¶
func WithCapabilities ¶
func WithMultiaddress ¶
func WithMultiaddress(multiaddrs ...multiaddr.Multiaddr) ENROption
func WithUDPPort ¶
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
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