ChainSafe / gossamer

🕸️ Go Implementation of the Polkadot Host
https://chainsafe.github.io/gossamer
GNU Lesser General Public License v3.0
428 stars 110 forks source link

commands to generate, import keys #404

Closed noot closed 4 years ago

noot commented 4 years ago

need to add a command that allows for keys to be generated/imported and saved in the db keystore directory as encrypted keystore files

something like this to generate a new account, which will generate a new keypair, encrypt the private key, save the encrypted private key to a file (name=public address?)

gossamer account --generate --type=sr25519
> type password to encrypt new keystore: ****

something like this to import a key (assuming file is encrypted json)

gossamer account --import key.json
dutterbutter commented 4 years ago

I don't think we want to write this to the DB at all, we want to encrypt this file put it in the local Keystore and have it protected with your inputted passphrase similarly the way geth does it.

noot commented 4 years ago

@dutterbutter ok but where is the local keystore saved when we shut down the node? geth keeps track of your accounts between restarts

dutterbutter commented 4 years ago

@noot I think ~/.ethereum/keystore so for us ~/.gossamer/keystore

noot commented 4 years ago

true, that makes more sense