This PR provides an alternative constructor for GossipSub, which is called NewGossipSubWithRouter. In contrast to the existing NewGossipSub constructor that builds a GossipSub instance with the default router, the NewGossipSubWithRouter alternative is capable of building a GossipSub instance with arbitrary PubsubRouter. This empowers building more application-specific routers and injecting them into GossipSub, e.g., the router with an application-specific metric collection.
This PR provides an alternative constructor for
GossipSub
, which is calledNewGossipSubWithRouter
. In contrast to the existingNewGossipSub
constructor that builds aGossipSub
instance with the default router, theNewGossipSubWithRouter
alternative is capable of building aGossipSub
instance with arbitraryPubsubRouter
. This empowers building more application-specific routers and injecting them intoGossipSub
, e.g., the router with an application-specific metric collection.