Skip to content

Commit

Permalink
sui-node: add git revision to --version output
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Jan 28, 2023
1 parent 2c9b314 commit 4019eaa
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions crates/sui-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ use tokio::task;
use tokio::time::sleep;
use tracing::info;

const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), "-", env!("GIT_REVISION"));

#[derive(Parser)]
#[clap(rename_all = "kebab-case", version)]
#[clap(rename_all = "kebab-case")]
#[clap(version = VERSION)]
struct Args {
#[clap(long)]
pub config_path: PathBuf,
Expand All @@ -23,13 +26,6 @@ struct Args {
listen_address: Option<Multiaddr>,
}

// Memory profiling is now done automatically by the Ying profiler.
// use ying_profiler::utils::ProfilerRunner;
// use ying_profiler::YingProfiler;

// #[global_allocator]
// static YING_ALLOC: YingProfiler = YingProfiler;

#[tokio::main]
async fn main() -> Result<()> {
let args = Args::parse();
Expand All @@ -44,24 +40,17 @@ async fn main() -> Result<()> {
.with_prom_registry(&prometheus_registry)
.init();

info!("Sui Node version: {VERSION}");

info!(
"Started Prometheus HTTP endpoint at {}",
config.metrics_address
);

if let Some(git_rev) = option_env!("GIT_REVISION") {
info!("Sui Node built at git revision {git_rev}");
}

if let Some(listen_address) = args.listen_address {
config.network_address = listen_address;
}

// Spins up a thread to check memory usage every minute, and dump out stack traces/profiles
// if it has moved up or down more than 15%. Also allow configuration of dump directory.
// let profile_dump_dir = std::env::var("SUI_MEM_PROFILE_DIR").unwrap_or_default();
// ProfilerRunner::new(60, 15, &profile_dump_dir).spawn();

let is_validator = config.consensus_config().is_some();
task::spawn(async move {
loop {
Expand Down

0 comments on commit 4019eaa

Please sign in to comment.