Renamed directory arguments to validator (#408)
This commit is contained in:
committed by
GitHub
parent
607297bf54
commit
d7985ef05d
@@ -47,9 +47,9 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
|
||||
.help("Id of the gateway we are going to connect to.")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(Arg::with_name("directory")
|
||||
.long("directory")
|
||||
.help("Address of the directory server the client is getting topology from")
|
||||
.arg(Arg::with_name("validator")
|
||||
.long("validator")
|
||||
.help("Address of the validator server the client is getting topology from")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(Arg::with_name("disable-socket")
|
||||
@@ -101,8 +101,8 @@ async fn register_with_gateway(
|
||||
.expect("failed to register with the gateway!")
|
||||
}
|
||||
|
||||
async fn gateway_details(directory_server: &str, gateway_id: &str) -> gateway::Node {
|
||||
let validator_client_config = validator_client::Config::new(directory_server.to_string());
|
||||
async fn gateway_details(validator_server: &str, gateway_id: &str) -> gateway::Node {
|
||||
let validator_client_config = validator_client::Config::new(validator_server.to_string());
|
||||
let validator_client = validator_client::Client::new(validator_client_config);
|
||||
let topology = validator_client.get_active_topology().await.unwrap();
|
||||
let nym_topology: NymTopology = topology.into();
|
||||
|
||||
@@ -20,8 +20,8 @@ pub(crate) mod run;
|
||||
pub(crate) mod upgrade;
|
||||
|
||||
pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Config {
|
||||
if let Some(directory) = matches.value_of("directory") {
|
||||
config.get_base_mut().with_custom_validator(directory);
|
||||
if let Some(validator) = matches.value_of("validator") {
|
||||
config.get_base_mut().with_custom_validator(validator);
|
||||
}
|
||||
|
||||
if let Some(gateway_id) = matches.value_of("gateway") {
|
||||
|
||||
@@ -30,9 +30,9 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
|
||||
.required(true)
|
||||
)
|
||||
// the rest of arguments are optional, they are used to override settings in config file
|
||||
.arg(Arg::with_name("directory")
|
||||
.long("directory")
|
||||
.help("Address of the directory server the client is getting topology from")
|
||||
.arg(Arg::with_name("validator")
|
||||
.long("validator")
|
||||
.help("Address of the validator server the client is getting topology from")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(Arg::with_name("gateway")
|
||||
|
||||
@@ -52,9 +52,9 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
|
||||
.help("Id of the gateway we are going to connect to.")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(Arg::with_name("directory")
|
||||
.long("directory")
|
||||
.help("Address of the directory server the client is getting topology from")
|
||||
.arg(Arg::with_name("validator")
|
||||
.long("validator")
|
||||
.help("Address of the validator server the client is getting topology from")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(Arg::with_name("port")
|
||||
@@ -102,8 +102,8 @@ async fn register_with_gateway(
|
||||
.expect("failed to register with the gateway!")
|
||||
}
|
||||
|
||||
async fn gateway_details(directory_server: &str, gateway_id: &str) -> gateway::Node {
|
||||
let validator_client_config = validator_client::Config::new(directory_server.to_string());
|
||||
async fn gateway_details(validator_server: &str, gateway_id: &str) -> gateway::Node {
|
||||
let validator_client_config = validator_client::Config::new(validator_server.to_string());
|
||||
let validator_client = validator_client::Client::new(validator_client_config);
|
||||
let topology = validator_client.get_active_topology().await.unwrap();
|
||||
let nym_topology: NymTopology = topology.into();
|
||||
|
||||
@@ -20,8 +20,8 @@ pub(crate) mod run;
|
||||
pub(crate) mod upgrade;
|
||||
|
||||
pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Config {
|
||||
if let Some(directory) = matches.value_of("directory") {
|
||||
config.get_base_mut().with_custom_validator(directory);
|
||||
if let Some(validator) = matches.value_of("validator") {
|
||||
config.get_base_mut().with_custom_validator(validator);
|
||||
}
|
||||
|
||||
if let Some(gateway_id) = matches.value_of("gateway") {
|
||||
|
||||
@@ -40,9 +40,9 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
|
||||
.help("Address of the socks5 provider to send messages to.")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(Arg::with_name("directory")
|
||||
.long("directory")
|
||||
.help("Address of the directory server the client is getting topology from")
|
||||
.arg(Arg::with_name("validator")
|
||||
.long("validator")
|
||||
.help("Address of the validator server the client is getting topology from")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(Arg::with_name("gateway")
|
||||
|
||||
Reference in New Issue
Block a user