This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
dht.provide() doesn't accept strings #2573
Closed
Description
- master:
- Chrome/Windows:
- DHT:
Type:
Bug
Severity:
Medium
Description:
ipfs.dht.provide() doesn't accept a string as input. It exclusively accepts a CID instance object.
This is inconsistent with how dht.findProvs() works, and it's not even hinted at in the documentation.
The error returned for giving it a string is "not a valid CID" which is also very opaque and confusing.
I would suggest to either update the documentation or to modify the function to do something like const cid = new CID(string_argument) in order to support a string-based argument.