Skip to content

Commit

Permalink
CLI in Lighthouse Book (#4571)
Browse files Browse the repository at this point in the history
* Add cli.sh file

* update bash script

* update Makefile

* update

* modified test-suite

* fix path

* Fix cli.sh permissions

* update cmd

* cli_manual

* Revise to update

* Update directory in Github

* Correct cli.txt directory

* test old cli_manual

* change exit 1

* Update cli and makefile

* Move cli.sh

* remove files

* fix permission

* Indentation and revision

* Fixed permission

* Create new cli folder

* remove dummy

* put a dummy file

* Revise cli.sh

* comment

* function

* remove vm.md

* test make cli

* test

* testing

* testing

* update

* update

* test

* test

* add vm

* change back non-debug mode

* add exist and update for future debug

* revise

* remove troubleshooting part

* update

* add summary.md

* test

* test

* Update Makefile

Co-authored-by: Mac L <[email protected]>

* Update Makefile

Co-authored-by: Mac L <[email protected]>

* Remove help-cli.md and rearrange

* Remove help-cli.md

* Update scripts/cli.sh

Co-authored-by: Mac L <[email protected]>

* Update scripts/cli.sh

Co-authored-by: Mac L <[email protected]>

* remove maxperf

* move then to same line as if

* Fix indent and echo file not found

* To be explicit in replacing the old file

* Add logging when there are changes

* Add local variables

* spacing

* remove cargo fmt

* update .md files

* Edit exit message to avoid confusion

* Remove am and add vm subcommands

* Add cargo-fmt

* Revise test-suite.yml

* Update SUMMARY.md

* Add set -e

* Add vm

* Fix

* Add vm

* set -e

* Remove return 1 and add :

* Small revision

* Fix typo

* Update scripts/cli.sh

Co-authored-by: Mac L <[email protected]>

* Indent

* Update scripts/cli.sh

Co-authored-by: Mac L <[email protected]>

* Remove .exe in Windows

* Fix period with \.

* test

* check diff

* linux commit

* Add cli.sh file

* update bash script

* update Makefile

* update

* modified test-suite

* fix path

* Fix cli.sh permissions

* update cmd

* cli_manual

* Revise to update

* Update directory in Github

* Correct cli.txt directory

* test old cli_manual

* change exit 1

* Update cli and makefile

* Move cli.sh

* remove files

* fix permission

* Indentation and revision

* Fixed permission

* Create new cli folder

* remove dummy

* put a dummy file

* Revise cli.sh

* comment

* function

* remove vm.md

* test make cli

* test

* testing

* testing

* update

* update

* test

* test

* add vm

* change back non-debug mode

* add exist and update for future debug

* revise

* remove troubleshooting part

* update

* add summary.md

* test

* test

* Update Makefile

Co-authored-by: Mac L <[email protected]>

* Update Makefile

Co-authored-by: Mac L <[email protected]>

* Remove help-cli.md and rearrange

* Remove help-cli.md

* Update scripts/cli.sh

Co-authored-by: Mac L <[email protected]>

* Update scripts/cli.sh

Co-authored-by: Mac L <[email protected]>

* remove maxperf

* move then to same line as if

* Fix indent and echo file not found

* To be explicit in replacing the old file

* Add logging when there are changes

* Add local variables

* spacing

* remove cargo fmt

* Edit exit message to avoid confusion

* update .md files

* Remove am and add vm subcommands

* Add cargo-fmt

* Revise test-suite.yml

* Update SUMMARY.md

* Add set -e

* Add vm

* Fix

* Add vm

* set -e

* Remove return 1 and add :

* Small revision

* Fix typo

* Update scripts/cli.sh

Co-authored-by: Mac L <[email protected]>

* Indent

* Update scripts/cli.sh

Co-authored-by: Mac L <[email protected]>

* Remove .exe in Windows

* Fix period with \.

* test

* check diff

* Revert "Merge branch 'book-cli' of https://github.com/chong-he/lighthouse into book-cli"

This reverts commit 314005d, reversing
changes made to a007f61.

* update

* update

* Remove echo diff

* Dockerize

* Remove `-ti`

* take ownership inside container

* fix mistake

* proper escaping, restore ownership afterwards

* try without taking ownership of repo

* update

* add diff for troubleshooting

* binary

* update using linux

* binary

* make file

* remove diff

* add diff

* update progressive balance help text

* Remove diff

---------

Co-authored-by: Mac L <[email protected]>
Co-authored-by: antondlr <[email protected]>
  • Loading branch information
3 people authored Dec 6, 2023
1 parent 52117f4 commit d9d8424
Show file tree
Hide file tree
Showing 11 changed files with 1,386 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,15 @@ jobs:
run: rustup override set beta
- name: Run make
run: make
cli-check:
name: cli-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get latest version of stable Rust
uses: moonrepo/setup-rust@v1
with:
channel: stable
cache-target: release
- name: Run Makefile to trigger the bash script
run: make cli
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ test-network-%:
env FORK_NAME=$* cargo nextest run --release \
--features "fork_from_env,$(TEST_FEATURES)" \
-p network

# Run the tests in the `slasher` crate for all supported database backends.
test-slasher:
cargo nextest run --release -p slasher --features "lmdb,$(TEST_FEATURES)"
Expand All @@ -200,6 +200,12 @@ test-exec-engine:
# test vectors.
test: test-release

# Updates the CLI help text pages in the Lighthouse book.
cli:
docker run --rm --user=root \
-v ${PWD}:/home/runner/actions-runner/lighthouse sigmaprime/github-runner \
bash -c 'cd lighthouse && make && ./scripts/cli.sh'

# Runs the entire test suite, downloading test vectors if required.
test-full: cargo-fmt test-release test-debug test-ef test-exec-engine

Expand Down
7 changes: 7 additions & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
* [MEV](./builders.md)
* [Merge Migration](./merge-migration.md)
* [Late Block Re-orgs](./late-block-re-orgs.md)
* [Built-In Documentation](./help_general.md)
* [Beacon Node](./help_bn.md)
* [Validator Client](./help_vc.md)
* [Validator Manager](./help_vm.md)
* [Create](./help_vm_create.md)
* [Import](./help_vm_import.md)
* [Move](./help_vm_move.md)
* [Contributing](./contributing.md)
* [Development Environment](./setup.md)
* [FAQs](./faq.md)
Expand Down
514 changes: 514 additions & 0 deletions book/src/help_bn.md

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions book/src/help_general.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Lighthouse General Commands

```
Sigma Prime <[email protected]>
Ethereum 2.0 client by Sigma Prime. Provides a full-featured beacon node, a validator client and utilities for managing
validator accounts.
USAGE:
lighthouse [FLAGS] [OPTIONS] [SUBCOMMAND]
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 Enables environment logging giving access to sub-protocol logs such as discv5
and libp2p
-h, --help Prints help information
--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.
-V, --version Prints version information
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.
--debug-level <LEVEL>
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.
--genesis-state-url-timeout <SECONDS>
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]
--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.
--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]
--logfile-format <FORMAT>
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]
--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]
--network <network>
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.
--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.
--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.
--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.
-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.
SUBCOMMANDS:
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]
help Prints this message or the help of the given subcommand(s)
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]
```
Loading

0 comments on commit d9d8424

Please sign in to comment.