Private #privateReadonly controlReadonly 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
Readonly optsReadonly peersReadonly scorePeer score tracking
Readonly streamsReadonly streamsReadonly topicCustom validator function per topic.
Must return or resolve quickly (< 100ms) to prevent causing penalties for late messages.
If you need to apply validation that may require longer times use asyncValidation option and callback the
validation result through Gossipsub.reportValidationResult
Optional options: boolean | AddEventListenerOptionsApp 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.
Generated using TypeDoc
Map of control messages peer id => control message