-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Track: enabling the DHT by default #3905
Comments
Adds additional tests from #36 as well as some extras requested in the PR comments. Refs: ipfs/js-ipfs#3905
As it currently stands, I presume that we only support DHT client mode, right? |
DHT server mode works, but for the time being you have to enable it explicitly with "Type": "dhtserver". Once autonat lands in libp2p we'll be able to flip into server mode automatically. |
That's amazing! Thanks for clarifying that. Is upnp supported by js-libp2p to map ports? |
Yes, it's on by default for node & electron - if your node manages to negotiate uPnP port forwarding with your router it should start to report a public IP address a few seconds after startup. You should ensure your node is publicly addressable in this or some other fashion before enabling DHT server mode, otherwise it'll start storing provider records for peers but they'll not be resolvable on the network as other peers won't be able to dial your node. If you just want DHT support to find other peers and content, client mode is all you need. |
Can js-ipfs running in a browser use the DHT in client mode over a WSS connection? |
Yes, and it's recommended that they only use the DHT in client mode as browser nodes aren't typically around for long enough to make good DHT servers (it should be on the order of days). One thing to bear in mind is that although you'll get results from DHT queries in the browser, most nodes on the network are not dialable from browsers due to them only supporting TCP and/or QUIC transports so you'll probably want to set up a circuit relay or similar to be able to connect to them. This will change with the arrival of WebRTC transports that don't need a signalling server. |
backlog grooming: Autonat is the next step for this. |
The DHT is enabled by default in Helia - if anyone is watching this issue for updates, please see the migration guide and update as soon as possible. |
Steps
Each step depends on the previous but represents a stand-alone piece of functionality so will be useful when shipped.
DHT client mode
Autonat
DHT server mode
Testing
Testing will be done through interop and Testground. The interop test suite PR needs updating but will help establish an absolute baseline. More advanced testing will need to be done in Testground which will require the js-sdk being usable.
Wrap up
The text was updated successfully, but these errors were encountered: