From b594dc212985c6db09c0dcc0ba8abe63dc756fbb Mon Sep 17 00:00:00 2001 From: Mac L Date: Wed, 16 Nov 2022 11:03:19 +1100 Subject: [PATCH] Add CLI flag for gui --- beacon_node/src/cli.rs | 8 ++++++++ beacon_node/src/config.rs | 6 ++++++ lighthouse/tests/beacon_node.rs | 11 +++++++++++ 3 files changed, 25 insertions(+) diff --git a/beacon_node/src/cli.rs b/beacon_node/src/cli.rs index b00d56513cc..44a995176d1 100644 --- a/beacon_node/src/cli.rs +++ b/beacon_node/src/cli.rs @@ -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) + ) } diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index 472708ecb8a..85f02249826 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -708,6 +708,12 @@ pub fn get_config( client_config.chain.builder_fallback_disable_checks = cli_args.is_present("builder-fallback-disable-checks"); + // 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) } diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index 7b46fd6a913..d39235cb136 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -1614,3 +1614,14 @@ fn light_client_server_enabled() { .run_with_zero_port() .with_config(|config| assert_eq!(config.network.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); + }); +}