near-cli icon indicating copy to clipboard operation
near-cli copied to clipboard

Improve messages for `generate-key`

Open volovyks opened this issue 3 years ago • 3 comments

When we run near generate key <accId> --seedPhease=<seed> we are always getting Account has existing key pair with ed25519:<pk> public key. It happens even when account Id and pk are not in our local storage.

Another issue: When we run simple near generate-key <acc-name> we are getting Key pair with ed25519:<pk> public key for an account "<acc>" which is not very informative. Let's explain user where this key is stored.

Another issue: When the key is already stored - we are getting the same message Account has existing key pair with XXX, but the existing key is replaced with the generated one. So.. the user can lose his private key. The user should be prompted that the key will be overwriteen.

volovyks avatar Jun 05 '21 07:06 volovyks

Related issues:

  • https://github.com/near/near-cli/issues/837
  • https://github.com/near/near-cli/issues/783
  • https://github.com/near/near-cli/issues/326

volovyks avatar Oct 05 '21 14:10 volovyks

Ditto. This seems like very poor wording... "Account has existing key pair"

Although yes, the account does JUST NOW after running the generate-key command, have an "existing" key pair... but existing in this context makes it seem like a different key pair existed before the command was run.

Maybe something along the lines of "Key pair has been generated" or some such...

This should be a relatively easy fix... anyone able to provide feedback on different verbiage?

june07 avatar Jan 13 '22 16:01 june07

I'm new to Near development and just encountered this in the CLI. It was very confusing, as the account doesn't even exist on the blockchain yet (just used some random unique name)- and I was generating a key for the first time from a random seed phrase.

It was even more confusing, because just before this I had used a seed phrase with an account that does exist (but wasn't in my local ~/near-credentials folder yet)- and I got the same message, which I assumed it was telling me that this key pair already existed for this account, as if it did a check on the blockchain. But its still a confusing message to get, because that has nothing to do with the fact that we're adding the key locally now.

lostpebble avatar Apr 20 '22 12:04 lostpebble