From cd5fff92ad9be15accea0ecf46ba3313bfd3da6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Fri, 6 May 2022 11:46:17 +0200 Subject: [PATCH] Added network information to --version (or --help) command (#1256) * Added network information to --version (or --help) command * Updated changelog --- CHANGELOG.md | 4 ++++ clients/native/src/main.rs | 4 ++++ clients/socks5/src/main.rs | 4 ++++ gateway/src/main.rs | 4 ++++ mixnode/src/main.rs | 4 ++++ validator-api/src/main.rs | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b811792c8..c60aac327d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,13 @@ ## [Unreleased] +### Added + - validator-api: add Swagger to document the REST API ([#1249]). +- all: added network compilation target to `--help` (or `--version`) commands ([#1256]). [#1249]: https://github.com/nymtech/nym/pull/1249 +[#1256]: https://github.com/nymtech/nym/pull/1256 ## [nym-wallet-v1.0.4](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.4) (2022-05-04) diff --git a/clients/native/src/main.rs b/clients/native/src/main.rs index a77fd72412..fc9a475b9b 100644 --- a/clients/native/src/main.rs +++ b/clients/native/src/main.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use clap::{crate_version, App, ArgMatches}; +use network_defaults::DEFAULT_NETWORK; pub mod client; pub mod commands; @@ -67,6 +68,7 @@ fn long_version() -> String { {:<20}{} {:<20}{} {:<20}{} +{:<20}{} "#, "Build Timestamp:", env!("VERGEN_BUILD_TIMESTAMP"), @@ -84,6 +86,8 @@ fn long_version() -> String { env!("VERGEN_RUSTC_CHANNEL"), "cargo Profile:", env!("VERGEN_CARGO_PROFILE"), + "Network:", + DEFAULT_NETWORK ) } diff --git a/clients/socks5/src/main.rs b/clients/socks5/src/main.rs index 361262f988..d415b5a853 100644 --- a/clients/socks5/src/main.rs +++ b/clients/socks5/src/main.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use clap::{crate_version, App, ArgMatches}; +use network_defaults::DEFAULT_NETWORK; pub mod client; mod commands; @@ -67,6 +68,7 @@ fn long_version() -> String { {:<20}{} {:<20}{} {:<20}{} +{:<20}{} "#, "Build Timestamp:", env!("VERGEN_BUILD_TIMESTAMP"), @@ -84,6 +86,8 @@ fn long_version() -> String { env!("VERGEN_RUSTC_CHANNEL"), "cargo Profile:", env!("VERGEN_CARGO_PROFILE"), + "Network:", + DEFAULT_NETWORK ) } diff --git a/gateway/src/main.rs b/gateway/src/main.rs index eac89bc158..214305a9ef 100644 --- a/gateway/src/main.rs +++ b/gateway/src/main.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use clap::{crate_version, Parser}; +use network_defaults::DEFAULT_NETWORK; use once_cell::sync::OnceCell; mod commands; @@ -63,6 +64,7 @@ fn long_version() -> String { {:<20}{} {:<20}{} {:<20}{} +{:<20}{} "#, "Build Timestamp:", env!("VERGEN_BUILD_TIMESTAMP"), @@ -80,6 +82,8 @@ fn long_version() -> String { env!("VERGEN_RUSTC_CHANNEL"), "cargo Profile:", env!("VERGEN_CARGO_PROFILE"), + "Network:", + DEFAULT_NETWORK ) } diff --git a/mixnode/src/main.rs b/mixnode/src/main.rs index 7684dab801..5ad170da17 100644 --- a/mixnode/src/main.rs +++ b/mixnode/src/main.rs @@ -4,6 +4,7 @@ extern crate rocket; // Copyright 2020 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 +use ::config::defaults::DEFAULT_NETWORK; use clap::{crate_version, Parser}; use lazy_static::lazy_static; @@ -65,6 +66,7 @@ fn long_version() -> String { {:<20}{} {:<20}{} {:<20}{} +{:<20}{} "#, "Build Timestamp:", env!("VERGEN_BUILD_TIMESTAMP"), @@ -82,6 +84,8 @@ fn long_version() -> String { env!("VERGEN_RUSTC_CHANNEL"), "cargo Profile:", env!("VERGEN_CARGO_PROFILE"), + "Network:", + DEFAULT_NETWORK ) } diff --git a/validator-api/src/main.rs b/validator-api/src/main.rs index 4cc25452f0..967419ccd1 100644 --- a/validator-api/src/main.rs +++ b/validator-api/src/main.rs @@ -10,6 +10,7 @@ use crate::network_monitor::NetworkMonitorBuilder; use crate::node_status_api::uptime_updater::HistoricalUptimeUpdater; use crate::nymd_client::Client; use crate::storage::ValidatorApiStorage; +use ::config::defaults::DEFAULT_NETWORK; use ::config::NymConfig; use anyhow::Result; use clap::{crate_version, App, Arg, ArgMatches}; @@ -94,6 +95,7 @@ fn long_version() -> String { {:<20}{} {:<20}{} {:<20}{} +{:<20}{} "#, "Build Timestamp:", env!("VERGEN_BUILD_TIMESTAMP"), @@ -111,6 +113,8 @@ fn long_version() -> String { env!("VERGEN_RUSTC_CHANNEL"), "cargo Profile:", env!("VERGEN_CARGO_PROFILE"), + "Network:", + DEFAULT_NETWORK ) }