kwilteam / kwil-db

Kwil DB, the database for web3
https://www.kwil.com/
Other
36 stars 12 forks source link

admin: use specified private key with setup init #1058

Closed jchappelow closed 1 month ago

jchappelow commented 1 month ago

Requires and based on https://github.com/kwilteam/kwil-db/pull/1059

Resolves https://github.com/kwilteam/kwil-db/issues/1057

This change alters how setup init handles the --app.private_key_path flag. Recently it was modified to ignore the flag entirely, with the apparent intent of ensuring the generated config.toml in the initialized root directory would always be private_key_path = "private_key" with the actual private key always being written into the root directory. This behavior is good, however, when the flag is set it is desirable to import the private key file pointed to by this flag, which is what this change does.

This new behavior streamlines the production deployment guide where the workflow for the genesis validator set involves preparing the private keys so that then can be used in the genesis file created with kwil-admin setup genesis first.

jchappelow commented 1 month ago

Not urgent @brennanjl, but I wanted to ensure this behavior isn't out of line with your intent for this command, particularly since you recently updated it. I think this is a minor change and should not cause any problems, but it does help some workflows where you want to initialize your node's root directory with an existing private key and existing genesis.json.

jchappelow commented 1 month ago

@charithabandi Would you please re-approve? I added docs and de-duped some other instances of copyfile