Skip to content

Commit

Permalink
help text, text width, and a few flag fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eserilev committed Apr 15, 2024
1 parent e23b96b commit 7f4af13
Show file tree
Hide file tree
Showing 20 changed files with 1,351 additions and 770 deletions.
13 changes: 13 additions & 0 deletions account_manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ mod common;
pub mod validator;
pub mod wallet;

use clap::Arg;
use clap::ArgAction;
use clap::ArgMatches;
use clap::Command;
use clap_utils::FLAG_HEADER;
use environment::Environment;
use types::EthSpec;

Expand All @@ -17,6 +20,16 @@ pub fn cli_app() -> Command {
Command::new(CMD)
.visible_aliases(["a", "am", "account", CMD])
.about("Utilities for generating and managing Ethereum 2.0 accounts.")
.display_order(0)
.arg(
Arg::new("help")
.long("help")
.short('h')
.help("Prints help information")
.action(ArgAction::HelpLong)
.display_order(0)
.help_heading(FLAG_HEADER)
)
.subcommand(wallet::cli_app())
.subcommand(validator::cli_app())
}
Expand Down
10 changes: 10 additions & 0 deletions account_manager/src/validator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub mod slashing_protection;

use crate::{VALIDATOR_DIR_FLAG, VALIDATOR_DIR_FLAG_ALIAS};
use clap::{Arg, ArgAction, ArgMatches, Command};
use clap_utils::FLAG_HEADER;
use directory::{parse_path_or_default_with_flag, DEFAULT_VALIDATOR_DIR};
use environment::Environment;
use std::path::PathBuf;
Expand All @@ -19,6 +20,15 @@ pub fn cli_app() -> Command {
Command::new(CMD)
.display_order(0)
.about("Provides commands for managing Eth2 validators.")
.arg(
Arg::new("help")
.long("help")
.short('h')
.help("Prints help information")
.action(ArgAction::HelpLong)
.display_order(0)
.help_heading(FLAG_HEADER)
)
.arg(
Arg::new(VALIDATOR_DIR_FLAG)
.long(VALIDATOR_DIR_FLAG)
Expand Down
10 changes: 10 additions & 0 deletions account_manager/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod recover;

use crate::WALLETS_DIR_FLAG;
use clap::{Arg, ArgAction, ArgMatches, Command};
use clap_utils::FLAG_HEADER;
use directory::{ensure_dir_exists, parse_path_or_default_with_flag, DEFAULT_WALLET_DIR};
use std::path::PathBuf;

Expand All @@ -13,6 +14,15 @@ pub fn cli_app() -> Command {
Command::new(CMD)
.about("Manage wallets, from which validator keys can be derived.")
.display_order(0)
.arg(
Arg::new("help")
.long("help")
.short('h')
.help("Prints help information")
.action(ArgAction::HelpLong)
.display_order(0)
.help_heading(FLAG_HEADER)
)
.arg(
Arg::new(WALLETS_DIR_FLAG)
.long(WALLETS_DIR_FLAG)
Expand Down
12 changes: 11 additions & 1 deletion beacon_node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use strum::VariantNames;

pub fn cli_app() -> Command {
Command::new("beacon_node")
.display_order(0)
.visible_aliases(["b", "bn", "beacon"])
.version(crate_version!())
.author("Sigma Prime <contact@sigmaprime.io>")
Expand All @@ -14,6 +15,15 @@ pub fn cli_app() -> Command {
/*
* Configuration directory locations.
*/
.arg(
Arg::new("help")
.long("help")
.short('h')
.help("Prints help information")
.action(ArgAction::HelpLong)
.display_order(0)
.help_heading(FLAG_HEADER)
)
.arg(
Arg::new("network-dir")
.long("network-dir")
Expand Down Expand Up @@ -271,7 +281,7 @@ pub fn cli_app() -> Command {
local node on this address. This will update the `ip4` or `ip6` ENR fields \
accordingly. To update both, set this flag twice with the different values.")
.action(ArgAction::Append)
.num_args(0..=2)
.num_args(1..=2)
.display_order(0)
)
.arg(
Expand Down
2 changes: 0 additions & 2 deletions beacon_node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,6 @@ pub fn parse_listening_addresses(
.map_err(|parse_error| format!("Failed to parse --port6 as an integer: {parse_error}"))?
.unwrap_or(9090);

println!("{}", port);

// parse the possible discovery ports.
let maybe_disc_port = cli_args
.get_one::<String>("discovery-port")
Expand Down
748 changes: 464 additions & 284 deletions book/src/help_bn.md

Large diffs are not rendered by default.

177 changes: 110 additions & 67 deletions book/src/help_general.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,139 @@
# Lighthouse General Commands

```
Ethereum 2.0 client by Sigma Prime. Provides a full-featured beacon node, a validator client and utilities for managing validator
accounts.
Ethereum 2.0 client by Sigma Prime. Provides a full-featured beacon node, a
validator client and utilities for managing validator accounts.
Usage: lighthouse [OPTIONS] [COMMAND]
Commands:
database_manager Manage a beacon node database [aliases: db]
validator_manager Utilities for managing a Lighthouse validator client via the HTTP API. [aliases: vm, validator-manager,
validator_manager]
beacon_node The primary component which connects to the Ethereum 2.0 P2P network and downloads, verifies and stores
blocks. Provides a HTTP API for querying the beacon chain and publishing messages to the network. [aliases:
b, bn, beacon]
boot_node Start a special Lighthouse process that only serves as a discv5 boot-node. This process will *not* import
blocks or perform most typical beacon node functions. Instead, it will simply run the discv5 service and
assist nodes on the network to discover each other. This is the recommended way to provide a network
boot-node since it has a reduced attack surface compared to a full beacon node.
validator_client When connected to a beacon node, performs the duties of a staked validator (e.g., proposing blocks and
attestations). [aliases: v, vc, validator]
account_manager Utilities for generating and managing Ethereum 2.0 accounts. [aliases: a, am, account, account_manager]
help Print this message or the help of the given subcommand(s)
account_manager
Utilities for generating and managing Ethereum 2.0 accounts. [aliases:
a, am, account, account_manager]
beacon_node
The primary component which connects to the Ethereum 2.0 P2P network
and downloads, verifies and stores blocks. Provides a HTTP API for
querying the beacon chain and publishing messages to the network.
[aliases: b, bn, beacon]
boot_node
Start a special Lighthouse process that only serves as a discv5
boot-node. This process will *not* import blocks or perform most
typical beacon node functions. Instead, it will simply run the discv5
service and assist nodes on the network to discover each other. This
is the recommended way to provide a network boot-node since it has a
reduced attack surface compared to a full beacon node.
database_manager
Manage a beacon node database [aliases: db]
validator_client
When connected to a beacon node, performs the duties of a staked
validator (e.g., proposing blocks and attestations). [aliases: v, vc,
validator]
validator_manager
Utilities for managing a Lighthouse validator client via the HTTP API.
[aliases: vm, validator-manager, validator_manager]
help
Print this message or the help of the given subcommand(s)
Options:
-d, --datadir <DIR>
Used to specify a custom root data directory for lighthouse keys and databases. Defaults to $HOME/.lighthouse/{network}
where network is the value of the `network` flag Note: Users should specify separate custom datadirs for different
networks.
Used to specify a custom root data directory for lighthouse keys and
databases. Defaults to $HOME/.lighthouse/{network} where network is
the value of the `network` flag Note: Users should specify separate
custom datadirs for different networks.
--debug-level <LEVEL>
Specifies the verbosity level used when emitting logs to the terminal. [default: info] [possible values: info, debug,
trace, warn, error, crit]
Specifies the verbosity level used when emitting logs to the terminal.
[default: info] [possible values: info, debug, trace, warn, error,
crit]
--genesis-state-url <URL>
A URL of a beacon-API compatible server from which to download the genesis state. Checkpoint sync server URLs can generally
be used with this flag. If not supplied, a default URL or the --checkpoint-sync-url may be used. If the genesis state is
already included in this binary then this value will be ignored.
A URL of a beacon-API compatible server from which to download the
genesis state. Checkpoint sync server URLs can generally be used with
this flag. If not supplied, a default URL or the --checkpoint-sync-url
may be used. If the genesis state is already included in this binary
then this value will be ignored.
--genesis-state-url-timeout <SECONDS>
The timeout in seconds for the request to --genesis-state-url. [default: 180]
The timeout in seconds for the request to --genesis-state-url.
[default: 180]
--log-format <FORMAT>
Specifies the log format used when emitting logs to the terminal. [possible values: JSON]
Specifies the log format used when emitting logs to the terminal.
[possible values: JSON]
--logfile <FILE>
File path where the log file will be stored. Once it grows to the value specified in `--logfile-max-size` a new log file is
generated where future logs are stored. Once the number of log files exceeds the value specified in `--logfile-max-number`
the oldest log file will be overwritten.
File path where the log file will be stored. Once it grows to the
value specified in `--logfile-max-size` a new log file is generated
where future logs are stored. Once the number of log files exceeds the
value specified in `--logfile-max-number` the oldest log file will be
overwritten.
--logfile-debug-level <LEVEL>
The verbosity level used when emitting logs to the log file. [default: debug] [possible values: info, debug, trace, warn,
error, crit]
The verbosity level used when emitting logs to the log file. [default:
debug] [possible values: info, debug, trace, warn, error, crit]
--logfile-format <FORMAT>
Specifies the log format used when emitting logs to the logfile. [possible values: DEFAULT, JSON]
Specifies the log format used when emitting logs to the logfile.
[possible values: DEFAULT, JSON]
--logfile-max-number <COUNT>
The maximum number of log files that will be stored. If set to 0, background file logging is disabled. [default: 5]
The maximum number of log files that will be stored. If set to 0,
background file logging is disabled. [default: 5]
--logfile-max-size <SIZE>
The maximum size (in MB) each log file can grow to before rotating. If set to 0, background file logging is disabled.
[default: 200]
The maximum size (in MB) each log file can grow to before rotating. If
set to 0, background file logging is disabled. [default: 200]
--network <network>
Name of the Eth2 chain Lighthouse will sync and follow. [possible values: mainnet, prater, goerli, gnosis, chiado, sepolia,
holesky]
Name of the Eth2 chain Lighthouse will sync and follow. [possible
values: mainnet, prater, goerli, gnosis, chiado, sepolia, holesky]
--safe-slots-to-import-optimistically <INTEGER>
Used to coordinate manual overrides of the SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY parameter. This flag should only be used if
the user has a clear understanding that the broad Ethereum community has elected to override this parameter in the event of
an attack at the PoS transition block. Incorrect use of this flag can cause your node to possibly accept an invalid chain
or sync more slowly. Be extremely careful with this flag.
Used to coordinate manual overrides of the
SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY parameter. This flag should only
be used if the user has a clear understanding that the broad Ethereum
community has elected to override this parameter in the event of an
attack at the PoS transition block. Incorrect use of this flag can
cause your node to possibly accept an invalid chain or sync more
slowly. Be extremely careful with this flag.
-t, --testnet-dir <DIR>
Path to directory containing eth2_testnet specs. Defaults to a hard-coded Lighthouse testnet. Only effective if there is no
existing database.
Path to directory containing eth2_testnet specs. Defaults to a
hard-coded Lighthouse testnet. Only effective if there is no existing
database.
--terminal-block-hash-epoch-override <EPOCH>
Used to coordinate manual overrides to the TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH parameter. This flag should only be used if
the user has a clear understanding that the broad Ethereum community has elected to override the terminal PoW block.
Incorrect use of this flag will cause your node to experience a consensus failure. Be extremely careful with this flag.
Used to coordinate manual overrides to the
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH parameter. This flag should only
be used if the user has a clear understanding that the broad Ethereum
community has elected to override the terminal PoW block. Incorrect
use of this flag will cause your node to experience a consensus
failure. Be extremely careful with this flag.
--terminal-block-hash-override <TERMINAL_BLOCK_HASH>
Used to coordinate manual overrides to the TERMINAL_BLOCK_HASH parameter. This flag should only be used if the user has a
clear understanding that the broad Ethereum community has elected to override the terminal PoW block. Incorrect use of this
flag will cause your node to experience a consensus failure. Be extremely careful with this flag.
Used to coordinate manual overrides to the TERMINAL_BLOCK_HASH
parameter. This flag should only be used if the user has a clear
understanding that the broad Ethereum community has elected to
override the terminal PoW block. Incorrect use of this flag will cause
your node to experience a consensus failure. Be extremely careful with
this flag.
--terminal-total-difficulty-override <INTEGER>
Used to coordinate manual overrides to the TERMINAL_TOTAL_DIFFICULTY parameter. Accepts a 256-bit decimal integer (not a
hex value). This flag should only be used if the user has a clear understanding that the broad Ethereum community has
elected to override the terminal difficulty. Incorrect use of this flag will cause your node to experience a consensus
failure. Be extremely careful with this flag.
-h, --help
Print help
Used to coordinate manual overrides to the TERMINAL_TOTAL_DIFFICULTY
parameter. Accepts a 256-bit decimal integer (not a hex value). This
flag should only be used if the user has a clear understanding that
the broad Ethereum community has elected to override the terminal
difficulty. Incorrect use of this flag will cause your node to
experience a consensus failure. Be extremely careful with this flag.
-V, --version
Print version
Flags:
--disable-log-timestamp If present, do not include timestamps in logging output.
--disable-malloc-tuning If present, do not configure the system allocator. Providing this flag will generally increase
memory usage, it should only be provided when debugging specific memory allocation issues.
-l DEPRECATED Enables environment logging giving access to sub-protocol logs such as discv5 and
libp2p
--log-color Force outputting colors when emitting logs to the terminal.
--logfile-compress If present, compress old log files. This can help reduce the space needed to store old logs.
--logfile-no-restricted-perms If present, log files will be generated as world-readable meaning they can be read by any user
on the machine. Note that logs can often contain sensitive information about your validator and
so this flag should be used with caution. For Windows users, the log file permissions will be
inherited from the parent folder.
```
--disable-log-timestamp
If present, do not include timestamps in logging output.
--disable-malloc-tuning
If present, do not configure the system allocator. Providing this flag
will generally increase memory usage, it should only be provided when
debugging specific memory allocation issues.
-h, --help
Prints help information
-l
DEPRECATED Enables environment logging giving access to sub-protocol
logs such as discv5 and libp2p
--log-color
Force outputting colors when emitting logs to the terminal.
--logfile-compress
If present, compress old log files. This can help reduce the space
needed to store old logs.
--logfile-no-restricted-perms
If present, log files will be generated as world-readable meaning they
can be read by any user on the machine. Note that logs can often
contain sensitive information about your validator and so this flag
should be used with caution. For Windows users, the log file
permissions will be inherited from the parent folder.
```<style> .content main {max-width:88%;} </style>
Loading

0 comments on commit 7f4af13

Please sign in to comment.