Skip to content

Commit

Permalink
Advertise node software version in gossip (solana-labs#9981)
Browse files Browse the repository at this point in the history
* Advertise node version in gossip

* Remove solana_clap_utils::version! macro
  • Loading branch information
mvines authored May 11, 2020
1 parent 965204b commit 2521f75
Show file tree
Hide file tree
Showing 50 changed files with 223 additions and 66 deletions.
29 changes: 29 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ members = [
"transaction-status",
"upload-perf",
"net-utils",
"version",
"vote-signer",
"cli",
"rayon-threadlimit",
Expand Down
2 changes: 1 addition & 1 deletion archiver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ solana-metrics = { path = "../metrics", version = "1.2.0" }
solana-archiver-lib = { path = "../archiver-lib", version = "1.2.0" }
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
solana-sdk = { path = "../sdk", version = "1.2.0" }

solana-version = { path = "../version", version = "1.2.0" }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
4 changes: 2 additions & 2 deletions archiver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() {

let matches = App::new(crate_name!())
.about(crate_description!())
.version(solana_clap_utils::version!())
.version(solana_version::version!())
.arg(
Arg::with_name("identity_keypair")
.short("i")
Expand Down Expand Up @@ -105,7 +105,7 @@ fn main() {
println!(
"{} version {} (branch={}, commit={})",
style(crate_name!()).bold(),
solana_clap_utils::version!(),
solana_version::version!(),
option_env!("CI_BRANCH").unwrap_or("unknown"),
option_env!("CI_COMMIT").unwrap_or("unknown")
);
Expand Down
1 change: 1 addition & 0 deletions bench-exchange/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ solana-metrics = { path = "../metrics", version = "1.2.0" }
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
solana-runtime = { path = "../runtime", version = "1.2.0" }
solana-sdk = { path = "../sdk", version = "1.2.0" }
solana-version = { path = "../version", version = "1.2.0" }

[dev-dependencies]
solana-local-cluster = { path = "../local-cluster", version = "1.2.0" }
Expand Down
2 changes: 1 addition & 1 deletion bench-exchange/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main() {
solana_logger::setup();
solana_metrics::set_panic_hook("bench-exchange");

let matches = cli::build_args(solana_clap_utils::version!()).get_matches();
let matches = cli::build_args(solana_version::version!()).get_matches();
let cli_config = cli::extract_args(&matches);

let cli::Config {
Expand Down
1 change: 1 addition & 0 deletions bench-streamer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
solana-streamer = { path = "../streamer", version = "1.2.0" }
solana-logger = { path = "../logger", version = "1.2.0" }
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
solana-version = { path = "../version", version = "1.2.0" }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
2 changes: 1 addition & 1 deletion bench-streamer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn main() -> Result<()> {

let matches = App::new(crate_name!())
.about(crate_description!())
.version(solana_clap_utils::version!())
.version(solana_version::version!())
.arg(
Arg::with_name("num-recv-sockets")
.long("num-recv-sockets")
Expand Down
1 change: 1 addition & 0 deletions bench-tps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ solana-net-utils = { path = "../net-utils", version = "1.2.0" }
solana-runtime = { path = "../runtime", version = "1.2.0" }
solana-sdk = { path = "../sdk", version = "1.2.0" }
solana-move-loader-program = { path = "../programs/move_loader", version = "1.2.0", optional = true }
solana-version = { path = "../version", version = "1.2.0" }

[dev-dependencies]
serial_test = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion bench-tps/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn main() {
solana_logger::setup_with_default("solana=info");
solana_metrics::set_panic_hook("bench-tps");

let matches = cli::build_args(solana_clap_utils::version!()).get_matches();
let matches = cli::build_args(solana_version::version!()).get_matches();
let cli_config = cli::extract_args(&matches);

let cli::Config {
Expand Down
19 changes: 0 additions & 19 deletions clap-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
use thiserror::Error;

#[macro_export]
macro_rules! version {
() => {
&*format!(
"{}{}",
env!("CARGO_PKG_VERSION"),
if option_env!("CI_TAG").unwrap_or("").is_empty() {
format!(
" [channel={} commit={}]",
option_env!("CHANNEL").unwrap_or("unknown"),
option_env!("CI_COMMIT").unwrap_or("unknown"),
)
} else {
"".to_string()
},
)
};
}

pub struct ArgConstant<'a> {
pub long: &'a str,
pub name: &'a str,
Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ solana-sdk = { path = "../sdk", version = "1.2.0" }
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
solana-storage-program = { path = "../programs/storage", version = "1.2.0" }
solana-transaction-status = { path = "../transaction-status", version = "1.2.0" }
solana-version = { path = "../version", version = "1.2.0" }
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
solana-vote-signer = { path = "../vote-signer", version = "1.2.0" }
thiserror = "1.0.15"
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
let matches = app(
crate_name!(),
crate_description!(),
solana_clap_utils::version!(),
solana_version::version!(),
)
.arg({
let arg = Arg::with_name("config_file")
Expand Down
1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ solana-sdk = { path = "../sdk", version = "1.2.0" }
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
solana-storage-program = { path = "../programs/storage", version = "1.2.0" }
solana-streamer = { path = "../streamer", version = "1.2.0" }
solana-version = { path = "../version", version = "1.2.0" }
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
solana-vote-signer = { path = "../vote-signer", version = "1.2.0" }
solana-sys-tuner = { path = "../sys-tuner", version = "1.2.0" }
Expand Down
Loading

0 comments on commit 2521f75

Please sign in to comment.