Retrieve all topics in the network?

Is there a way to retrieve all topics in the network from any node? To give some context, we have a test node which eavesdrops by subscribes to all possible topics. However, some of the topic name are dynamically generated and not known upfront. Is it possible for a node to get all topics defined in the network?

There is no way to enumerate all topics in a p2p network, other than crawling the network and collecting the topics that peers say they’re subscribed to. I don’t think that go-libp2p-pubsub triggers events or offers an API to fetch that info. You could open an issue to discuss in the community, and submit a PR later on!