Minor documentation fixes (#1297)

## Issue Addressed

N/A

## Proposed Changes

- Fix a wrong command in the validator generation example.
- Replace occurrences of 'passphrase' with 'password'. This is mostly because I felt that there was a lot of mixing of the two phrases in the documentation and the actual commands which is a bit confusing. Picked 'password' everywhere because it felt more appropriate but I don't mind changing it to 'passphrase' as long it's consistent everywhere.
This commit is contained in:
Pawan Dhananjay 2020-09-02 04:59:22 +00:00
parent fb9d828e5e
commit 87181204d0
7 changed files with 22 additions and 23 deletions

View File

@ -13,7 +13,7 @@ use validator_dir::Builder as ValidatorDirBuilder;
pub const CMD: &str = "create"; pub const CMD: &str = "create";
pub const BASE_DIR_FLAG: &str = "base-dir"; pub const BASE_DIR_FLAG: &str = "base-dir";
pub const WALLET_NAME_FLAG: &str = "wallet-name"; pub const WALLET_NAME_FLAG: &str = "wallet-name";
pub const WALLET_PASSPHRASE_FLAG: &str = "wallet-passphrase"; pub const WALLET_PASSWORD_FLAG: &str = "wallet-password";
pub const DEPOSIT_GWEI_FLAG: &str = "deposit-gwei"; pub const DEPOSIT_GWEI_FLAG: &str = "deposit-gwei";
pub const STORE_WITHDRAW_FLAG: &str = "store-withdrawal-keystore"; pub const STORE_WITHDRAW_FLAG: &str = "store-withdrawal-keystore";
pub const COUNT_FLAG: &str = "count"; pub const COUNT_FLAG: &str = "count";
@ -34,8 +34,8 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.required(true), .required(true),
) )
.arg( .arg(
Arg::with_name(WALLET_PASSPHRASE_FLAG) Arg::with_name(WALLET_PASSWORD_FLAG)
.long(WALLET_PASSPHRASE_FLAG) .long(WALLET_PASSWORD_FLAG)
.value_name("WALLET_PASSWORD_PATH") .value_name("WALLET_PASSWORD_PATH")
.help("A path to a file containing the password which will unlock the wallet.") .help("A path to a file containing the password which will unlock the wallet.")
.takes_value(true) .takes_value(true)
@ -109,8 +109,7 @@ pub fn cli_run<T: EthSpec>(
let spec = env.core_context().eth2_config.spec; let spec = env.core_context().eth2_config.spec;
let name: String = clap_utils::parse_required(matches, WALLET_NAME_FLAG)?; let name: String = clap_utils::parse_required(matches, WALLET_NAME_FLAG)?;
let wallet_password_path: PathBuf = let wallet_password_path: PathBuf = clap_utils::parse_required(matches, WALLET_PASSWORD_FLAG)?;
clap_utils::parse_required(matches, WALLET_PASSPHRASE_FLAG)?;
let validator_dir = clap_utils::parse_path_with_default_in_home_dir( let validator_dir = clap_utils::parse_path_with_default_in_home_dir(
matches, matches,
VALIDATOR_DIR_FLAG, VALIDATOR_DIR_FLAG,

View File

@ -15,7 +15,7 @@ use std::path::{Path, PathBuf};
pub const CMD: &str = "create"; pub const CMD: &str = "create";
pub const HD_TYPE: &str = "hd"; pub const HD_TYPE: &str = "hd";
pub const NAME_FLAG: &str = "name"; pub const NAME_FLAG: &str = "name";
pub const PASSPHRASE_FLAG: &str = "passphrase-file"; pub const PASSWORD_FLAG: &str = "password-file";
pub const TYPE_FLAG: &str = "type"; pub const TYPE_FLAG: &str = "type";
pub const MNEMONIC_FLAG: &str = "mnemonic-output-path"; pub const MNEMONIC_FLAG: &str = "mnemonic-output-path";
@ -34,8 +34,8 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.required(true), .required(true),
) )
.arg( .arg(
Arg::with_name(PASSPHRASE_FLAG) Arg::with_name(PASSWORD_FLAG)
.long(PASSPHRASE_FLAG) .long(PASSWORD_FLAG)
.value_name("WALLET_PASSWORD_PATH") .value_name("WALLET_PASSWORD_PATH")
.help( .help(
"A path to a file containing the password which will unlock the wallet. \ "A path to a file containing the password which will unlock the wallet. \
@ -71,7 +71,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
pub fn cli_run(matches: &ArgMatches, base_dir: PathBuf) -> Result<(), String> { pub fn cli_run(matches: &ArgMatches, base_dir: PathBuf) -> Result<(), String> {
let name: String = clap_utils::parse_required(matches, NAME_FLAG)?; let name: String = clap_utils::parse_required(matches, NAME_FLAG)?;
let wallet_password_path: PathBuf = clap_utils::parse_required(matches, PASSPHRASE_FLAG)?; let wallet_password_path: PathBuf = clap_utils::parse_required(matches, PASSWORD_FLAG)?;
let mnemonic_output_path: Option<PathBuf> = clap_utils::parse_optional(matches, MNEMONIC_FLAG)?; let mnemonic_output_path: Option<PathBuf> = clap_utils::parse_optional(matches, MNEMONIC_FLAG)?;
let type_field: String = clap_utils::parse_required(matches, TYPE_FLAG)?; let type_field: String = clap_utils::parse_required(matches, TYPE_FLAG)?;
@ -90,7 +90,7 @@ pub fn cli_run(matches: &ArgMatches, base_dir: PathBuf) -> Result<(), String> {
// Create a random password if the file does not exist. // Create a random password if the file does not exist.
if !wallet_password_path.exists() { if !wallet_password_path.exists() {
// To prevent users from accidentally supplying their password to the PASSPHRASE_FLAG and // To prevent users from accidentally supplying their password to the PASSWORD_FLAG and
// create a file with that name, we require that the password has a .pass suffix. // create a file with that name, we require that the password has a .pass suffix.
if wallet_password_path.extension() != Some(&OsStr::new("pass")) { if wallet_password_path.extension() != Some(&OsStr::new("pass")) {
return Err(format!( return Err(format!(

View File

@ -88,7 +88,7 @@ validator](./validator-create.md). A two-step example follows:
Create a wallet with: Create a wallet with:
```bash ```bash
lighthouse --testnet medalla account wallet create --name my-validators --passphrase-file my-validators.pass lighthouse --testnet medalla account wallet create --name my-validators --password-file my-validators.pass
``` ```
The output will look like this: The output will look like this:
@ -124,7 +124,7 @@ used to restore your validator if there is a data loss.
Create a validator from the wallet with: Create a validator from the wallet with:
```bash ```bash
lighthouse --testnet medalla account validator create --wallet-name my-validators --wallet-passphrase my-validators.pass --count 1 lighthouse --testnet medalla account validator create --wallet-name my-validators --wallet-password my-validators.pass --count 1
``` ```
The output will look like this: The output will look like this:

View File

@ -35,9 +35,9 @@ items, starting at one easy-to-backup mnemonic and ending with multiple
keypairs. Creating a single validator looks like this: keypairs. Creating a single validator looks like this:
1. Create a **wallet** and record the **mnemonic**: 1. Create a **wallet** and record the **mnemonic**:
- `lighthouse account wallet create --name wally --passphrase-file wally.pass` - `lighthouse account wallet create --name wally --password-file wally.pass`
1. Create the voting and withdrawal **keystores** for one validator: 1. Create the voting and withdrawal **keystores** for one validator:
- `lighthouse account validator create --wallet-name wally --wallet-passphrase wally.pass --count 1` - `lighthouse account validator create --wallet-name wally --wallet-password wally.pass --count 1`
In step (1), we created a wallet in `~/.lighthouse/wallets` with the name In step (1), we created a wallet in `~/.lighthouse/wallets` with the name

View File

@ -17,7 +17,7 @@ lighthouse account validator create --help
Creates new validators from an existing EIP-2386 wallet using the EIP-2333 HD key derivation scheme. Creates new validators from an existing EIP-2386 wallet using the EIP-2333 HD key derivation scheme.
USAGE: USAGE:
lighthouse account_manager validator create [FLAGS] [OPTIONS] --wallet-name <WALLET_NAME> --wallet-passphrase <WALLET_PASSWORD_PATH> lighthouse account_manager validator create [FLAGS] [OPTIONS] --wallet-name <WALLET_NAME> --wallet-password <WALLET_PASSWORD_PATH>
FLAGS: FLAGS:
-h, --help Prints help information -h, --help Prints help information
@ -56,7 +56,7 @@ OPTIONS:
The path where the validator directories will be created. Defaults to ~/.lighthouse/validators The path where the validator directories will be created. Defaults to ~/.lighthouse/validators
--wallet-name <WALLET_NAME> Use the wallet identified by this name --wallet-name <WALLET_NAME> Use the wallet identified by this name
--wallet-passphrase <WALLET_PASSWORD_PATH> --wallet-password <WALLET_PASSWORD_PATH>
A path to a file containing the password which will unlock the wallet. A path to a file containing the password which will unlock the wallet.
``` ```
@ -66,12 +66,12 @@ The example assumes that the `wally` wallet was generated from the
[wallet](./wallet-create.md) example. [wallet](./wallet-create.md) example.
```bash ```bash
lighthouse --testnet medalla account validator create --name wally --wallet-passphrase wally.pass --count 1 lighthouse --testnet medalla account validator create --name wally --wallet-password wally.pass --count 1
``` ```
This command will: This command will:
- Derive a new BLS keypair from `wally`, updating it so that it generates a - Derive a single new BLS keypair from `wally`, updating it so that it generates a
new key next time. new key next time.
- Create a new directory in `~/.lighthouse/validators` containing: - Create a new directory in `~/.lighthouse/validators` containing:
- An encrypted keystore containing the validators voting keypair. - An encrypted keystore containing the validators voting keypair.

View File

@ -25,7 +25,7 @@ lighthouse account wallet create --help
Creates a new HD (hierarchical-deterministic) EIP-2386 wallet. Creates a new HD (hierarchical-deterministic) EIP-2386 wallet.
USAGE: USAGE:
lighthouse account_manager wallet create [OPTIONS] --name <WALLET_NAME> --passphrase-file <WALLET_PASSWORD_PATH> lighthouse account_manager wallet create [OPTIONS] --name <WALLET_NAME> --password-file <WALLET_PASSWORD_PATH>
FLAGS: FLAGS:
-h, --help Prints help information -h, --help Prints help information
@ -39,7 +39,7 @@ OPTIONS:
--name <WALLET_NAME> --name <WALLET_NAME>
The wallet will be created with this name. It is not allowed to create two wallets with the same name for The wallet will be created with this name. It is not allowed to create two wallets with the same name for
the same --base-dir. the same --base-dir.
--passphrase-file <WALLET_PASSWORD_PATH> --password-file <WALLET_PASSWORD_PATH>
A path to a file containing the password which will unlock the wallet. If the file does not exist, a random A path to a file containing the password which will unlock the wallet. If the file does not exist, a random
password will be generated and saved at that path. To avoid confusion, if the file does not already exist it password will be generated and saved at that path. To avoid confusion, if the file does not already exist it
must include a '.pass' suffix. must include a '.pass' suffix.
@ -61,7 +61,7 @@ Creates a new wallet named `wally` with a randomly generated password saved
to `./wallet.pass`: to `./wallet.pass`:
```bash ```bash
lighthouse account wallet create --name wally --passphrase-file wally.pass lighthouse account wallet create --name wally --password-file wally.pass
``` ```
> Notes: > Notes:

View File

@ -102,7 +102,7 @@ fn create_wallet<P: AsRef<Path>>(
.arg(CREATE_CMD) .arg(CREATE_CMD)
.arg(format!("--{}", NAME_FLAG)) .arg(format!("--{}", NAME_FLAG))
.arg(&name) .arg(&name)
.arg(format!("--{}", PASSPHRASE_FLAG)) .arg(format!("--{}", PASSWORD_FLAG))
.arg(password.as_ref().as_os_str()) .arg(password.as_ref().as_os_str())
.arg(format!("--{}", MNEMONIC_FLAG)) .arg(format!("--{}", MNEMONIC_FLAG))
.arg(mnemonic.as_ref().as_os_str()), .arg(mnemonic.as_ref().as_os_str()),
@ -238,7 +238,7 @@ impl TestValidator {
.arg(CREATE_CMD) .arg(CREATE_CMD)
.arg(format!("--{}", WALLET_NAME_FLAG)) .arg(format!("--{}", WALLET_NAME_FLAG))
.arg(&self.wallet.name) .arg(&self.wallet.name)
.arg(format!("--{}", WALLET_PASSPHRASE_FLAG)) .arg(format!("--{}", WALLET_PASSWORD_FLAG))
.arg(self.wallet.password_path().into_os_string()) .arg(self.wallet.password_path().into_os_string())
.arg(format!("--{}", VALIDATOR_DIR_FLAG)) .arg(format!("--{}", VALIDATOR_DIR_FLAG))
.arg(self.validator_dir.clone().into_os_string()) .arg(self.validator_dir.clone().into_os_string())