mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +00:00
Add collectives-westend and glutton-westend runtimes (#2024)
Add collectives and glutton parachain westend runtimes to prepare for #1737. The removal of system parachain native runtimes #1737 is blocked until chainspecs and runtime APIs can be dealt with cleanly (merge of #1256 and follow up PRs). In the meantime, these additions are ready to be merged to `master`, so I have separated them out into this PR. Also marked `bridge-hub-westend` as unimplemented in line with [this issue](https://github.com/paritytech/parity-bridges-common/issues/2602). TODO - [x] add to `command-bot` benchmarks - [x] add to `command-bot-scripts` benchmarks - [x] generate weights --------- Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: Muharem <ismailov.m.h@gmail.com> Co-authored-by: command-bot <> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Branislav Kontur <bkontur@gmail.com>
This commit is contained in:
@@ -24,6 +24,7 @@ serde_json = "1.0.108"
|
||||
# Local
|
||||
rococo-parachain-runtime = { path = "../parachains/runtimes/testing/rococo-parachain" }
|
||||
shell-runtime = { path = "../parachains/runtimes/starters/shell" }
|
||||
glutton-westend-runtime = { path = "../parachains/runtimes/glutton/glutton-westend" }
|
||||
glutton-runtime = { path = "../parachains/runtimes/glutton/glutton-kusama" }
|
||||
seedling-runtime = { path = "../parachains/runtimes/starters/seedling" }
|
||||
asset-hub-polkadot-runtime = { path = "../parachains/runtimes/assets/asset-hub-polkadot" }
|
||||
@@ -31,6 +32,7 @@ asset-hub-kusama-runtime = { path = "../parachains/runtimes/assets/asset-hub-kus
|
||||
asset-hub-rococo-runtime = { path = "../parachains/runtimes/assets/asset-hub-rococo" }
|
||||
asset-hub-westend-runtime = { path = "../parachains/runtimes/assets/asset-hub-westend" }
|
||||
collectives-polkadot-runtime = { path = "../parachains/runtimes/collectives/collectives-polkadot" }
|
||||
collectives-westend-runtime = { path = "../parachains/runtimes/collectives/collectives-westend" }
|
||||
contracts-rococo-runtime = { path = "../parachains/runtimes/contracts/contracts-rococo" }
|
||||
bridge-hub-rococo-runtime = { path = "../parachains/runtimes/bridge-hubs/bridge-hub-rococo" }
|
||||
bridge-hub-kusama-runtime = { path = "../parachains/runtimes/bridge-hubs/bridge-hub-kusama" }
|
||||
@@ -119,11 +121,13 @@ runtime-benchmarks = [
|
||||
"bridge-hub-rococo-runtime/runtime-benchmarks",
|
||||
"bridge-hub-westend-runtime/runtime-benchmarks",
|
||||
"collectives-polkadot-runtime/runtime-benchmarks",
|
||||
"collectives-westend-runtime/runtime-benchmarks",
|
||||
"contracts-rococo-runtime/runtime-benchmarks",
|
||||
"cumulus-primitives-core/runtime-benchmarks",
|
||||
"frame-benchmarking-cli/runtime-benchmarks",
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
"glutton-runtime/runtime-benchmarks",
|
||||
"glutton-westend-runtime/runtime-benchmarks",
|
||||
"parachains-common/runtime-benchmarks",
|
||||
"penpal-runtime/runtime-benchmarks",
|
||||
"polkadot-cli/runtime-benchmarks",
|
||||
@@ -143,8 +147,10 @@ try-runtime = [
|
||||
"bridge-hub-rococo-runtime/try-runtime",
|
||||
"bridge-hub-westend-runtime/try-runtime",
|
||||
"collectives-polkadot-runtime/try-runtime",
|
||||
"collectives-westend-runtime/try-runtime",
|
||||
"contracts-rococo-runtime/try-runtime",
|
||||
"glutton-runtime/try-runtime",
|
||||
"glutton-westend-runtime/try-runtime",
|
||||
"penpal-runtime/try-runtime",
|
||||
"polkadot-cli/try-runtime",
|
||||
"polkadot-service/try-runtime",
|
||||
|
||||
@@ -23,9 +23,12 @@ use sc_service::ChainType;
|
||||
use sp_core::sr25519;
|
||||
|
||||
pub type CollectivesPolkadotChainSpec = sc_service::GenericChainSpec<(), Extensions>;
|
||||
pub type CollectivesWestendChainSpec = sc_service::GenericChainSpec<(), Extensions>;
|
||||
|
||||
const COLLECTIVES_POLKADOT_ED: CollectivesBalance =
|
||||
parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT;
|
||||
const COLLECTIVES_WESTEND_ED: CollectivesBalance =
|
||||
parachains_common::westend::currency::EXISTENTIAL_DEPOSIT;
|
||||
|
||||
/// Generate the session keys from individual elements.
|
||||
///
|
||||
@@ -158,3 +161,133 @@ fn collectives_polkadot_genesis(
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/// Generate the session keys from individual elements.
|
||||
///
|
||||
/// The input must be a tuple of individual keys (a single arg for now since we have just one key).
|
||||
pub fn collectives_westend_session_keys(keys: AuraId) -> collectives_westend_runtime::SessionKeys {
|
||||
collectives_westend_runtime::SessionKeys { aura: keys }
|
||||
}
|
||||
|
||||
pub fn collectives_westend_development_config() -> CollectivesWestendChainSpec {
|
||||
let mut properties = sc_chain_spec::Properties::new();
|
||||
properties.insert("ss58Format".into(), 42.into());
|
||||
properties.insert("tokenSymbol".into(), "WND".into());
|
||||
properties.insert("tokenDecimals".into(), 12.into());
|
||||
|
||||
CollectivesWestendChainSpec::builder(
|
||||
collectives_westend_runtime::WASM_BINARY
|
||||
.expect("WASM binary was not built, please build it!"),
|
||||
Extensions { relay_chain: "westend-dev".into(), para_id: 1002 },
|
||||
)
|
||||
.with_name("Westend Collectives Development")
|
||||
.with_id("collectives_westend_dev")
|
||||
.with_chain_type(ChainType::Local)
|
||||
.with_genesis_config_patch(collectives_westend_genesis(
|
||||
// initial collators.
|
||||
vec![(
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_collator_keys_from_seed::<AuraId>("Alice"),
|
||||
)],
|
||||
vec![
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
|
||||
],
|
||||
// 1002 avoids a potential collision with Kusama-1001 (Encointer) should there ever
|
||||
// be a collective para on Kusama.
|
||||
1002.into(),
|
||||
))
|
||||
.with_boot_nodes(Vec::new())
|
||||
.with_properties(properties)
|
||||
.build()
|
||||
}
|
||||
|
||||
/// Collectives Westend Local Config.
|
||||
pub fn collectives_westend_local_config() -> CollectivesWestendChainSpec {
|
||||
let mut properties = sc_chain_spec::Properties::new();
|
||||
properties.insert("ss58Format".into(), 42.into());
|
||||
properties.insert("tokenSymbol".into(), "WND".into());
|
||||
properties.insert("tokenDecimals".into(), 12.into());
|
||||
|
||||
CollectivesWestendChainSpec::builder(
|
||||
collectives_westend_runtime::WASM_BINARY
|
||||
.expect("WASM binary was not built, please build it!"),
|
||||
Extensions { relay_chain: "westend-local".into(), para_id: 1002 },
|
||||
)
|
||||
.with_name("Westend Collectives Local")
|
||||
.with_id("collectives_westend_local")
|
||||
.with_chain_type(ChainType::Local)
|
||||
.with_genesis_config_patch(collectives_westend_genesis(
|
||||
// initial collators.
|
||||
vec![
|
||||
(
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_collator_keys_from_seed::<AuraId>("Alice"),
|
||||
),
|
||||
(
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_collator_keys_from_seed::<AuraId>("Bob"),
|
||||
),
|
||||
],
|
||||
vec![
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
|
||||
],
|
||||
1002.into(),
|
||||
))
|
||||
.with_boot_nodes(Vec::new())
|
||||
.with_properties(properties)
|
||||
.build()
|
||||
}
|
||||
|
||||
fn collectives_westend_genesis(
|
||||
invulnerables: Vec<(AccountId, AuraId)>,
|
||||
endowed_accounts: Vec<AccountId>,
|
||||
id: ParaId,
|
||||
) -> serde_json::Value {
|
||||
serde_json::json!( {
|
||||
"balances": {
|
||||
"balances": endowed_accounts
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|k| (k, COLLECTIVES_WESTEND_ED * 4096))
|
||||
.collect::<Vec<_>>(),
|
||||
},
|
||||
"parachainInfo": {
|
||||
"parachainId": id,
|
||||
},
|
||||
"collatorSelection": {
|
||||
"invulnerables": invulnerables.iter().cloned().map(|(acc, _)| acc).collect::<Vec<_>>(),
|
||||
"candidacyBond": COLLECTIVES_WESTEND_ED * 16,
|
||||
},
|
||||
"session": {
|
||||
"keys": invulnerables
|
||||
.into_iter()
|
||||
.map(|(acc, aura)| {
|
||||
(
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
collectives_westend_session_keys(aura), // session keys
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
},
|
||||
// no need to pass anything to aura, in fact it will panic if we do. Session will take care
|
||||
// of this.
|
||||
"polkadotXcm": {
|
||||
"safeXcmVersion": Some(SAFE_XCM_VERSION),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ use super::get_collator_keys_from_seed;
|
||||
|
||||
/// Specialized `ChainSpec` for the Glutton parachain runtime.
|
||||
pub type GluttonChainSpec = sc_service::GenericChainSpec<(), Extensions>;
|
||||
pub type GluttonWestendChainSpec = sc_service::GenericChainSpec<(), Extensions>;
|
||||
|
||||
pub fn glutton_development_config(para_id: ParaId) -> GluttonChainSpec {
|
||||
GluttonChainSpec::builder(
|
||||
@@ -92,3 +93,71 @@ fn glutton_genesis(parachain_id: ParaId, collators: Vec<AuraId>) -> serde_json::
|
||||
"aura": { "authorities": collators },
|
||||
})
|
||||
}
|
||||
|
||||
pub fn glutton_westend_development_config(para_id: ParaId) -> GluttonWestendChainSpec {
|
||||
GluttonWestendChainSpec::builder(
|
||||
glutton_westend_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
|
||||
Extensions { relay_chain: "westend-dev".into(), para_id: para_id.into() },
|
||||
)
|
||||
.with_name("Glutton Development")
|
||||
.with_id("glutton_westend_dev")
|
||||
.with_chain_type(ChainType::Local)
|
||||
.with_genesis_config_patch(glutton_genesis(
|
||||
para_id,
|
||||
vec![get_collator_keys_from_seed::<AuraId>("Alice")],
|
||||
))
|
||||
.build()
|
||||
}
|
||||
|
||||
pub fn glutton_westend_local_config(para_id: ParaId) -> GluttonWestendChainSpec {
|
||||
GluttonWestendChainSpec::builder(
|
||||
glutton_westend_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
|
||||
Extensions { relay_chain: "westend-local".into(), para_id: para_id.into() },
|
||||
)
|
||||
.with_name("Glutton Local")
|
||||
.with_id("glutton_westend_local")
|
||||
.with_chain_type(ChainType::Local)
|
||||
.with_genesis_config_patch(glutton_genesis(
|
||||
para_id,
|
||||
vec![
|
||||
get_collator_keys_from_seed::<AuraId>("Alice"),
|
||||
get_collator_keys_from_seed::<AuraId>("Bob"),
|
||||
],
|
||||
))
|
||||
.build()
|
||||
}
|
||||
|
||||
pub fn glutton_westend_config(para_id: ParaId) -> GluttonWestendChainSpec {
|
||||
let mut properties = sc_chain_spec::Properties::new();
|
||||
properties.insert("ss58Format".into(), 42.into());
|
||||
|
||||
GluttonChainSpec::builder(
|
||||
glutton_westend_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
|
||||
Extensions { relay_chain: "westend".into(), para_id: para_id.into() },
|
||||
)
|
||||
.with_name(format!("Glutton {}", para_id).as_str())
|
||||
.with_id(format!("glutton-westend-{}", para_id).as_str())
|
||||
.with_chain_type(ChainType::Live)
|
||||
.with_genesis_config_patch(glutton_westend_genesis(
|
||||
para_id,
|
||||
vec![
|
||||
get_collator_keys_from_seed::<AuraId>("Alice"),
|
||||
get_collator_keys_from_seed::<AuraId>("Bob"),
|
||||
],
|
||||
))
|
||||
.with_protocol_id(format!("glutton-westend-{}", para_id).as_str())
|
||||
.with_properties(properties)
|
||||
.build()
|
||||
}
|
||||
|
||||
fn glutton_westend_genesis(parachain_id: ParaId, collators: Vec<AuraId>) -> serde_json::Value {
|
||||
serde_json::json!( {
|
||||
"parachainInfo": {
|
||||
"parachainId": parachain_id
|
||||
},
|
||||
"sudo": {
|
||||
"key": Some(get_account_id_from_seed::<sr25519::Public>("Alice")),
|
||||
},
|
||||
"aura": { "authorities": collators },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ enum Runtime {
|
||||
CollectivesPolkadot,
|
||||
CollectivesWestend,
|
||||
Glutton,
|
||||
GluttonWestend,
|
||||
BridgeHub(chain_spec::bridge_hubs::BridgeHubRuntimeType),
|
||||
}
|
||||
|
||||
@@ -111,6 +112,8 @@ fn runtime(id: &str) -> Runtime {
|
||||
id.parse::<chain_spec::bridge_hubs::BridgeHubRuntimeType>()
|
||||
.expect("Invalid value"),
|
||||
)
|
||||
} else if id.starts_with("glutton-westend") {
|
||||
Runtime::GluttonWestend
|
||||
} else if id.starts_with("glutton") {
|
||||
Runtime::Glutton
|
||||
} else {
|
||||
@@ -219,8 +222,12 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
|
||||
Box::new(chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_bytes(
|
||||
&include_bytes!("../chain-specs/collectives-polkadot.json")[..],
|
||||
)?),
|
||||
"collectives-westend-dev" =>
|
||||
Box::new(chain_spec::collectives::collectives_westend_development_config()),
|
||||
"collectives-westend-local" =>
|
||||
Box::new(chain_spec::collectives::collectives_westend_local_config()),
|
||||
"collectives-westend" =>
|
||||
Box::new(chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_bytes(
|
||||
Box::new(chain_spec::collectives::CollectivesWestendChainSpec::from_json_bytes(
|
||||
&include_bytes!("../chain-specs/collectives-westend.json")[..],
|
||||
)?),
|
||||
|
||||
@@ -254,6 +261,18 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
|
||||
"polkadot-local",
|
||||
)),
|
||||
|
||||
// -- Glutton Westend
|
||||
"glutton-westend-dev" => Box::new(chain_spec::glutton::glutton_westend_development_config(
|
||||
para_id.expect("Must specify parachain id"),
|
||||
)),
|
||||
"glutton-westend-local" => Box::new(chain_spec::glutton::glutton_westend_local_config(
|
||||
para_id.expect("Must specify parachain id"),
|
||||
)),
|
||||
// the chain spec as used for generating the upgrade genesis values
|
||||
"glutton-westend-genesis" => Box::new(chain_spec::glutton::glutton_westend_config(
|
||||
para_id.expect("Must specify parachain id"),
|
||||
)),
|
||||
|
||||
// -- Glutton
|
||||
"glutton-kusama-dev" => Box::new(chain_spec::glutton::glutton_development_config(
|
||||
para_id.expect("Must specify parachain id"),
|
||||
@@ -288,9 +307,12 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
|
||||
Runtime::AssetHubWestend => Box::new(
|
||||
chain_spec::asset_hubs::AssetHubWestendChainSpec::from_json_file(path)?,
|
||||
),
|
||||
Runtime::CollectivesPolkadot | Runtime::CollectivesWestend => Box::new(
|
||||
Runtime::CollectivesPolkadot => Box::new(
|
||||
chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_file(path)?,
|
||||
),
|
||||
Runtime::CollectivesWestend => Box::new(
|
||||
chain_spec::collectives::CollectivesWestendChainSpec::from_json_file(path)?,
|
||||
),
|
||||
Runtime::Shell =>
|
||||
Box::new(chain_spec::shell::ShellChainSpec::from_json_file(path)?),
|
||||
Runtime::Seedling =>
|
||||
@@ -301,6 +323,8 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
|
||||
bridge_hub_runtime_type.chain_spec_from_json_file(path)?,
|
||||
Runtime::Penpal(_para_id) =>
|
||||
Box::new(chain_spec::penpal::PenpalChainSpec::from_json_file(path)?),
|
||||
Runtime::GluttonWestend =>
|
||||
Box::new(chain_spec::glutton::GluttonChainSpec::from_json_file(path)?),
|
||||
Runtime::Glutton =>
|
||||
Box::new(chain_spec::glutton::GluttonChainSpec::from_json_file(path)?),
|
||||
Runtime::Default => Box::new(
|
||||
@@ -322,6 +346,10 @@ fn extract_parachain_id(id: &str) -> (&str, &str, Option<ParaId>) {
|
||||
const GLUTTON_PARA_LOCAL_PREFIX: &str = "glutton-kusama-local-";
|
||||
const GLUTTON_PARA_GENESIS_PREFIX: &str = "glutton-kusama-genesis-";
|
||||
|
||||
const GLUTTON_WESTEND_PARA_DEV_PREFIX: &str = "glutton-westend-dev-";
|
||||
const GLUTTON_WESTEND_PARA_LOCAL_PREFIX: &str = "glutton-westend-local-";
|
||||
const GLUTTON_WESTEND_PARA_GENESIS_PREFIX: &str = "glutton-westend-genesis-";
|
||||
|
||||
let (norm_id, orig_id, para) = if let Some(suffix) = id.strip_prefix(KUSAMA_TEST_PARA_PREFIX) {
|
||||
let para_id: u32 = suffix.parse().expect("Invalid parachain-id suffix");
|
||||
(&id[..KUSAMA_TEST_PARA_PREFIX.len() - 1], id, Some(para_id))
|
||||
@@ -337,6 +365,15 @@ fn extract_parachain_id(id: &str) -> (&str, &str, Option<ParaId>) {
|
||||
} else if let Some(suffix) = id.strip_prefix(GLUTTON_PARA_GENESIS_PREFIX) {
|
||||
let para_id: u32 = suffix.parse().expect("Invalid parachain-id suffix");
|
||||
(&id[..GLUTTON_PARA_GENESIS_PREFIX.len() - 1], id, Some(para_id))
|
||||
} else if let Some(suffix) = id.strip_prefix(GLUTTON_WESTEND_PARA_DEV_PREFIX) {
|
||||
let para_id: u32 = suffix.parse().expect("Invalid parachain-id suffix");
|
||||
(&id[..GLUTTON_WESTEND_PARA_DEV_PREFIX.len() - 1], id, Some(para_id))
|
||||
} else if let Some(suffix) = id.strip_prefix(GLUTTON_WESTEND_PARA_LOCAL_PREFIX) {
|
||||
let para_id: u32 = suffix.parse().expect("Invalid parachain-id suffix");
|
||||
(&id[..GLUTTON_WESTEND_PARA_LOCAL_PREFIX.len() - 1], id, Some(para_id))
|
||||
} else if let Some(suffix) = id.strip_prefix(GLUTTON_WESTEND_PARA_GENESIS_PREFIX) {
|
||||
let para_id: u32 = suffix.parse().expect("Invalid parachain-id suffix");
|
||||
(&id[..GLUTTON_WESTEND_PARA_GENESIS_PREFIX.len() - 1], id, Some(para_id))
|
||||
} else {
|
||||
(id, id, None)
|
||||
};
|
||||
@@ -494,13 +531,20 @@ macro_rules! construct_partials {
|
||||
$code
|
||||
},
|
||||
},
|
||||
Runtime::CollectivesPolkadot | Runtime::CollectivesWestend => {
|
||||
Runtime::CollectivesPolkadot => {
|
||||
let $partials = new_partial::<collectives_polkadot_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
crate::service::aura_build_import_queue::<_, AuraId>,
|
||||
)?;
|
||||
$code
|
||||
},
|
||||
Runtime::CollectivesWestend => {
|
||||
let $partials = new_partial::<collectives_westend_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
crate::service::aura_build_import_queue::<_, AuraId>,
|
||||
)?;
|
||||
$code
|
||||
},
|
||||
Runtime::Shell => {
|
||||
let $partials = new_partial::<shell_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
@@ -529,6 +573,13 @@ macro_rules! construct_partials {
|
||||
)?;
|
||||
$code
|
||||
},
|
||||
Runtime::GluttonWestend => {
|
||||
let $partials = new_partial::<glutton_westend_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
crate::service::shell_build_import_queue,
|
||||
)?;
|
||||
$code
|
||||
},
|
||||
Runtime::Glutton => {
|
||||
let $partials = new_partial::<glutton_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
@@ -584,7 +635,7 @@ macro_rules! construct_async_run {
|
||||
{ $( $code )* }.map(|v| (v, task_manager))
|
||||
})
|
||||
},
|
||||
Runtime::CollectivesPolkadot | Runtime::CollectivesWestend => {
|
||||
Runtime::CollectivesPolkadot => {
|
||||
runner.async_run(|$config| {
|
||||
let $components = new_partial::<collectives_polkadot_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
@@ -594,6 +645,16 @@ macro_rules! construct_async_run {
|
||||
{ $( $code )* }.map(|v| (v, task_manager))
|
||||
})
|
||||
},
|
||||
Runtime::CollectivesWestend => {
|
||||
runner.async_run(|$config| {
|
||||
let $components = new_partial::<collectives_westend_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
crate::service::aura_build_import_queue::<_, AuraId>,
|
||||
)?;
|
||||
let task_manager = $components.task_manager;
|
||||
{ $( $code )* }.map(|v| (v, task_manager))
|
||||
})
|
||||
},
|
||||
Runtime::Shell => {
|
||||
runner.async_run(|$config| {
|
||||
let $components = new_partial::<shell_runtime::RuntimeApi, _>(
|
||||
@@ -705,6 +766,16 @@ macro_rules! construct_async_run {
|
||||
{ $( $code )* }.map(|v| (v, task_manager))
|
||||
})
|
||||
},
|
||||
Runtime::GluttonWestend => {
|
||||
runner.async_run(|$config| {
|
||||
let $components = new_partial::<glutton_westend_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
crate::service::shell_build_import_queue,
|
||||
)?;
|
||||
let task_manager = $components.task_manager;
|
||||
{ $( $code )* }.map(|v| (v, task_manager))
|
||||
})
|
||||
},
|
||||
Runtime::Glutton => {
|
||||
runner.async_run(|$config| {
|
||||
let $components = new_partial::<glutton_runtime::RuntimeApi, _>(
|
||||
@@ -836,7 +907,7 @@ pub fn run() -> Result<()> {
|
||||
// that both file paths exist, the node will exit, as the user must decide (by
|
||||
// deleting one path) the information that they want to use as their DB.
|
||||
let old_name = match config.chain_spec.id() {
|
||||
"asset-hub-polkadot" => Some("statemint"),
|
||||
"asset-hub-polkadot" => Some("statemint"),
|
||||
"asset-hub-kusama" => Some("statemine"),
|
||||
"asset-hub-westend" => Some("westmint"),
|
||||
"asset-hub-rococo" => Some("rockmine"),
|
||||
@@ -921,7 +992,7 @@ pub fn run() -> Result<()> {
|
||||
.await
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into),
|
||||
Runtime::CollectivesPolkadot | Runtime::CollectivesWestend =>
|
||||
Runtime::CollectivesPolkadot =>
|
||||
crate::service::start_generic_aura_node::<
|
||||
collectives_polkadot_runtime::RuntimeApi,
|
||||
AuraId,
|
||||
@@ -929,6 +1000,14 @@ pub fn run() -> Result<()> {
|
||||
.await
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into),
|
||||
Runtime::CollectivesWestend =>
|
||||
crate::service::start_generic_aura_node::<
|
||||
collectives_westend_runtime::RuntimeApi,
|
||||
AuraId,
|
||||
>(config, polkadot_config, collator_options, id, hwbench)
|
||||
.await
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into),
|
||||
Runtime::Shell =>
|
||||
crate::service::start_shell_node::<shell_runtime::RuntimeApi>(
|
||||
config,
|
||||
@@ -962,7 +1041,7 @@ pub fn run() -> Result<()> {
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into),
|
||||
Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type {
|
||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::Polkadot |
|
||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::Polkadot |
|
||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotLocal |
|
||||
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotDevelopment =>
|
||||
crate::service::start_generic_aura_node::<
|
||||
@@ -1019,6 +1098,14 @@ pub fn run() -> Result<()> {
|
||||
.await
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into),
|
||||
Runtime::GluttonWestend =>
|
||||
crate::service::start_basic_lookahead_node::<
|
||||
glutton_westend_runtime::RuntimeApi,
|
||||
AuraId,
|
||||
>(config, polkadot_config, collator_options, id, hwbench)
|
||||
.await
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into),
|
||||
Runtime::Glutton =>
|
||||
crate::service::start_basic_lookahead_node::<
|
||||
glutton_runtime::RuntimeApi,
|
||||
|
||||
@@ -156,6 +156,21 @@ impl sc_executor::NativeExecutionDispatch for CollectivesPolkadotRuntimeExecutor
|
||||
}
|
||||
}
|
||||
|
||||
/// Native Westend Collectives executor instance.
|
||||
pub struct CollectivesWestendRuntimeExecutor;
|
||||
|
||||
impl sc_executor::NativeExecutionDispatch for CollectivesWestendRuntimeExecutor {
|
||||
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
|
||||
|
||||
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||
collectives_westend_runtime::api::dispatch(method, data)
|
||||
}
|
||||
|
||||
fn native_version() -> sc_executor::NativeVersion {
|
||||
collectives_westend_runtime::native_version()
|
||||
}
|
||||
}
|
||||
|
||||
/// Native BridgeHubPolkadot executor instance.
|
||||
pub struct BridgeHubPolkadotRuntimeExecutor;
|
||||
|
||||
@@ -216,6 +231,21 @@ impl sc_executor::NativeExecutionDispatch for ContractsRococoRuntimeExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
/// Native Westend Glutton executor instance.
|
||||
pub struct GluttonWestendRuntimeExecutor;
|
||||
|
||||
impl sc_executor::NativeExecutionDispatch for GluttonWestendRuntimeExecutor {
|
||||
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
|
||||
|
||||
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||
glutton_westend_runtime::api::dispatch(method, data)
|
||||
}
|
||||
|
||||
fn native_version() -> sc_executor::NativeVersion {
|
||||
glutton_westend_runtime::native_version()
|
||||
}
|
||||
}
|
||||
|
||||
/// Native Glutton executor instance.
|
||||
pub struct GluttonRuntimeExecutor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user