mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 20:21:03 +00:00
Rococo/Westend Coretime Runtime
New runtimes for the Coretime Chain (a.k.a. "Broker Chain") described in RFC-1. Replaces https://github.com/paritytech/cumulus/pull/2889 - [x] Add Agile Coretime pallet https://github.com/paritytech/substrate/pull/14568 - [x] Generate chain specs for local and testnets - [x] Deploy parachain on Rococo - Done: [rococo-coretime-rpc.polkadot.io](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-coretime-rpc.polkadot.io#/explorer) DevOps issue for Aura keygen: https://github.com/paritytech/devops/issues/2725 Edit (Dónal): This PR is mainly for Rococo, the Westend runtime is a shell with no `Broker` pallet. The Rococo runtime has the broker calls filtered for initial deployment. --------- Co-authored-by: Dónal Murray <donal.murray@parity.io> Co-authored-by: 0xmovses <r.v.melkonian@gmail.com> Co-authored-by: Liam Aharon <liam.aharon@hotmail.com> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Marcin S. <marcin@realemail.net> Co-authored-by: Bastian Köcher <info@kchr.de> Co-authored-by: command-bot <> Co-authored-by: Branislav Kontur <bkontur@gmail.com>
This commit is contained in:
@@ -55,6 +55,7 @@ enum Runtime {
|
||||
Glutton,
|
||||
GluttonWestend,
|
||||
BridgeHub(chain_spec::bridge_hubs::BridgeHubRuntimeType),
|
||||
Coretime(chain_spec::coretime::CoretimeRuntimeType),
|
||||
}
|
||||
|
||||
trait RuntimeResolver {
|
||||
@@ -113,6 +114,10 @@ fn runtime(id: &str) -> Runtime {
|
||||
id.parse::<chain_spec::bridge_hubs::BridgeHubRuntimeType>()
|
||||
.expect("Invalid value"),
|
||||
)
|
||||
} else if id.starts_with(chain_spec::coretime::CoretimeRuntimeType::ID_PREFIX) {
|
||||
Runtime::Coretime(
|
||||
id.parse::<chain_spec::coretime::CoretimeRuntimeType>().expect("Invalid value"),
|
||||
)
|
||||
} else if id.starts_with("glutton-westend") {
|
||||
Runtime::GluttonWestend
|
||||
} else if id.starts_with("glutton") {
|
||||
@@ -211,6 +216,15 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
|
||||
.expect("invalid value")
|
||||
.load_config()?,
|
||||
|
||||
// -- Coretime
|
||||
coretime_like_id
|
||||
if coretime_like_id
|
||||
.starts_with(chain_spec::coretime::CoretimeRuntimeType::ID_PREFIX) =>
|
||||
coretime_like_id
|
||||
.parse::<chain_spec::coretime::CoretimeRuntimeType>()
|
||||
.expect("invalid value")
|
||||
.load_config()?,
|
||||
|
||||
// -- Penpal
|
||||
"penpal-rococo" => Box::new(chain_spec::penpal::get_penpal_chain_spec(
|
||||
para_id.expect("Must specify parachain id"),
|
||||
@@ -378,7 +392,8 @@ macro_rules! construct_partials {
|
||||
Runtime::AssetHubWestend |
|
||||
Runtime::BridgeHub(_) |
|
||||
Runtime::CollectivesPolkadot |
|
||||
Runtime::CollectivesWestend => {
|
||||
Runtime::CollectivesWestend |
|
||||
Runtime::Coretime(_) => {
|
||||
let $partials = new_partial::<RuntimeApi, _>(
|
||||
&$config,
|
||||
crate::service::aura_build_import_queue::<_, AuraId>,
|
||||
@@ -424,12 +439,13 @@ macro_rules! construct_async_run {
|
||||
{ $( $code )* }.map(|v| (v, task_manager))
|
||||
})
|
||||
},
|
||||
Runtime::AssetHubWestend |
|
||||
Runtime::AssetHubRococo |
|
||||
Runtime::AssetHubKusama |
|
||||
Runtime::AssetHubRococo |
|
||||
Runtime::AssetHubWestend |
|
||||
Runtime::BridgeHub(_) |
|
||||
Runtime::CollectivesPolkadot |
|
||||
Runtime::CollectivesWestend |
|
||||
Runtime::BridgeHub(_) => {
|
||||
Runtime::Coretime(_) => {
|
||||
runner.async_run(|$config| {
|
||||
let $components = new_partial::<RuntimeApi, _>(
|
||||
&$config,
|
||||
@@ -596,31 +612,31 @@ 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-kusama" => Some("statemine"),
|
||||
"asset-hub-westend" => Some("westmint"),
|
||||
"asset-hub-rococo" => Some("rockmine"),
|
||||
_ => None,
|
||||
"asset-hub-polkadot" => Some("statemint"),
|
||||
"asset-hub-kusama" => Some("statemine"),
|
||||
"asset-hub-westend" => Some("westmint"),
|
||||
"asset-hub-rococo" => Some("rockmine"),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
if let Some(old_name) = old_name {
|
||||
let new_path = config.base_path.config_dir(config.chain_spec.id());
|
||||
let old_path = config.base_path.config_dir(old_name);
|
||||
let new_path = config.base_path.config_dir(config.chain_spec.id());
|
||||
let old_path = config.base_path.config_dir(old_name);
|
||||
|
||||
if old_path.exists() && new_path.exists() {
|
||||
return Err(format!(
|
||||
if old_path.exists() && new_path.exists() {
|
||||
return Err(format!(
|
||||
"Found legacy {} path {} and new asset-hub path {}. Delete one path such that only one exists.",
|
||||
old_name, old_path.display(), new_path.display()
|
||||
).into())
|
||||
}
|
||||
}
|
||||
|
||||
if old_path.exists() {
|
||||
std::fs::rename(old_path.clone(), new_path.clone())?;
|
||||
if old_path.exists() {
|
||||
std::fs::rename(old_path.clone(), new_path.clone())?;
|
||||
info!(
|
||||
"Statemint renamed to Asset Hub. The filepath with associated data on disk has been renamed from {} to {}.",
|
||||
old_path.display(), new_path.display()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let hwbench = (!cli.no_hardware_benchmarks).then_some(
|
||||
@@ -729,6 +745,7 @@ pub fn run() -> Result<()> {
|
||||
.await
|
||||
.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 =>
|
||||
crate::service::start_generic_aura_node::<
|
||||
@@ -764,6 +781,22 @@ pub fn run() -> Result<()> {
|
||||
.map(|r| r.0),
|
||||
}
|
||||
.map_err(Into::into),
|
||||
|
||||
Runtime::Coretime(coretime_runtime_type) => match coretime_runtime_type {
|
||||
chain_spec::coretime::CoretimeRuntimeType::Rococo |
|
||||
chain_spec::coretime::CoretimeRuntimeType::RococoLocal |
|
||||
chain_spec::coretime::CoretimeRuntimeType::RococoDevelopment |
|
||||
chain_spec::coretime::CoretimeRuntimeType::WestendLocal |
|
||||
chain_spec::coretime::CoretimeRuntimeType::WestendDevelopment =>
|
||||
crate::service::start_generic_aura_node::<
|
||||
RuntimeApi,
|
||||
AuraId,
|
||||
>(config, polkadot_config, collator_options, id, hwbench)
|
||||
.await
|
||||
.map(|r| r.0),
|
||||
}
|
||||
.map_err(Into::into),
|
||||
|
||||
Runtime::Penpal(_) | Runtime::Default =>
|
||||
crate::service::start_rococo_parachain_node(
|
||||
config,
|
||||
|
||||
Reference in New Issue
Block a user