diff --git a/node/Cargo.toml b/node/Cargo.toml index f871bdcb..2b21acc1 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -81,7 +81,12 @@ color-print.workspace = true substrate-build-script-utils.workspace = true [features] -default = [] +default = ["paseo"] +paseo = [ + "pop-runtime-common/paseo", + "pop-runtime-devnet/paseo", + "pop-runtime-testnet/paseo", +] runtime-benchmarks = [ "cumulus-primitives-core/runtime-benchmarks", "frame-benchmarking-cli/runtime-benchmarks", diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index ab9ad921..a29af02a 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -17,9 +17,13 @@ pub type TestnetChainSpec = /// The default XCM version to set in genesis config. const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; pub(crate) enum Relay { + #[cfg(not(feature = "paseo"))] Rococo, + #[cfg(feature = "paseo")] Paseo, + #[cfg(not(feature = "paseo"))] RococoLocal, + #[cfg(feature = "paseo")] PaseoLocal, } @@ -86,6 +90,7 @@ fn configure_for_relay( match relay { // Test relay chains + #[cfg(not(feature = "paseo"))] Relay::Rococo => { para_id = 4385; properties.insert("tokenSymbol".into(), "ROC".into()); @@ -93,6 +98,7 @@ fn configure_for_relay( (Extensions { relay_chain: "rococo".into(), para_id }, para_id) }, + #[cfg(feature = "paseo")] Relay::Paseo => { para_id = 4001; properties.insert("tokenSymbol".into(), "PAS".into()); @@ -101,6 +107,7 @@ fn configure_for_relay( (Extensions { relay_chain: "paseo".into(), para_id }, para_id) }, // Local relay chains + #[cfg(not(feature = "paseo"))] Relay::RococoLocal => { para_id = 4385; properties.insert("tokenSymbol".into(), "ROC".into()); @@ -108,6 +115,7 @@ fn configure_for_relay( (Extensions { relay_chain: "rococo-local".into(), para_id }, para_id) }, + #[cfg(feature = "paseo")] Relay::PaseoLocal => { para_id = 4001; properties.insert("tokenSymbol".into(), "PAS".into()); @@ -128,7 +136,7 @@ pub fn development_config(relay: Relay) -> DevnetChainSpec { extensions, ) .with_name("Pop Network Development") - .with_id("pop-dev") + .with_id("pop-devnet") .with_chain_type(ChainType::Development) .with_genesis_config_patch(devnet_genesis( // initial collators. diff --git a/node/src/command.rs b/node/src/command.rs index 1260e293..98af5450 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -30,9 +30,9 @@ trait RuntimeResolver { /// Private helper that pattern matches on the input (which is expected to be a ChainSpec ID) /// and returns the Runtime accordingly. fn runtime(id: &str) -> Runtime { - if id.starts_with("dev") { + if id.starts_with("dev") || id.ends_with("devnet") { Runtime::Devnet - } else if id.starts_with("test") { + } else if id.starts_with("test") || id.ends_with("testnet") { Runtime::Testnet } else { log::warn!("No specific runtime was recognized for ChainSpec's Id: '{}', so Runtime::Devnet will be used", id); @@ -64,10 +64,17 @@ impl RuntimeResolver for PathBuf { fn load_spec(id: &str) -> std::result::Result, String> { Ok(match id { + #[cfg(not(feature = "paseo"))] "dev-rococo" => Box::new(chain_spec::development_config(Relay::RococoLocal)), + #[cfg(feature = "paseo")] "dev-paseo" => Box::new(chain_spec::development_config(Relay::PaseoLocal)), + #[cfg(not(feature = "paseo"))] "pop-rococo" => Box::new(chain_spec::testnet_config(Relay::Rococo)), + #[cfg(feature = "paseo")] "pop-paseo" => Box::new(chain_spec::testnet_config(Relay::Paseo)), + #[cfg(feature = "paseo")] + "" | "local" => Box::new(chain_spec::development_config(Relay::PaseoLocal)), + #[cfg(not(feature = "paseo"))] "" | "local" => Box::new(chain_spec::development_config(Relay::RococoLocal)), path => { let path: PathBuf = path.into();