diff --git a/polkadot/collator/src/lib.rs b/polkadot/collator/src/lib.rs index e0f230452c..7dc4f70d20 100644 --- a/polkadot/collator/src/lib.rs +++ b/polkadot/collator/src/lib.rs @@ -217,8 +217,7 @@ pub async fn collate
(
Ok(collation)
}
-/// Run the collator node using the given `service`.
-fn run_collator_node (
+ build_parachain_context: P,
+ para_id: ParaId,
+ key: Arc (
@@ -408,7 +452,7 @@ pub fn run_collator (
match (config.expect_chain_spec().is_kusama(), config.roles) {
(true, Roles::LIGHT) =>
sc_cli::run_service_until_exit(config, |config| {
- run_collator_node(
+ build_collator_service(
service::kusama_new_light(config, Some((key.public(), para_id)))?,
para_id,
key,
@@ -417,7 +461,7 @@ pub fn run_collator (
}),
(true, _) =>
sc_cli::run_service_until_exit(config, |config| {
- run_collator_node(
+ build_collator_service(
service::kusama_new_full(config, Some((key.public(), para_id)), None, false, 6000)?,
para_id,
key,
@@ -426,7 +470,7 @@ pub fn run_collator (
}),
(false, Roles::LIGHT) =>
sc_cli::run_service_until_exit(config, |config| {
- run_collator_node(
+ build_collator_service(
service::polkadot_new_light(config, Some((key.public(), para_id)))?,
para_id,
key,
@@ -435,7 +479,7 @@ pub fn run_collator (
}),
(false, _) =>
sc_cli::run_service_until_exit(config, |config| {
- run_collator_node(
+ build_collator_service(
service::polkadot_new_full(config, Some((key.public(), para_id)), None, false, 6000)?,
para_id,
key,
diff --git a/polkadot/service/src/lib.rs b/polkadot/service/src/lib.rs
index 2a2db82cb4..ee64465f69 100644
--- a/polkadot/service/src/lib.rs
+++ b/polkadot/service/src/lib.rs
@@ -272,7 +272,7 @@ pub fn new_full(
+fn build_collator_service(
service: S,
para_id: ParaId,
key: Arc(
Ok(service)
}
+/// Async function that will run the collator node with the given `RelayChainContext` and `ParachainContext`
+/// built by the given `BuildParachainContext` and arguments to the underlying polkadot node.
+pub async fn start_collator