-
Notifications
You must be signed in to change notification settings - Fork 1.2k
kadDHT error #1657
Comments
Apologies but I don't understand. Could you please rephrase and include the stack trace for the error? |
i got the same error 😭 .
|
I'm having the same problem. I reproduced it here, the relevant stack trace seems to be:
The root of it seems to be this assert:
|
Thanks @dsmith3210 @jacobheun this error is originating in libp2p - are you able to take a look? |
So the reason this is failing is because the DHT is being enabled, but no DHT is being provided. In the nodejs configuration we set the dht to kademlia, https://github.com/ipfs/js-ipfs/blob/v0.33.1/src/core/runtime/libp2p-nodejs.js#L36. The browser config is not setting the dht, https://github.com/ipfs/js-ipfs/blob/v0.33.1/src/core/runtime/libp2p-browser.js#L18-L35. So when libp2p runs it's config validation it gets unhappy about turning the missing dht on. This can be enabled by passing it into the libp2p options when creating the IPFS node. However, it's not obvious that this needs to be done. I'd recommend we just update the libp2p-browser config to include the dht, that way enabling it in @alanshaw if that sounds good I can submit a PR. |
yeah, we need to add the |
Thank you for the info, @jacobheun. I added DHT to libp2p-browser.js and I'm up and running now. One other note was that I had to add an empty dht object in the config section of defaults: otherwise I got a fatal error: TypeError: this._config.dht is undefined; can't access its "enabledDiscovery" property |
Thanks for the feedback @dsmith3210 ! I will fix that, in |
Lets wait until #856 is ready before we add it to the browser. |
too much cpu usage nearly 1 cpu core |
@mccoysc can you test that using the following ipfs/js-ipfs#856? It would be really valuable for me |
in browser jsipfs with version 0.33.rc1 and lower,if i enable the dht, error would be caused for in libp2p-browser.js no kadDHT configed and would cause this error.
the modules.dht should be config to kadDHT.
The text was updated successfully, but these errors were encountered: