diff --git a/beacon_node/client/src/client_config.rs b/beacon_node/client/src/client_config.rs index 4a4774282..cad287f2c 100644 --- a/beacon_node/client/src/client_config.rs +++ b/beacon_node/client/src/client_config.rs @@ -97,6 +97,10 @@ impl ClientConfig { /* RPC related arguments */ + if args.is_present("rpc") { + config.rpc_conf.enabled = true; + } + if let Some(rpc_address) = args.value_of("rpc-address") { if let Ok(listen_address) = rpc_address.parse::() { config.rpc_conf.listen_address = listen_address; diff --git a/beacon_node/client/src/lib.rs b/beacon_node/client/src/lib.rs index e6d08ac54..914e47fcf 100644 --- a/beacon_node/client/src/lib.rs +++ b/beacon_node/client/src/lib.rs @@ -1,7 +1,6 @@ extern crate slog; mod client_config; - pub mod client_types; pub mod error; pub mod notifier; @@ -61,7 +60,9 @@ impl Client { )?; // spawn the RPC server - rpc::start_server(&config.rpc_conf, &log); + if config.rpc_conf.enabled { + rpc::start_server(&config.rpc_conf, &log); + } Ok(Client { config, diff --git a/beacon_node/src/main.rs b/beacon_node/src/main.rs index 130353d77..ea74c7376 100644 --- a/beacon_node/src/main.rs +++ b/beacon_node/src/main.rs @@ -25,7 +25,7 @@ fn main() { ) .arg( Arg::with_name("listen_address") - .long("listen_address") + .long("listen-address") .value_name("Listen Address") .help("The Network address to listen for p2p connections.") .takes_value(true), @@ -39,21 +39,21 @@ fn main() { ) .arg( Arg::with_name("rpc") - .long("Enable RPC") + .long("rpc") .value_name("RPC") .help("Enable the RPC server.") .takes_value(false), ) .arg( Arg::with_name("rpc-address") - .long("rpc address") + .long("rpc-address") .value_name("RPCADDRESS") .help("Listen address for RPC endpoint.") .takes_value(true), ) .arg( Arg::with_name("rpc-port") - .long("rpc port") + .long("rpc-port") .value_name("RPCPORT") .help("Listen port for RPC endpoint.") .takes_value(true),