New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dht.findProvs: TypeError: key.toBaseEncodedString is not a function #3502
Comments
see the issue for details Refs ipfs#3502
see the issue for details Refs ipfs#3502
|
The |
|
Closing as the resolution has been suggested. |
|
Requesting re-open, for 2 reasons.
const IPFS = require('ipfs-core');
const CID = require('cids');
async function run() {
const node = await IPFS.create({
repo: 'ok' + Math.random(),
libp2p: {
config: {
dht: {
enabled: true
}
}
}
});
const { cid } = await node.add('Hello world');
console.log(cid);
// CID(QmNRCQWfgze6AbBCaT1rkrkV5tJ2aP4oTNPb5JZcXYywve)
console.log(CID.isCID(cid));
// true
const providers = node.dht.findProvs(cid);
for await (const provider of providers) {
console.log(provider.id.toString());
}
}
run(); |
|
@achingbrain ^ should reopen or file new issues? |
|
I have the same issue currently even after creating a CID object. |
|
I am facing this issue as well with the |
|
This issue was resolved for me when I installed the latest IPFS. I suspect it was resolved due to this change in ipfs/libp2p-kad-dht. However this has led to other errors ( |
We convert CIDs to Uint8Arrays unnecessarily which breaks things. Fixes #3502
We convert CIDs to Uint8Arrays unnecessarily which breaks things. Fixes #3502
|
Hello guys, how are you? I'm facing the exact same issue, this is my code: const ipfs = await create(); for await (const provider of providers) { Error: throw Error('Unknown type, must be binary type') As you can see, I'm sending the CID as an object instance and not the string. I really need if someone help me with this? Thanks in advance. |
tymmesyde commentedJan 23, 2021
Severity: High
Description:
Unable to get providers from dht with a string cid.
Steps to reproduce the error:
Code:
Error:
TypeError: key.toBaseEncodedString is not a functionThe text was updated successfully, but these errors were encountered: