-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Error: Key does not exist. on pass account id to name.publish #2046
Comments
@vasco-santos do you have a sec to look into this one please? |
Hello @Jonybang , thanks for reaching out Currently, you cannot access the keychain without starting a node with a pass (how to start with a pass) In the current code example, I cannot reproduce your error because I cannot get const IPFS = require('ipfs');
const node = new IPFS({});
const keys = await = node.key.list();
const keyName = keys[0].name;
node.name.publish('QmdFuxvDj27kW3j3DbosoicC828jm7ZtJNbVubFQ8aTbNV', {
key: keyName
}); Let me know if you were able to get this solved. |
@vasco-santos sorry, i forgot about pass, i've fixed issue reproducing code.
but Peer ID actually not working. |
I have no problems with passing name instead of peer id, but it makes my code more complicated, i have only peer id on input, so i made hotfix like this:
But it would be great if js-ipfs code will follows the documentation, so i could remove this hotfix in the future 😊 |
What's the reason for this @vasco-santos? Is it a bug? |
In fact, we do not support the key as a That is a misleading doc and should be modified. However, @Jonybang are you willing to give it a try in adding support for supporting a peer id?
Documentation bug yes! We only support the name of the key |
@vasco-santos would you mind opening a PR to fix the docs for now? 🙏 @Jonybang does this answer your question? Did you get things working now? |
Done! |
refs ipfs/js-ipfs#2046 Implementation currently does not support key as Peer ID.
@alanshaw now docs is match to code, yes 😅 |
@Jonybang I do not agree with your reasoning. When you generate a key for an ipfs node using using key.gen key.gen('key-name') You define a key that you want your node to use. After this, you start your node, which will be node with peer id name.publish(value, { key: ´key-name' }) or: const keys = await node.key.list()
const keyId = keys[1].id // for ease of example
name.publish(value, key: keyId }) Of course, the best approach depends on the use case. However, as we define the name when you create the We are not restricting the implementation in any way. I implemented that api using only the Anyway, you can create an issue for discussion of |
@vasco-santos i think there is a misunderstanding. I didn't said that passing |
+1 please send PR! 😁 |
Type: Bug
Severity: Medium
Description: Error on trying to pass account Peer ID instead of name to ipfs.name.publish
Steps to reproduce the error:
The text was updated successfully, but these errors were encountered: