Compare commits

...

1 Commits

Author SHA1 Message Date
durch 33e7d1bba9 Replace println with eprintln 2023-01-17 13:19:23 +01:00
5 changed files with 18 additions and 18 deletions
+5 -5
View File
@@ -104,10 +104,10 @@ impl From<Init> for OverrideConfig {
}
pub async fn execute(args: Init, output: OutputFormat) -> Result<(), Box<dyn Error + Send + Sync>> {
println!("Initialising gateway {}...", args.id);
eprintln!("Initialising gateway {}...", args.id);
let already_init = if Config::default_config_file_path(Some(&args.id)).exists() {
println!(
eprintln!(
"Gateway \"{}\" was already initialised before! Config information will be \
overwritten (but keys will be kept)!",
args.id
@@ -147,15 +147,15 @@ pub async fn execute(args: Init, output: OutputFormat) -> Result<(), Box<dyn Err
)
.expect("Failed to save identity keys");
println!("Saved identity and mixnet sphinx keypairs");
eprintln!("Saved identity and mixnet sphinx keypairs");
}
let config_save_location = config.get_config_file_save_location();
config
.save_to_file(None)
.expect("Failed to save the config file");
println!("Saved configuration file to {:?}", config_save_location);
println!("Gateway configuration completed.\n\n\n");
eprintln!("Saved configuration file to {:?}", config_save_location);
eprintln!("Gateway configuration completed.\n\n\n");
Ok(crate::node::create_gateway(config)
.await
+5 -5
View File
@@ -102,14 +102,14 @@ impl From<Run> for OverrideConfig {
}
fn show_binding_warning(address: String) {
println!("\n##### NOTE #####");
println!(
eprintln!("\n##### NOTE #####");
eprintln!(
"\nYou are trying to bind to {} - you might not be accessible to other nodes\n\
You can ignore this warning if you're running setup on a local network \n\
or have set a custom 'announce-host'",
address
);
println!("\n\n");
eprintln!("\n\n");
}
fn special_addresses() -> Vec<&'static str> {
@@ -118,7 +118,7 @@ fn special_addresses() -> Vec<&'static str> {
pub async fn execute(args: Run, output: OutputFormat) -> Result<(), Box<dyn Error + Send + Sync>> {
let id = args.id.clone();
println!("Starting gateway {id}...");
eprintln!("Starting gateway {id}...");
let config = build_config(id, args)?;
ensure_config_version_compatibility(&config)?;
@@ -128,7 +128,7 @@ pub async fn execute(args: Run, output: OutputFormat) -> Result<(), Box<dyn Erro
}
let mut gateway = crate::node::create_gateway(config).await;
println!(
eprintln!(
"\nTo bond your gateway you will need to install the Nym wallet, go to https://nymtech.net/get-involved and select the Download button.\n\
Select the correct version and install it to your machine. You will need to provide the following: \n ");
gateway.print_node_details(output)?;
+3 -3
View File
@@ -69,19 +69,19 @@ fn print_signed_address(
ensure_correct_bech32_prefix(&wallet_address)?;
let signature = private_key.sign_text(wallet_address.as_ref());
println!("The base58-encoded signature on '{wallet_address}' is: {signature}");
eprintln!("The base58-encoded signature on '{wallet_address}' is: {signature}");
Ok(())
}
fn print_signed_text(private_key: &identity::PrivateKey, text: &str) {
println!(
eprintln!(
"Signing the text {:?} using your mixnode's Ed25519 identity key...",
text
);
let signature = private_key.sign_text(text);
println!(
eprintln!(
"The base58-encoded signature on '{}' is: {}",
text, signature
);
+3 -3
View File
@@ -22,7 +22,7 @@ fn fail_upgrade<D1: Display, D2: Display>(from_version: D1, to_version: D2) -> !
}
fn print_start_upgrade<D1: Display, D2: Display>(from: D1, to: D2) {
println!(
eprintln!(
"\n==================\nTrying to upgrade gateway from {} to {} ...",
from, to
);
@@ -36,7 +36,7 @@ fn print_failed_upgrade<D1: Display, D2: Display>(from: D1, to: D2) {
}
fn print_successful_upgrade<D1: Display, D2: Display>(from: D1, to: D2) {
println!(
eprintln!(
"Upgrade from {} to {} was successful!\n==================\n",
from, to
);
@@ -121,7 +121,7 @@ fn do_upgrade(mut config: Config, args: &Upgrade, package_version: Version) {
let config_version = parse_config_version(&config);
if config_version == package_version {
println!("You're using the most recent version!");
eprintln!("You're using the most recent version!");
return;
}
+2 -2
View File
@@ -122,8 +122,8 @@ where
let identity_keypair = load_identity_keys(&pathfinder);
let Some(address) = self.config.get_wallet_address() else {
let error_message = "Error: gateway hasn't set its wallet address".red();
println!("{error_message}");
println!("Exiting...");
eprintln!("{error_message}");
eprintln!("Exiting...");
process::exit(1);
};
// perform extra validation to ensure we have correct prefix