Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions collator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ pub async fn start_collator<P>(
para_id: ParaId,
key: Arc<CollatorPair>,
config: Configuration,
informant_prefix: Option<String>,
) -> Result<(), polkadot_service::Error>
where
P: 'static + BuildParachainContext,
Expand All @@ -351,7 +352,8 @@ where
None,
false,
6000,
None
None,
informant_prefix,
)?;
let spawn_handle = service.spawn_task_handle();
build_collator_service(
Expand All @@ -371,7 +373,8 @@ where
None,
false,
6000,
None
None,
informant_prefix,
)?;
let spawn_handle = service.spawn_task_handle();
build_collator_service(
Expand Down Expand Up @@ -450,6 +453,7 @@ mod tests {
0.into(),
Arc::new(CollatorPair::generate().0),
config,
None,
));
}
}
1 change: 1 addition & 0 deletions parachain/test-parachains/adder/collator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
id,
key,
config,
None,
).map_err(|e| e.into())
})?;

Expand Down
22 changes: 15 additions & 7 deletions service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()))
})?
Expand Down Expand Up @@ -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;
Expand All @@ -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| {
Expand Down Expand Up @@ -647,7 +649,7 @@ where
<Runtime::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{
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.
Expand All @@ -659,6 +661,7 @@ pub fn polkadot_new_full(
authority_discovery_enabled: bool,
slot_duration: u64,
grandpa_pause: Option<(u32, u32)>,
informant_prefix: Option<String>,
)
-> Result<(
impl AbstractService,
Expand All @@ -678,7 +681,8 @@ pub fn polkadot_new_full(
slot_duration,
grandpa_pause,
polkadot_runtime::RuntimeApi,
PolkadotExecutor
PolkadotExecutor,
informant_prefix,
);

Ok((service, client, handles))
Expand All @@ -693,6 +697,7 @@ pub fn kusama_new_full(
authority_discovery_enabled: bool,
slot_duration: u64,
grandpa_pause: Option<(u32, u32)>,
informant_prefix: Option<String>,
) -> Result<(
impl AbstractService,
Arc<impl PolkadotClient<
Expand All @@ -712,7 +717,8 @@ pub fn kusama_new_full(
slot_duration,
grandpa_pause,
kusama_runtime::RuntimeApi,
KusamaExecutor
KusamaExecutor,
informant_prefix,
);

Ok((service, client, handles))
Expand All @@ -727,6 +733,7 @@ pub fn westend_new_full(
authority_discovery_enabled: bool,
slot_duration: u64,
grandpa_pause: Option<(u32, u32)>,
informant_prefix: Option<String>,
)
-> Result<(
impl AbstractService,
Expand All @@ -746,7 +753,8 @@ pub fn westend_new_full(
slot_duration,
grandpa_pause,
westend_runtime::RuntimeApi,
WestendExecutor
WestendExecutor,
informant_prefix,
);

Ok((service, client, handles))
Expand Down