mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
Parse http CLI args for HTTP server
This commit is contained in:
@@ -140,6 +140,19 @@ impl ClientConfig {
|
||||
}
|
||||
}
|
||||
|
||||
/* HTTP related arguments */
|
||||
|
||||
if args.is_present("http") {
|
||||
config.http_conf.enabled = true;
|
||||
}
|
||||
|
||||
if let Some(listen_address) = args.value_of("http-address") {
|
||||
config.http_conf.listen_address = listen_address.to_string();
|
||||
}
|
||||
if let Some(listen_port) = args.value_of("http-port") {
|
||||
config.http_conf.listen_port = listen_port.to_string();
|
||||
}
|
||||
|
||||
match args.value_of("db") {
|
||||
Some("disk") => config.db_type = DBType::Disk,
|
||||
Some("memory") => config.db_type = DBType::Memory,
|
||||
|
||||
@@ -115,13 +115,17 @@ where
|
||||
// Start the `http_server` service.
|
||||
//
|
||||
// Note: presently we are ignoring the config and _always_ starting a HTTP server.
|
||||
let http_exit_signal = Some(http_server::start_service(
|
||||
&config.http_conf,
|
||||
executor,
|
||||
network_send,
|
||||
beacon_chain.clone(),
|
||||
&log,
|
||||
));
|
||||
let http_exit_signal = if config.http_conf.enabled {
|
||||
Some(http_server::start_service(
|
||||
&config.http_conf,
|
||||
executor,
|
||||
network_send,
|
||||
beacon_chain.clone(),
|
||||
&log,
|
||||
))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let (slot_timer_exit_signal, exit) = exit_future::signal();
|
||||
if let Ok(Some(duration_to_next_slot)) = beacon_chain.slot_clock.duration_to_next_slot() {
|
||||
|
||||
Reference in New Issue
Block a user