From ec78c45ea0556ef5bedb5a9de052dfc73116e1be Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Wed, 8 Jan 2020 18:32:41 +0000 Subject: [PATCH 1/3] Prettying up sfw-provider start sequence a bit. --- sfw-provider/src/main.rs | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/sfw-provider/src/main.rs b/sfw-provider/src/main.rs index 9bfc1800ea..d03fe163ec 100644 --- a/sfw-provider/src/main.rs +++ b/sfw-provider/src/main.rs @@ -71,6 +71,7 @@ fn main() { } fn run(matches: &ArgMatches) { + println!("{}", banner()); let config = new_config(matches); let provider = ServiceProvider::new(&config); @@ -78,8 +79,6 @@ fn run(matches: &ArgMatches) { } fn new_config(matches: &ArgMatches) -> provider::Config { - println!("Running the service provider!"); - let directory_server = matches .value_of("directory") .unwrap_or("https://directory.nymtech.net") @@ -113,14 +112,9 @@ fn new_config(matches: &ArgMatches) -> provider::Config { .unwrap_or("/tmp/nym-provider/registered_clients"), ); - println!("The value of mix_host is: {:?}", mix_host); - println!("The value of mix_port is: {:?}", mix_port); - println!("The value of client_host is: {:?}", client_host); - println!("The value of client_port is: {:?}", client_port); - println!("The value of key is: {:?}", key_pair.private.clone()); - println!("The value of store_dir is: {:?}", store_dir); + println!("store_dir is: {:?}", store_dir); println!( - "The value of registered_client_ledger_dir is: {:?}", + "registered_client_ledger_dir is: {:?}", registered_client_ledger_dir ); @@ -136,14 +130,8 @@ fn new_config(matches: &ArgMatches) -> provider::Config { .next() .expect("Failed to extract the socket address from the iterator"); - println!( - "The full combined mix socket address is {}", - mix_socket_address - ); - println!( - "The full combined client socket address is {}", - client_socket_address - ); + println!("Listening for mixnet packets on {}", mix_socket_address); + println!("Listening for client requests on {}", client_socket_address); provider::Config { mix_socket_address, From 7a3d61374f63010c6eb6e3eb35b195119714a8db Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Wed, 8 Jan 2020 18:53:12 +0000 Subject: [PATCH 2/3] Providing a nicer error than "failed on unwrap()" when topology retrieval fails --- clients/nym-client/src/clients/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/nym-client/src/clients/mod.rs b/clients/nym-client/src/clients/mod.rs index a8f0789c5b..4737c7a70a 100644 --- a/clients/nym-client/src/clients/mod.rs +++ b/clients/nym-client/src/clients/mod.rs @@ -228,7 +228,7 @@ impl NymClient { let provider_client_listener_address: SocketAddr = topology .get_mix_provider_nodes() .first() - .unwrap() + .expect("Could not get a provider from the supplied network topology, are you using the right directory server?") .client_listener; let mut provider_client = provider_client::ProviderClient::new( From 6c3e7b625698f5a4c926e276bfb71aae5906c824 Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Wed, 8 Jan 2020 19:33:14 +0000 Subject: [PATCH 3/3] nym-client: taking `run` right out of circulation --- clients/nym-client/src/commands/mod.rs | 1 - clients/nym-client/src/main.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/clients/nym-client/src/commands/mod.rs b/clients/nym-client/src/commands/mod.rs index 83edeba8a9..1b0fe864f6 100644 --- a/clients/nym-client/src/commands/mod.rs +++ b/clients/nym-client/src/commands/mod.rs @@ -1,4 +1,3 @@ pub mod init; -pub mod run; pub mod tcpsocket; pub mod websocket; diff --git a/clients/nym-client/src/main.rs b/clients/nym-client/src/main.rs index ad038e45b5..4efac3d1d3 100644 --- a/clients/nym-client/src/main.rs +++ b/clients/nym-client/src/main.rs @@ -109,7 +109,6 @@ pub mod built_info { fn execute(matches: ArgMatches) -> Result<(), String> { match matches.subcommand() { ("init", Some(m)) => Ok(commands::init::execute(m)), - ("run", Some(m)) => Ok(commands::run::execute(m)), ("tcpsocket", Some(m)) => Ok(commands::tcpsocket::execute(m)), ("websocket", Some(m)) => Ok(commands::websocket::execute(m)), _ => Err(usage()),