I’m posting messages to a GossipSub topic, and I’d like to make sure the message gets to at least one other peer.
I see that there is a WithReadiness
option I can use when publishing. However, when I use it the Publish
function blocks forever, even though a peer is subscribed to the topic.
I see in the docs:
// WithReadiness returns a publishing option for only publishing when the router is ready.
// This option is not useful unless PubSub is also using WithDiscovery
func WithReadiness(ready RouterReady) PubOpt {
So it seems like maybe I need to use WithDiscovery
on the GossipSub when I create it, but I’m not sure how to construct the discovery. Is there any examples for how to do this, or anyone able to point me in the right direction?