Versi chainspec based on Rococo. (#4485)

* Versi chainspec based on Rococo.

* Fix.

* Fix compilation without features.

* Spelling

* Another typo.

* Support versi in native version

* 🤦

* Regenerated genesis for versi.

* Update cli/src/command.rs

Co-authored-by: Bastian Köcher <info@kchr.de>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Robert Klotzner
2021-12-16 11:47:06 +01:00
committed by GitHub
parent 0891959f77
commit f88d980252
4 changed files with 301 additions and 8 deletions
+20 -5
View File
@@ -250,6 +250,9 @@ pub trait IdentifyVariant {
/// Returns if this is a configuration for the `Wococo` test network.
fn is_wococo(&self) -> bool;
/// Returns if this is a configuration for the `Versi` test network.
fn is_versi(&self) -> bool;
/// Returns true if this configuration is for a development network.
fn is_dev(&self) -> bool;
}
@@ -267,6 +270,9 @@ impl IdentifyVariant for Box<dyn ChainSpec> {
fn is_wococo(&self) -> bool {
self.id().starts_with("wococo") || self.id().starts_with("wco")
}
fn is_versi(&self) -> bool {
self.id().starts_with("versi") || self.id().starts_with("vrs")
}
fn is_dev(&self) -> bool {
self.id().ends_with("dev")
}
@@ -682,7 +688,10 @@ where
let backoff_authoring_blocks = {
let mut backoff = sc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging::default();
if config.chain_spec.is_rococo() || config.chain_spec.is_wococo() {
if config.chain_spec.is_rococo() ||
config.chain_spec.is_wococo() ||
config.chain_spec.is_versi()
{
// it's a testnet that's in flux, finality has stalled sometimes due
// to operational issues and it's annoying to slow down block
// production to 1 block per hour.
@@ -748,7 +757,7 @@ where
// Substrate nodes.
config.network.extra_sets.push(grandpa::grandpa_peers_set_config());
if chain_spec.is_rococo() || chain_spec.is_wococo() {
if chain_spec.is_rococo() || chain_spec.is_wococo() || chain_spec.is_versi() {
config.network.extra_sets.push(beefy_gadget::beefy_peers_set_config());
}
@@ -1054,7 +1063,7 @@ where
if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None };
// We currently only run the BEEFY gadget on the Rococo and Wococo testnets.
if enable_beefy && (chain_spec.is_rococo() || chain_spec.is_wococo()) {
if enable_beefy && (chain_spec.is_rococo() || chain_spec.is_wococo() || chain_spec.is_versi()) {
let beefy_params = beefy_gadget::BeefyParams {
client: client.clone(),
backend: backend.clone(),
@@ -1185,7 +1194,10 @@ pub fn new_chain_ops(
let telemetry_worker_handle = None;
#[cfg(feature = "rococo-native")]
if config.chain_spec.is_rococo() || config.chain_spec.is_wococo() {
if config.chain_spec.is_rococo() ||
config.chain_spec.is_wococo() ||
config.chain_spec.is_versi()
{
return chain_ops!(config, jaeger_agent, telemetry_worker_handle; rococo_runtime, RococoExecutorDispatch, Rococo)
}
@@ -1218,7 +1230,10 @@ pub fn build_full(
overseer_gen: impl OverseerGen,
) -> Result<NewFull<Client>, Error> {
#[cfg(feature = "rococo-native")]
if config.chain_spec.is_rococo() || config.chain_spec.is_wococo() {
if config.chain_spec.is_rococo() ||
config.chain_spec.is_wococo() ||
config.chain_spec.is_versi()
{
return new_full::<rococo_runtime::RuntimeApi, RococoExecutorDispatch, _>(
config,
is_collator,