diff --git a/cli/src/command.rs b/cli/src/command.rs index fe1248d5cb17..9890d39544aa 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -124,7 +124,8 @@ pub fn run() -> Result<()> { None, authority_discovery_enabled, 6000, - grandpa_pause + grandpa_pause, + None, ).map(|(s, _, _)| s) }, service::KusamaExecutor::native_version().runtime_version @@ -141,7 +142,8 @@ pub fn run() -> Result<()> { None, authority_discovery_enabled, 6000, - grandpa_pause + grandpa_pause, + None, ).map(|(s, _, _)| s) }, service::WestendExecutor::native_version().runtime_version @@ -158,7 +160,8 @@ pub fn run() -> Result<()> { None, authority_discovery_enabled, 6000, - grandpa_pause + grandpa_pause, + None, ).map(|(s, _, _)| s) }, service::PolkadotExecutor::native_version().runtime_version diff --git a/collator/src/lib.rs b/collator/src/lib.rs index 6e7a803df19e..166b115f5549 100644 --- a/collator/src/lib.rs +++ b/collator/src/lib.rs @@ -333,6 +333,7 @@ pub async fn start_collator

( para_id: ParaId, key: Arc, config: Configuration, + informant_prefix: Option, ) -> Result<(), polkadot_service::Error> where P: 'static + BuildParachainContext, @@ -351,7 +352,8 @@ where None, false, 6000, - None + None, + informant_prefix, )?; let spawn_handle = service.spawn_task_handle(); build_collator_service( @@ -371,7 +373,8 @@ where None, false, 6000, - None + None, + informant_prefix, )?; let spawn_handle = service.spawn_task_handle(); build_collator_service( @@ -450,6 +453,7 @@ mod tests { 0.into(), Arc::new(CollatorPair::generate().0), config, + None, )); } } diff --git a/parachain/test-parachains/adder/collator/src/main.rs b/parachain/test-parachains/adder/collator/src/main.rs index 5ecf063dda85..e0a78b17453a 100644 --- a/parachain/test-parachains/adder/collator/src/main.rs +++ b/parachain/test-parachains/adder/collator/src/main.rs @@ -141,6 +141,7 @@ fn main() -> Result<(), Box> { id, key, config, + None, ).map_err(|e| e.into()) })?; diff --git a/service/src/lib.rs b/service/src/lib.rs index 24ab2ad59983..fe118455b176 100644 --- a/service/src/lib.rs +++ b/service/src/lib.rs @@ -149,7 +149,7 @@ fn set_prometheus_registry(config: &mut Configuration) -> Result<(), ServiceErro /// Use this macro if you don't actually need the full service, but just the builder in order to /// be able to perform chain operations. macro_rules! new_full_start { - ($config:expr, $runtime:ty, $executor:ty) => {{ + ($config:expr, $runtime:ty, $executor:ty, $informant_prefix:expr $(,)?) => {{ set_prometheus_registry(&mut $config)?; let mut import_setup = None; @@ -158,6 +158,7 @@ macro_rules! new_full_start { let builder = service::ServiceBuilder::new_full::< Block, $runtime, $executor >($config)? + .with_informant_prefix($informant_prefix.unwrap_or_default())? .with_select_chain(|_, backend| { Ok(sc_consensus::LongestChain::new(backend.clone())) })? @@ -274,7 +275,8 @@ macro_rules! new_full { $slot_duration:expr, $grandpa_pause:expr, $runtime:ty, - $dispatch:ty + $dispatch:ty, + $informant_prefix:expr $(,)? ) => {{ use sc_network::Event; use sc_client_api::ExecutorProvider; @@ -296,7 +298,7 @@ macro_rules! new_full { let slot_duration = $slot_duration; let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) = - new_full_start!($config, $runtime, $dispatch); + new_full_start!($config, $runtime, $dispatch, $informant_prefix); let service = builder .with_finality_proof_provider(|client, backend| { @@ -647,7 +649,7 @@ where >::StateBackend: sp_api::StateBackend, { config.keystore = service::config::KeystoreConfig::InMemory; - Ok(new_full_start!(config, Runtime, Dispatch).0) + Ok(new_full_start!(config, Runtime, Dispatch, None).0) } /// Create a new Polkadot service for a full node. @@ -659,6 +661,7 @@ pub fn polkadot_new_full( authority_discovery_enabled: bool, slot_duration: u64, grandpa_pause: Option<(u32, u32)>, + informant_prefix: Option, ) -> Result<( impl AbstractService, @@ -678,7 +681,8 @@ pub fn polkadot_new_full( slot_duration, grandpa_pause, polkadot_runtime::RuntimeApi, - PolkadotExecutor + PolkadotExecutor, + informant_prefix, ); Ok((service, client, handles)) @@ -693,6 +697,7 @@ pub fn kusama_new_full( authority_discovery_enabled: bool, slot_duration: u64, grandpa_pause: Option<(u32, u32)>, + informant_prefix: Option, ) -> Result<( impl AbstractService, Arc, + informant_prefix: Option, ) -> Result<( impl AbstractService, @@ -746,7 +753,8 @@ pub fn westend_new_full( slot_duration, grandpa_pause, westend_runtime::RuntimeApi, - WestendExecutor + WestendExecutor, + informant_prefix, ); Ok((service, client, handles))