I’m developing a cordova based app that wants to exchange data with desktop clients without relying on a server. Frequently, the app won’t be in the same local network as the desktop client.
Does IPFS pubsub have a system that allows peer discovery to work well enough, for it to be a useful technology for me?
Afaik the current floodsub system does not have any of the properties you require: Both peers need to connect the same relay node for the messages to be passed around.
If you’re willing to wait (and use floodsub in the meantime), apparently gossipsub implementations are currently in development.
Regarding the establishment of connections between the peers: It should generally work, but make sure that both sides have several (overlapping) “…/p2p-circuit” nodes (EnableRelayHop config option) connected (ie: Add some of the public one to each peer’s bootstrap list) to ensure that NAT firewalls don’t become a problem.
Ideally you should probably run some bootstrap peers yourself to help the network and provide an endpoint that you have some control over for your users. You can then also you this for floodsub until the better gossipsub implementation is available.