ethersphere / swarm-cli

Manage your Bee node and interact with the Swarm network via the CLI
BSD 3-Clause "New" or "Revised" License
48 stars 21 forks source link

Not providing a name when creating identity may fail later #306

Closed agazso closed 2 years ago

agazso commented 2 years ago

When you create a new identity and don't provide a name, the CLI will assume main as a name but it does not check if the name already exists, only after providing the password and encrypting the data (which can take a few seconds). Then it fails with an error (see the output below).

It would be better to check if the name exists at the beginning instead.

 % node dist/index.js identity create
You have not defined password with the "--password" option.
If you want to create disposable keypair, use "only-keypair" option
? Please provide a password [hidden]
? Please repeat the password [hidden]
Identity 'main' already exist.