Skip to content

Commit

Permalink
Use sc_cli for print node info (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrylavrenov authored Aug 13, 2021
1 parent c2f6e72 commit 223e4e4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
2 changes: 1 addition & 1 deletion crates/humanode-peer/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub async fn run() -> sc_cli::Result<()> {
}
None => {
let runner = cli.create_humanode_runner(&cli.run)?;
crate::runner::print_node_infos::<Cli>(runner.config());
sc_cli::print_node_infos::<Cli>(runner.config());
runner
.run_node(|config| async move {
service::new_full(config)
Expand Down
23 changes: 0 additions & 23 deletions crates/humanode-peer/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,26 +108,3 @@ impl<C: SubstrateCli> Runner<C> {
&self.config
}
}

/// Log information about the node itself.
pub fn print_node_infos<C: SubstrateCli>(config: &Configuration) {
use tracing::info;

info!("{}", C::impl_name());
info!("✌️ version {}", C::impl_version());
info!("📋 Chain specification: {}", config.chain_spec.name());
info!("🏷 Node name: {}", config.network.node_name);
info!("👤 Role: {}", config.display_role());
info!(
"💾 Database: {} at {}",
config.database,
config
.database
.path()
.map_or_else(|| "<unknown>".to_owned(), |p| p.display().to_string())
);
info!(
"⛓ Native runtime: {}",
C::native_runtime_version(&config.chain_spec)
);
}

0 comments on commit 223e4e4

Please sign in to comment.