The global signature policy controls whether or not we sill send and receive signed or unsigned messages.
Signed messages prevent spoofing message senders and should be preferred to using unsigned messages.
A list of multicodecs that contain the pubsub protocol name.
Pubsub routers support message validators per topic, which will validate the message before its propagations. They are stored in a map where keys are the topic name and values are the validators.
Add a listener for an event
Optionaloptions: boolean | AddEventListenerOptionsThe dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Gets a list of the PeerIds that are subscribed to one topic.
Gets a list of topics the node is subscribed to.
const topics = libp2p.pubsub.getTopics()
Returns the number of listeners for the event type
Publishes messages to the given topic.
Optionaldata: Uint8Array<ArrayBufferLike>Remove a listener previously registered for an event
Optionallistener: EventHandler<GossipSubEvents[K]> | nullOptionaloptions: boolean | EventListenerOptionsThe removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Optionallistener: EventHandler<Event>Optionaloptions: boolean | EventListenerOptionsType-safe version of EventTarget.dispatchEvent - only events from the event map are supported.
Attempting to dispatch an unsupported event results in a TypeScript compilation error.
Optionaldetail: CustomEventInit<Detail>
An event target with a typed map of supported events