diff --git a/substrate/polkadot/cli/src/lib.rs b/substrate/polkadot/cli/src/lib.rs index 577535035c..411d713ca7 100644 --- a/substrate/polkadot/cli/src/lib.rs +++ b/substrate/polkadot/cli/src/lib.rs @@ -160,25 +160,6 @@ pub fn run(args: I) -> error::Result<()> where config.chain_name = chain_spec.clone().into(); - let _guard = if matches.is_present("telemetry") || matches.value_of("telemetry-url").is_some() { - let name = config.name.clone(); - let chain_name = config.chain_name.clone(); - Some(init_telemetry(TelemetryConfig { - url: matches.value_of("telemetry-url").unwrap_or(DEFAULT_TELEMETRY_URL).into(), - on_connect: Box::new(move || { - telemetry!("system.connected"; - "name" => name.clone(), - "implementation" => "parity-polkadot", - "version" => crate_version!(), - "config" => "", - "chain" => chain_name.clone(), - ); - }), - })) - } else { - None - }; - let base_path = matches.value_of("base-path") .map(|x| Path::new(x).to_owned()) .unwrap_or_else(default_base_path); @@ -263,6 +244,25 @@ pub fn run(args: I) -> error::Result<()> where chain_name: config.chain_name.clone(), }; + let _guard = if matches.is_present("telemetry") || matches.value_of("telemetry-url").is_some() { + let name = config.name.clone(); + let chain_name = config.chain_name.clone(); + Some(init_telemetry(TelemetryConfig { + url: matches.value_of("telemetry-url").unwrap_or(DEFAULT_TELEMETRY_URL).into(), + on_connect: Box::new(move || { + telemetry!("system.connected"; + "name" => name.clone(), + "implementation" => "parity-polkadot", + "version" => crate_version!(), + "config" => "", + "chain" => chain_name.clone(), + ); + }), + })) + } else { + None + }; + match role == service::Role::LIGHT { true => run_until_exit(core, service::new_light(config)?, &matches, sys_conf), false => run_until_exit(core, service::new_full(config)?, &matches, sys_conf), diff --git a/substrate/polkadot/service/src/components.rs b/substrate/polkadot/service/src/components.rs index 846c51dc91..6da71918a4 100644 --- a/substrate/polkadot/service/src/components.rs +++ b/substrate/polkadot/service/src/components.rs @@ -100,7 +100,7 @@ impl Components for FullComponents { // Load the first available key let key = keystore.load(&keystore.contents()?[0], "")?; - info!("Using authority key {:?}", key.public()); + info!("Using authority key: {}", key.public()); Ok(Some(consensus::Service::new( client.clone(), client.clone(), diff --git a/substrate/polkadot/service/src/lib.rs b/substrate/polkadot/service/src/lib.rs index 5b7db92ff2..0bc343e0c9 100644 --- a/substrate/polkadot/service/src/lib.rs +++ b/substrate/polkadot/service/src/lib.rs @@ -125,7 +125,7 @@ impl Service let api = components.build_api(client.clone()); let best_header = client.best_block_header()?; - info!("Best block is #{}", best_header.number); + info!("Best block: #{}", best_header.number); telemetry!("node.start"; "height" => best_header.number, "best" => ?best_header.hash()); let transaction_pool = Arc::new(TransactionPool::new(config.transaction_pool, api.clone())); diff --git a/substrate/substrate/ed25519/src/lib.rs b/substrate/substrate/ed25519/src/lib.rs index f659ad5405..536b390bd4 100644 --- a/substrate/substrate/ed25519/src/lib.rs +++ b/substrate/substrate/ed25519/src/lib.rs @@ -168,13 +168,14 @@ impl AsRef for Pair { impl ::std::fmt::Display for Public { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - write!(f, "{}", ::primitives::hexdisplay::HexDisplay::from(&self.0)) + write!(f, "{}", self.to_ss58check()) } } impl ::std::fmt::Debug for Public { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - write!(f, "{}", ::primitives::hexdisplay::HexDisplay::from(&self.0)) + let s = self.to_ss58check(); + write!(f, "{} ({}...)", ::primitives::hexdisplay::HexDisplay::from(&self.0), &s[0..8]) } }