Optional options: Partial<waku_relay.CreateOptions>Private #privateReadonly controlMap of control messages peer id => control message
Readonly directDirect peers
Readonly fanoutMap of topics to set of peers. These mesh peers are the ones to which we are publishing without a topic membership topic => peer id set
Readonly globalThe signature policy to follow by default
Readonly gossipMap of pending messages to gossip peer id => control messages
Readonly gossipTracks IHAVE/IWANT promises broken by peers
Readonly meshMap of topic meshes topic => peer id set
observers called when receiving new message.
Observers under key "" are always called.
Readonly optsReadonly peersReadonly scorePeer score tracking
Readonly streamsReadonly streamsReadonly topicStatic multicodecRegister a decryption key to attempt decryption of received messages.
This can either be a private key for asymmetric encryption or a symmetric
key. WakuRelay will attempt to decrypt messages using both methods.
Strings must be in hex format.
Optional options: { contentTopics?: string[]; method?: DecryptionMethod }Optional contentOptional method?: DecryptionMethodOptional options: boolean | AddEventListenerOptionsRegister an observer of new messages received via waku relay
called when a new message is received via waku relay
Content Topics for which the callback with be called, all of them if undefined, [] or ["",..] is passed.
Remove an observer of new messages received via waku relay. Useful to ensure the same observer is not registered several time (e.g when loading React components)
App layer publishes a message to peers, return number of peers this message is published to
Note: async due to crypto only if StrictSign, otherwise it's a sync fn.
For messages not from us, this class uses forwardMessage.
Optional listener: null | EventHandler<GossipsubEvents[K]>Optional options: boolean | EventListenerOptionsThis function should be called when asyncValidation is true after
the message got validated by the caller. Messages are stored in the mcache and
validation is expected to be fast enough that the messages should still exist in the cache.
There are three possible validation outcomes and the outcome is given in acceptance.
If acceptance = MessageAcceptance.Accept the message will get propagated to the
network. The propagation_source parameter indicates who the message was received by and
will not be forwarded back to that peer.
If acceptance = MessageAcceptance.Reject the message will be deleted from the memcache
and the P₄ penalty will be applied to the propagationSource.
If acceptance = MessageAcceptance.Ignore the message will be deleted from the memcache
but no P₄ penalty will be applied.
This function will return true if the message was found in the cache and false if was not in the cache anymore.
This should only be called once per message.
Send Waku message.
Generated using TypeDoc
Implements the Waku v2 Relay protocol. Must be passed as a
pubsubmodule to aLibp2pinstance.Implements