Global PubSub PeerList

Dear all,

I wonder if there is a way to get a global peer list of people subscribed to a topic in pubsub? In the Doc I found this

but it returns only the peers that are directly connected with a stream to another peer and not all peers in the network that are (indirectly) subscibed to the same topic.

Here (https://github.com/libp2p/go-libp2p-pubsub/issues/77) it is asked if"On the other hand “mesh” is a global and persistent list of peers (both direct and indirect) that have joined a particular topic?".

Can I somehow make use of it or is it used internally only?

Thanks for your help!

There is no global list of peers, we can only track peers to which we have connected and we know first-hand to be in some topic.

1 Like

The issue of peer discovery is deliberately left out of the scope of pubsub. You can leverage DHT provider records, random walks, upcoming rendezvous, or other mechanisms to discover tentative peers on a topic.

Note that gossipsub should make bonding with peers on the topic easier, thanks to the fanout gossip, as you no longer need to find a peer that is subscribed to the topic, right @vyzo?

See Mesh, fanout, and peers.gossipsub clarification

2 Likes

We still use peers known to be in the topic for the fanout selection. So we do need to find peers in the topic for most effective message dissemination.

Note that we are considering adding a boostrap process to the DHT that finds peers through discovery.

1 Like

Thank you all for your qick answers!