Skip to content

Commit

Permalink
Add CLI flag for gui requirements (#3731)
Browse files Browse the repository at this point in the history
## Issue Addressed

#3723

## Proposed Changes

Adds a new CLI flag `--gui` which enables all the various flags required for the gui to function properly.
Currently enables the `--http` and `--validator-monitor-auto` flags.
  • Loading branch information
macladson committed Nov 25, 2022
1 parent bf533c8 commit bb08007
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions beacon_node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,4 +875,12 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
[experimental]")
.takes_value(false)
)
.arg(
Arg::with_name("gui")
.long("gui")
.hidden(true)
.help("Enable the graphical user interface and all its requirements. \
This is equivalent to --http and --validator-monitor-auto.")
.takes_value(false)
)
}
6 changes: 6 additions & 0 deletions beacon_node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,12 @@ pub fn get_config<E: EthSpec>(
// Light client server config.
client_config.chain.enable_light_client_server = cli_args.is_present("light-client-server");

// Graphical user interface config.
if cli_args.is_present("gui") {
client_config.http_api.enabled = true;
client_config.validator_monitor_auto = true;
}

Ok(client_config)
}

Expand Down
11 changes: 11 additions & 0 deletions lighthouse/tests/beacon_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1597,3 +1597,14 @@ fn light_client_server_enabled() {
.run_with_zero_port()
.with_config(|config| assert_eq!(config.chain.enable_light_client_server, true));
}

#[test]
fn gui_flag() {
CommandLineTest::new()
.flag("gui", None)
.run_with_zero_port()
.with_config(|config| {
assert!(config.http_api.enabled);
assert!(config.validator_monitor_auto);
});
}

0 comments on commit bb08007

Please sign in to comment.