Publishing to gossipsub briefly without subscribing

I’m building an application that does a fan out from one topic to smaller topics using Gossipsub. Most smaller clients are listening on the smaller topics.

Something I’ve noticed in the Go libp2p libs is that to publish I first have to call Join that seems to do some under the surface subscription things. I’m using the topic to do the following things immediately straight after the other:

  • Join
  • Publish
  • Close

I’m seeing messages get dropped and not arrive at peers. Is there someway to flush a topic before closing it to make sure the messages get published to some number of peers to provide some confidence they’re received?

you shouldn’t have to join if you jist want to publish.

According to the Go lib the PubSub types Publish function is deprecated and says that I should called Join before publishing.

Also, looking at the code under the hood it looks like the join functionality is triggered with a Publish anyway.

ni, the protocol explicitly allows you to publish without joining. There is no requirement to call Join before publish.

According to this code when you call Publish it joins the topic under the hood:

@vyzo How do you do what you describe, publish without joining?