waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
162 stars 41 forks source link

Alllow simple way to enable peerExchange #2001

Open vpavlin opened 2 months ago

vpavlin commented 2 months ago
This is a **feature request** ## Problem It seems that currently the only straightforward way to enable `peerExchange` is to set `defaultBootstrap: true`. This is problematic in case a user runs on a custom pubsubTopic or generally separate network and may not want to use default fleets to bootstrap. It is possible to enable `peerExchange` by adding it to `libp2p.peerDiscovery` (thanks @danisharora099 !) ``` waku = await createLightNode({ libp2p: { peerDiscovery: [ wakuPeerExchangeDiscovery(pubsubTopic) ] } }); ``` But it might be useful to either enable it by default, or add something like `peerExchange: true` to the top level config ## Proposed Solutions (these are `or` options:) ) 1. Enable peerExchange by default 2. Add `peerExchange` parameter to `createLightNode` 3. Document the current way (via libp2p.peerDiscovery) ## Notes