eth-staking-smith icon indicating copy to clipboard operation
eth-staking-smith copied to clipboard

--mnemonic flag is required in existing-mnemonic subcommand

Open ank-everstake opened this issue 1 year ago • 2 comments

When you want to generate keys from existing-mnemonic - command fails if you do not provide --mnemonic flag:

./eth-staking-smith existing-mnemonic --withdrawal_credentials 0x0000000000000000000000000000000000000000 --num_validators 1 --chain mainnet
error: The following required arguments were not provided:
    --mnemonic <mnemonic>

USAGE:
    eth-staking-smith existing-mnemonic --chain <chain> --mnemonic <mnemonic> --num_validators <num_validators> --withdrawal_credentials <withdrawal_credentials>

However help states that you can omit this flag and you will be prompted on console:

        --mnemonic <mnemonic>
            The mnemonic that you used to generate your
                            keys. (It is recommended not to use this
                            argument, and wait for the CLI to ask you
                            for your mnemonic as otherwise it will
                            appear in your shell history.)

ank-everstake avatar Jul 05 '24 08:07 ank-everstake

Thanks for the report, this will be easy to implement, will do -- mnemonic will be either read from stdin, or asked as an input

mksh avatar Jul 05 '24 15:07 mksh

@mksh Any updates on the issue?

ank-everstake avatar Oct 10 '24 15:10 ank-everstake

We removed the inconsistency in the docs and added support for mnemonic as environment variable #60 @ank-everstake

mariavarvaroi avatar Oct 29 '24 13:10 mariavarvaroi

--mnemonic flag is not required any more, we support passing mnemonic as environment variable, which can be used in combination with small shell wrapper like follows

echo "Please enter your mnemonic" ; read -s MNEMONIC ; export MNEMONIC
Please enter your mnemonic
./target/debug/eth-staking-smith existing-mnemonic --chain mainnet  --num_validators 1

allows to achieve behavior which was originally described in the docstring. Apologize for initial inconsistency, we have coped docs from the upstream python cli initially.

Full documentation for MNEMONIC environment variable is here: https://github.com/ChorusOne/eth-staking-smith/tree/v20241030.0?tab=readme-ov-file#passing-mnemonic-as-environment-variable

Using environment variable instead of --mnemonic flag now supported in all commands that accept mnemonic as parameter, i.e.

  • existing-mnemonic
  • bls-to-execution-change
  • presigned-exit-message
  • batch-presigned-exit-message

https://github.com/ChorusOne/eth-staking-smith/releases/tag/v20241030.0 -- release binaries that support env var are here

mksh avatar Oct 30 '24 14:10 mksh