diff --git a/polkadot/cli/src/command.rs b/polkadot/cli/src/command.rs index de6e035520..15f3d18350 100644 --- a/polkadot/cli/src/command.rs +++ b/polkadot/cli/src/command.rs @@ -132,6 +132,8 @@ impl SubstrateCli for Cli { "versi-dev" => Box::new(service::chain_spec::versi_development_config()?), #[cfg(feature = "rococo-native")] "versi-local" => Box::new(service::chain_spec::versi_local_testnet_config()?), + #[cfg(feature = "rococo-native")] + "versi-staging" => Box::new(service::chain_spec::versi_staging_testnet_config()?), #[cfg(not(feature = "rococo-native"))] name if name.starts_with("versi-") => Err(format!("`{}` only supported with `rococo-native` feature enabled.", name))?, diff --git a/polkadot/node/service/src/chain_spec.rs b/polkadot/node/service/src/chain_spec.rs index f87ad97c2e..f12879291a 100644 --- a/polkadot/node/service/src/chain_spec.rs +++ b/polkadot/node/service/src/chain_spec.rs @@ -54,6 +54,8 @@ const KUSAMA_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/" const WESTEND_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; #[cfg(feature = "rococo-native")] const ROCOCO_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; +#[cfg(feature = "rococo-native")] +const VERSI_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; const DEFAULT_PROTOCOL_ID: &str = "dot"; /// Node `ChainSpec` extensions. @@ -1190,6 +1192,32 @@ pub fn rococo_staging_testnet_config() -> Result { )) } +/// Versi staging testnet config. +#[cfg(feature = "rococo-native")] +pub fn versi_staging_testnet_config() -> Result { + let wasm_binary = rococo::WASM_BINARY.ok_or("Versi development wasm not available")?; + let boot_nodes = vec![]; + + Ok(RococoChainSpec::from_genesis( + "Versi Staging Testnet", + "versi_staging_testnet", + ChainType::Live, + move || RococoGenesisExt { + runtime_genesis_config: rococo_staging_testnet_config_genesis(wasm_binary), + session_length_in_blocks: Some(100), + }, + boot_nodes, + Some( + TelemetryEndpoints::new(vec![(VERSI_STAGING_TELEMETRY_URL.to_string(), 0)]) + .expect("Versi Staging telemetry url is valid; qed"), + ), + Some(DEFAULT_PROTOCOL_ID), + None, + None, + Default::default(), + )) +} + /// Helper function to generate a crypto pair from seed pub fn get_from_seed(seed: &str) -> ::Public { TPublic::Pair::from_string(&format!("//{}", seed), None)