You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
> libp2p-pubsub consists on the base protocol for libp2p pubsub implementations. This module is responsible for registering the protocol in libp2p, as well as all the logic regarding pubsub connections with other peers.
15
+
> libp2p-pubsub is the base protocol for libp2p pubsub implementations. This module is responsible for registering the protocol in libp2p, as well as all the logic regarding pubsub connections with other peers.
16
16
17
17
## Lead Maintainer
18
18
@@ -38,7 +38,7 @@ js-libp2p-pubsub
38
38
39
39
A pubsub implementation **MUST** override the `_processMessages`, `publish`, `subscribe`, `unsubscribe` and `getTopics` functions.
40
40
41
-
Other functions, such as `_onPeerConnected`, `_onPeerDisconnected`, `_addPeer`, `_removePeer`, `start` and `stop` may be overwritten if the pubsub implementation needs to add custom logic on them. It is important pointing out that `start` and `stop`**must** call `super`. The `start` function is responsible for registering the pubsub protocol onto the libp2p node, while the `stop` function is responsible for unregistering the pubsub protocol and shutting down every connection
41
+
Other functions, such as `_onPeerConnected`, `_onPeerDisconnected`, `_addPeer`, `_removePeer`, `start` and `stop` may be overwritten if the pubsub implementation needs to add custom logic to them. It is important pointing out that `start` and `stop`**must** call `super`. The `start` function is responsible for registering the pubsub protocol onto the libp2p node, while the `stop` function is responsible for unregistering the pubsub protocol and shutting down every connection
42
42
43
43
All the remaining functions **MUST NOT** be overwritten.
44
44
@@ -83,7 +83,7 @@ The following specified API should be the base API for a pubsub implementation o
83
83
84
84
### Start
85
85
86
-
Start the pubsub subsystem. The protocol will be registered to `libp2p`, which will notify about peers being connected and disconnected with the protocol.
86
+
Starts the pubsub subsystem. The protocol will be registered to `libp2p`, which will result in pubsub being notified when peers who support the protocol connect/disconnect to `libp2p`.
87
87
88
88
#### `pubsub.start()`
89
89
@@ -162,7 +162,7 @@ Get the list of topics which the peer is subscribed to.
162
162
163
163
### Get Peers Subscribed to a topic
164
164
165
-
Get a list of the peer-ids that are subscribed to one topic.
165
+
Get a list of the [PeerId](https://github.com/libp2p/js-peer-id) strings that are subscribed to one topic.
166
166
167
167
#### `pubsub.getPeersSubscribed(topic)`
168
168
@@ -176,7 +176,7 @@ Get a list of the peer-ids that are subscribed to one topic.
0 commit comments