Skip to content

Commit e477f04

Browse files
committed
Add CLI flag for gui
1 parent 857ef25 commit e477f04

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

beacon_node/src/cli.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,4 +875,12 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
875875
[experimental]")
876876
.takes_value(false)
877877
)
878+
.arg(
879+
Arg::with_name("gui")
880+
.long("gui")
881+
.hidden(true)
882+
.help("Enable the graphical user interface and all its requirements. \
883+
This is equivalent to --http and --validator-monitor-auto.")
884+
.takes_value(false)
885+
)
878886
}

beacon_node/src/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,12 @@ pub fn get_config<E: EthSpec>(
711711
// Light client server config.
712712
client_config.chain.enable_light_client_server = cli_args.is_present("light-client-server");
713713

714+
// Graphical user interface config.
715+
if cli_args.is_present("gui") {
716+
client_config.http_api.enabled = true;
717+
client_config.validator_monitor_auto = true;
718+
}
719+
714720
Ok(client_config)
715721
}
716722

lighthouse/tests/beacon_node.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,3 +1597,14 @@ fn light_client_server_enabled() {
15971597
.run_with_zero_port()
15981598
.with_config(|config| assert_eq!(config.chain.enable_light_client_server, true));
15991599
}
1600+
1601+
#[test]
1602+
fn gui_flag() {
1603+
CommandLineTest::new()
1604+
.flag("gui", None)
1605+
.run_with_zero_port()
1606+
.with_config(|config| {
1607+
assert!(config.http_api.enabled);
1608+
assert!(config.validator_monitor_auto);
1609+
});
1610+
}

0 commit comments

Comments
 (0)