Unverified Commit ca82e933 authored by Cecile Tonglet's avatar Cecile Tonglet Committed by GitHub
Browse files

Allow starting westend chain from start_collator (#1246)

* Initial commit

Forked at: 5629242d
Parent branch: origin/master

* Allow starting westend chain from start_collator
parent b61a0375
Pipeline #96380 passed with stages
in 25 minutes and 13 seconds
......@@ -340,54 +340,72 @@ where
P::ParachainContext: Send + 'static,
<P::ParachainContext as ParachainContext>::ProduceCandidate: Send,
{
let is_kusama = config.chain_spec.is_kusama();
match (is_kusama, &config.role) {
(_, Role::Light) => Err(
if matches!(config.role, Role::Light) {
return Err(
polkadot_service::Error::Other("light nodes are unsupported as collator".into())
).into(),
(true, _) => {
let (service, client, handlers) = service::kusama_new_full(
config,
Some((key.public(), para_id)),
None,
false,
6000,
None,
informant_prefix,
)?;
let spawn_handle = service.spawn_task_handle();
build_collator_service(
spawn_handle,
handlers,
client,
para_id,
key,
build_parachain_context
)?.await;
Ok(())
},
(false, _) => {
let (service, client, handles) = service::polkadot_new_full(
config,
Some((key.public(), para_id)),
None,
false,
6000,
None,
informant_prefix,
)?;
let spawn_handle = service.spawn_task_handle();
build_collator_service(
spawn_handle,
handles,
client,
para_id,
key,
build_parachain_context,
)?.await;
Ok(())
}
.into());
}
if config.chain_spec.is_kusama() {
let (service, client, handlers) = service::kusama_new_full(
config,
Some((key.public(), para_id)),
None,
false,
6000,
None,
informant_prefix,
)?;
let spawn_handle = service.spawn_task_handle();
build_collator_service(
spawn_handle,
handlers,
client,
para_id,
key,
build_parachain_context
)?.await;
} else if config.chain_spec.is_westend() {
let (service, client, handlers) = service::westend_new_full(
config,
Some((key.public(), para_id)),
None,
false,
6000,
None,
informant_prefix,
)?;
let spawn_handle = service.spawn_task_handle();
build_collator_service(
spawn_handle,
handlers,
client,
para_id,
key,
build_parachain_context
)?.await;
} else {
let (service, client, handles) = service::polkadot_new_full(
config,
Some((key.public(), para_id)),
None,
false,
6000,
None,
informant_prefix,
)?;
let spawn_handle = service.spawn_task_handle();
build_collator_service(
spawn_handle,
handles,
client,
para_id,
key,
build_parachain_context,
)?.await;
}
Ok(())
}
fn compute_targets(para_id: ParaId, session_keys: &[ValidatorId], roster: DutyRoster) -> HashSet<ValidatorId> {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment