List pubsub subscriptions of other nodes?

I would think each topic is encrypted with itself as a key, so that nodes who don’t know already what topic to look for can’t tell who’s subscribing to what. But if not, is there a function to list all the topics any particular node subscribes to? It’d be nice if I could find out who’s interested in what.

I think pub sub “names” are more like internal variable names than human-readable names. Also nodes are going to be using pub-sub for lots of internal server maintenance tasks and so exposing those directly to other users (humans) would look like jibberish. So imo, I’d just create a custom JSON format that holds this kind of “Server Info” and invent your own proprietary way of each server being able publish this kind of arbitrary info about itself.

That information is not directly exposed in go-ipfs or in go-libp2p-pubsub, but peers telling each other what topics they’re subscribed to is part of the protocol (see https://github.com/libp2p/specs/tree/master/pubsub and related specs), which means you could ask peers for their topics if you can find + connect to them.

Whether the topic nodes are intelligible or not is likely application dependent. If you’re interested I’d ask more detailed questions on discuss.libp2p.io as pubsub is really a libp2p component that IPFS happens to expose for convenience.