namada icon indicating copy to clipboard operation
namada copied to clipboard

Feature : add a new cli 'wallet convert' command for coverting tendermnint key json file

Open Jeongseup opened this issue 1 year ago • 0 comments

Describe your changes

I made a new cli command for namadw caused by #2515

Usage: namadaw [OPTIONS] <COMMAND>

### Sample
Commands:
  gen               Generates a new transparent / shielded secret key.
  derive            Derive transparent / shielded key from the mnemonic code or a seed stored on the hardware wallet device.
  gen-payment-addr  Generates a payment address from the given spending key.
  list              List known keys and addresses in the wallet.
  find              Find known keys and addresses in the wallet.
  export            Exports a transparent keypair / shielded spending key to a file.
  convert           Convert to tendermint priv_validator_key.json with your consensus key alias
  import            Imports a transparent keypair / shielded spending key from a file.
  add               Adds the given key or address to the wallet.
  remove            Remove the given alias and all associated keys / addresses from the wallet.
  help              Print this message or the help of the given subcommand(s)

How to use

  1. submit change consensus key transaction by using namadac
namada client change-consensus-key  \
	--validator <your validator address> \
	--signing-keys <your validator account key name> 
        # Add options whatever you want
  1. you can check created a new consensus key in wallet.toml
  Alias "validator-0-consensus-key-1" (encrypted):
    Public key hash: F1E5244875BAB4D5BDBFCDE1EC9862DF3DEC2478
    Public key: tpknam1qqv7xw0wad4v4vk6lyv0ft8hmandffwzeru3khrdvgesye7tjsy3vd2c636
  1. By protocol parameter, the consensus key which connected at your validator will be changed to by this new key after a few epochs(pipeline length)

  2. convert a key for generating priv_validator_key.json

namadaw convert --alias "validator-0-consensus-key-1"

you can see priv_validator_key.json_ file

  1. replace cometbft/config/priv_validator_key.json with it

  2. you can check tendermint address with both a new priv_validator_key.json address and find-validator command

Improvement plan

I'm not sure. Other validators would want to use this feature. Please any comments for improvement validators UX

Indicate on which release or other PRs this topic is based on

Checklist before merging to draft

  • [ ] I have added a changelog
  • [ ] Git history is in acceptable state

Connected Issue

Jeongseup avatar Feb 05 '24 05:02 Jeongseup