You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the libp2p instance was exposed to discovery instances. For example I would like libp2p-gossip-discovery to follow the discovery interface, but it need access to the instances peerBook and dail to populate correctly.
The text was updated successfully, but these errors were encountered:
We currently don't have a global namespace where any module can pick up on the properties of a libp2p node (from peerInfo, swarm etc). We can't really do that because how JS dep management works and how require behaves, however, we could use DI for it.
That said, you won't need any of the above to achieve your goal (thanks for providing an example). You just need to:
Create a libp2p node with a gossipDiscovery reference
gossipDiscovery.attach(libp2pInstance) (or method that does the same).
This way, gossipDiscovery would have access to all the dial/handle methods of a libp2p instance and libp2p would be able to receive the peers discovered by gossipDiscovery.
It would be nice if the libp2p instance was exposed to discovery instances. For example I would like libp2p-gossip-discovery to follow the discovery interface, but it need access to the instances peerBook and
dail
to populate correctly.The text was updated successfully, but these errors were encountered: