Skip to content

Commit

Permalink
Add support for environment variable MNEMONIC
Browse files Browse the repository at this point in the history
  • Loading branch information
mariavarvaroi committed Oct 29, 2024
1 parent bbfebe1 commit e7fa6b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name = "eth_staking_smith"
path = "src/lib.rs"

[dependencies]
clap = { version = "^4.5", features = ["derive"] }
clap = { version = "^4.5", features = ["derive", "env"] }
ethereum_hashing = "0.6.0"
eth2_key_derivation = { git = "https://github.com/ChorusOne/lighthouse", rev = "1be5253610dc8fee3bf4b7a8dc1d01254bc5b57d"}
eth2_keystore = { git = "https://github.com/ChorusOne/lighthouse", rev = "1be5253610dc8fee3bf4b7a8dc1d01254bc5b57d"}
Expand Down
11 changes: 8 additions & 3 deletions src/cli/existing_mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ pub struct ExistingMnemonicSubcommandOpts {
/// The mnemonic that you used to generate your
/// keys.
///
/// This can be provided in two ways:
///
/// 1. Through the MNEMONIC environment variable (recommended)
///
/// 2. Through the --mnemonic argument in plain text.
/// 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.
#[arg(long)]
/// for your mnemonic as otherwise it will
/// appear in your shell history.
#[arg(long, env = "MNEMONIC")]
pub mnemonic: String,

/// The name of Ethereum PoS chain you are targeting.
Expand Down

0 comments on commit e7fa6b9

Please sign in to comment.