namada icon indicating copy to clipboard operation
namada copied to clipboard

Do not overwrite genesis validator keys is they alreay exist

Open Krewedk0 opened this issue 1 year ago • 2 comments

Currently running init-genesis-validator of namada client cli overwrites existing keys with newly generated ones without any prompts. It would be great to add some kind of prompt if validator-wallet.toml already exist.

Krewedk0 avatar Dec 15 '23 17:12 Krewedk0

Better, as this will save my time

Cryptmenic avatar Dec 17 '23 16:12 Cryptmenic

From my understanding, if validator-wallet.toml exists, a prompt should be made to tell the end user that that file would be overwritten. After scanning through the repository, I think the issue is from the function gen_and_store https://github.com/anoma/namada/blob/d649d0484f5d8ae003a00e530e1ed2ca17978f9c/apps/src/lib/wallet/pre_genesis.rs#L27-L46 Specifically this line: https://github.com/anoma/namada/blob/d649d0484f5d8ae003a00e530e1ed2ca17978f9c/apps/src/lib/wallet/pre_genesis.rs#L41 Solution would could be to issue a prompt using a log library or simply println. The time frame for implementing this solution is less that a minute. Most of the time taken was to find the offending method.

I'll go ahead now and write the fix

Kofituo avatar Jan 02 '24 23:01 Kofituo