ipfs name publish --key should accept a PeerID in addition to the key name.ipfs key list should list the PeerID alongside the key name (-l arg should be default true).Hey @lgierth, could you please give a bit more detail for the expected behavior of these 2 items?
It seems straightforward to change the default value of ipfs key list like this but do you want to preserve the previous behavior by providing another option?
ipfs name publish --key for this one, as I understand currently it's publishing to/as self using the node's own PeerID, this would enable the node to publish to other nodes instead of self bypassing the private key lookup here? This part is a bit ambiguous to me, i'd appreciate any details
@lgierth @keremgocen I think the current behaviour of ipfs key list should stay. It is already established API so we shouldn't change it. We might want to create list of API changes we want to do when we are able to provider two versions of API or we decide to make a non-compatible change to the API.
@keremgocen about the ipfs name publish --key currently you are able to use it with key name. Like:
ipfs key gen --type=rsa --size=2048 mykey
ipfs name publish --key=mykey QmSomeHash
@lgierth calls for being able to use peerID instead of keyname (mykey in this case). PeerID can be obtained usingipfs key list -l` but I am not sure if keystore (code responsible for storing keys) provides good method to lookup PeerID -> keyname or PeerID -> private key.
Then I shall skip the "-l arg should be default true" part.
@Kubuxu what would be a good way to lookup peerIDs? I see some potential ways of doing so like node.Routing.FindPeers here but not sure which one would be the best option with my current exposure level to the codebase.
It should use keystore, as the --key parameters currently uses keyname (from keystore) as parameter. You can't use routing as you need private key. For now the simplest way would be to list all keys (in keystore), get them, check for matching peerID. If found use that key.
I would go with that solution for now. We might want to do something smarter latter (will come out in CR process).
So the actions here would be:
ipfs name --key=Qm...AAA Qm...BBB to workSo the actions here would be:
- Enable
ipfs name --key=Qm...AAA Qm...BBBto work- Write sharness tests for it
SGTM :+1:
fca98aea9d5a5d23240f9fc2e9895cfead74ab21 should conclude #3882, might need to rebase though
@lgierth Can you close this if it's all completed :D (I'm just going through "help wanted" issues trying to find things to work on)
Certainly :)
Thanks @keremgocen!