Tidy grpc and misc things

This commit is contained in:
Paul Hauner
2019-11-23 12:16:41 +11:00
parent 9e5a9cefe2
commit ef4e12da51
9 changed files with 17 additions and 79 deletions

View File

@@ -9,9 +9,6 @@ lazy_static! {
Config::default()
};
static ref DEFAULT_SERVER_GRPC_PORT: String = {
format!("{}", DEFAULTS.server_grpc_port)
};
static ref DEFAULT_SERVER_HTTP_PORT: String = {
format!("{}", DEFAULTS.server_http_port)
};
@@ -54,15 +51,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.default_value(&DEFAULTS.server)
.takes_value(true),
)
.arg(
Arg::with_name("server-grpc-port")
.long("server-grpc-port")
.short("g")
.value_name("PORT")
.help("Port to use for gRPC API connection to the server.")
.default_value(&DEFAULT_SERVER_GRPC_PORT)
.takes_value(true),
)
.arg(
Arg::with_name("server-http-port")
.long("server-http-port")

View File

@@ -30,8 +30,6 @@ pub struct Config {
pub log_file: PathBuf,
/// The server at which the Beacon Node can be contacted
pub server: String,
/// The gRPC port on the server
pub server_grpc_port: u16,
/// The HTTP port on the server, for the REST API.
pub server_http_port: u16,
/// The number of slots per epoch.
@@ -46,7 +44,6 @@ impl Default for Config {
key_source: <_>::default(),
log_file: PathBuf::from(""),
server: "localhost".into(),
server_grpc_port: 5051,
server_http_port: 5052,
slots_per_epoch: MainnetEthSpec::slots_per_epoch(),
}
@@ -72,12 +69,6 @@ impl Config {
.map_err(|e| format!("Unable to parse HTTP port: {:?}", e))?;
}
if let Some(port) = cli_args.value_of("server-grpc-port") {
client_config.server_grpc_port = port
.parse::<u16>()
.map_err(|e| format!("Unable to parse gRPC port: {:?}", e))?;
}
let client_config = match cli_args.subcommand() {
("testnet", Some(sub_cli_args)) => {
if cli_args.is_present("eth2-config") && sub_cli_args.is_present("bootstrap") {