Do not require the collator key to be passed (#459)

This commit is contained in:
Bastian Köcher
2021-06-02 11:43:45 +02:00
committed by GitHub
parent 3a06a47aa7
commit ba81b0b56c
5 changed files with 61 additions and 48 deletions
-2
View File
@@ -82,8 +82,6 @@ polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "m
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" }
[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
+2 -8
View File
@@ -391,9 +391,6 @@ pub fn run() -> Result<()> {
let runner = cli.create_runner(&cli.run.normalize())?;
runner.run_node_until_exit(|config| async move {
// TODO
let key = sp_core::Pair::generate().0;
let para_id =
chain_spec::Extensions::try_get(&*config.chain_spec).map(|e| e.para_id);
@@ -433,7 +430,6 @@ pub fn run() -> Result<()> {
if config.chain_spec.is_statemint() {
crate::service::start_statemint_node::<statemint_runtime::RuntimeApi, StatemintRuntimeExecutor>(
config,
key,
polkadot_config,
id,
)
@@ -443,7 +439,6 @@ pub fn run() -> Result<()> {
} else if config.chain_spec.is_statemine() {
crate::service::start_statemint_node::<statemine_runtime::RuntimeApi, StatemineRuntimeExecutor>(
config,
key,
polkadot_config,
id,
)
@@ -453,7 +448,6 @@ pub fn run() -> Result<()> {
} else if config.chain_spec.is_westmint() {
crate::service::start_statemint_node::<westmint_runtime::RuntimeApi, WestmintRuntimeExecutor>(
config,
key,
polkadot_config,
id,
)
@@ -461,12 +455,12 @@ pub fn run() -> Result<()> {
.map(|r| r.0)
.map_err(Into::into)
} else if config.chain_spec.is_shell() {
crate::service::start_shell_node(config, key, polkadot_config, id)
crate::service::start_shell_node(config, polkadot_config, id)
.await
.map(|r| r.0)
.map_err(Into::into)
} else {
crate::service::start_rococo_parachain_node(config, key, polkadot_config, id)
crate::service::start_rococo_parachain_node(config, polkadot_config, id)
.await
.map(|r| r.0)
.map_err(Into::into)
@@ -27,7 +27,6 @@ use cumulus_client_service::{
use cumulus_primitives_core::{
ParaId, relay_chain::v1::{Hash as PHash, PersistedValidationData},
};
use polkadot_primitives::v1::CollatorPair;
use sc_client_api::ExecutorProvider;
use sc_executor::native_executor_instance;
@@ -195,7 +194,6 @@ where
#[sc_tracing::logging::prefix_logs_with("Parachain")]
async fn start_node_impl<RuntimeApi, Executor, RB, BIQ, BIC>(
parachain_config: Configuration,
collator_key: CollatorPair,
polkadot_config: Configuration,
id: ParaId,
rpc_ext_builder: RB,
@@ -255,7 +253,6 @@ where
let relay_chain_full_node = cumulus_client_service::build_polkadot_full_node(
polkadot_config,
collator_key.clone(),
telemetry_worker_handle,
)
.map_err(|e| match e {
@@ -333,7 +330,6 @@ where
announce_block,
client: client.clone(),
task_manager: &mut task_manager,
collator_key,
relay_chain_full_node,
spawner,
parachain_consensus,
@@ -404,7 +400,6 @@ pub fn rococo_parachain_build_import_queue(
/// Start a rococo parachain node.
pub async fn start_rococo_parachain_node(
parachain_config: Configuration,
collator_key: CollatorPair,
polkadot_config: Configuration,
id: ParaId,
) -> sc_service::error::Result<(
@@ -413,7 +408,6 @@ pub async fn start_rococo_parachain_node(
)> {
start_node_impl::<rococo_parachain_runtime::RuntimeApi, RococoParachainRuntimeExecutor, _, _, _>(
parachain_config,
collator_key,
polkadot_config,
id,
|_| Default::default(),
@@ -522,7 +516,6 @@ pub fn shell_build_import_queue(
/// Start a polkadot-shell parachain node.
pub async fn start_shell_node(
parachain_config: Configuration,
collator_key: CollatorPair,
polkadot_config: Configuration,
id: ParaId,
) -> sc_service::error::Result<(
@@ -531,7 +524,6 @@ pub async fn start_shell_node(
)> {
start_node_impl::<shell_runtime::RuntimeApi, ShellRuntimeExecutor, _, _, _>(
parachain_config,
collator_key,
polkadot_config,
id,
|_| Default::default(),
@@ -790,7 +782,6 @@ where
/// Start a statemint/statemine/westmint parachain node.
pub async fn start_statemint_node<RuntimeApi, Executor>(
parachain_config: Configuration,
collator_key: CollatorPair,
polkadot_config: Configuration,
id: ParaId,
) -> sc_service::error::Result<(
@@ -817,7 +808,6 @@ where
{
start_node_impl::<RuntimeApi, Executor, _, _, _>(
parachain_config,
collator_key,
polkadot_config,
id,
|_| Default::default(),