Commit 4c7cc56a authored by Gav Wood's avatar Gav Wood Committed by GitHub
Browse files

Final tweaks for PoC-2 runtime upgrade (#348)

* Final tweaks for PoC-2 runtime upgrade

* Address grumble

* Avoid slow wasm

* New poc-2-era bootnodes

* Fix warning

* Typo

* Fix for allocation in wasm

* Fix & runtimes.

* PoC-1 should be default.

* Name testnet Krumme Lanke, update README

* YML update

* Use the right port
parent 7e79f4c7
...@@ -27,8 +27,8 @@ pub enum ChainSpec { ...@@ -27,8 +27,8 @@ pub enum ChainSpec {
Development, Development,
/// Whatever the current runtime is, with simple Alice/Bob auths. /// Whatever the current runtime is, with simple Alice/Bob auths.
LocalTestnet, LocalTestnet,
/// The PoC-1 testnet. /// The PoC-1 & PoC-2 era testnet.
PoC1Testnet, KrummeLanke,
/// Whatever the current runtime is with the "global testnet" defaults. /// Whatever the current runtime is with the "global testnet" defaults.
StagingTestnet, StagingTestnet,
/// Custom Genesis file. /// Custom Genesis file.
...@@ -39,7 +39,7 @@ pub enum ChainSpec { ...@@ -39,7 +39,7 @@ pub enum ChainSpec {
impl ChainSpec { impl ChainSpec {
pub(crate) fn load(self) -> Result<service::ChainSpec, String> { pub(crate) fn load(self) -> Result<service::ChainSpec, String> {
Ok(match self { Ok(match self {
ChainSpec::PoC1Testnet => service::chain_spec::poc_1_testnet_config()?, ChainSpec::KrummeLanke => service::chain_spec::poc_1_testnet_config()?,
ChainSpec::Development => service::chain_spec::development_config(), ChainSpec::Development => service::chain_spec::development_config(),
ChainSpec::LocalTestnet => service::chain_spec::local_testnet_config(), ChainSpec::LocalTestnet => service::chain_spec::local_testnet_config(),
ChainSpec::StagingTestnet => service::chain_spec::staging_testnet_config(), ChainSpec::StagingTestnet => service::chain_spec::staging_testnet_config(),
...@@ -53,7 +53,8 @@ impl<'a> From<&'a str> for ChainSpec { ...@@ -53,7 +53,8 @@ impl<'a> From<&'a str> for ChainSpec {
match s { match s {
"dev" => ChainSpec::Development, "dev" => ChainSpec::Development,
"local" => ChainSpec::LocalTestnet, "local" => ChainSpec::LocalTestnet,
"poc-1" => ChainSpec::PoC1Testnet, "poc-1" => ChainSpec::KrummeLanke,
"krummelanke" => ChainSpec::KrummeLanke,
"staging" => ChainSpec::StagingTestnet, "staging" => ChainSpec::StagingTestnet,
s => ChainSpec::Custom(s.into()), s => ChainSpec::Custom(s.into()),
} }
...@@ -65,7 +66,7 @@ impl From<ChainSpec> for String { ...@@ -65,7 +66,7 @@ impl From<ChainSpec> for String {
match s { match s {
ChainSpec::Development => "dev".into(), ChainSpec::Development => "dev".into(),
ChainSpec::LocalTestnet => "local".into(), ChainSpec::LocalTestnet => "local".into(),
ChainSpec::PoC1Testnet => "poc-1".into(), ChainSpec::KrummeLanke => "krummelanke".into(),
ChainSpec::StagingTestnet => "staging".into(), ChainSpec::StagingTestnet => "staging".into(),
ChainSpec::Custom(f) => format!("custom ({})", f), ChainSpec::Custom(f) => format!("custom ({})", f),
} }
......
...@@ -69,7 +69,7 @@ args: ...@@ -69,7 +69,7 @@ args:
- chain: - chain:
long: chain long: chain
value_name: CHAIN_SPEC value_name: CHAIN_SPEC
help: Specify the chain specification (one of poc-1, dev, local or staging) help: Specify the chain specification (one of krummelanke, dev, local or staging)
takes_value: true takes_value: true
- pruning: - pruning:
long: pruning long: pruning
...@@ -118,7 +118,7 @@ subcommands: ...@@ -118,7 +118,7 @@ subcommands:
- chain: - chain:
long: chain long: chain
value_name: CHAIN_SPEC value_name: CHAIN_SPEC
help: Specify the chain specification (one of poc-1, dev, local or staging) help: Specify the chain specification (one of krummelanke, dev, local or staging)
takes_value: true takes_value: true
- export-blocks: - export-blocks:
about: Export blocks to a file about: Export blocks to a file
......
...@@ -111,9 +111,9 @@ impl substrate_rpc::system::SystemApi for SystemConfiguration { ...@@ -111,9 +111,9 @@ impl substrate_rpc::system::SystemApi for SystemConfiguration {
fn load_spec(matches: &clap::ArgMatches) -> Result<(service::ChainSpec, bool), String> { fn load_spec(matches: &clap::ArgMatches) -> Result<(service::ChainSpec, bool), String> {
let chain_spec = matches.value_of("chain") let chain_spec = matches.value_of("chain")
.map(ChainSpec::from) .map(ChainSpec::from)
.unwrap_or_else(|| if matches.is_present("dev") { ChainSpec::Development } else { ChainSpec::StagingTestnet }); .unwrap_or_else(|| if matches.is_present("dev") { ChainSpec::Development } else { ChainSpec::KrummeLanke });
let is_global = match chain_spec { let is_global = match chain_spec {
ChainSpec::PoC1Testnet | ChainSpec::StagingTestnet => true, ChainSpec::KrummeLanke | ChainSpec::StagingTestnet => true,
_ => false, _ => false,
}; };
let spec = chain_spec.load()?; let spec = chain_spec.load()?;
......
...@@ -847,6 +847,7 @@ name = "substrate-runtime-primitives" ...@@ -847,6 +847,7 @@ name = "substrate-runtime-primitives"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -23,7 +23,7 @@ use polkadot_runtime::{GenesisConfig, ConsensusConfig, CouncilConfig, DemocracyC ...@@ -23,7 +23,7 @@ use polkadot_runtime::{GenesisConfig, ConsensusConfig, CouncilConfig, DemocracyC
use service::ChainSpec; use service::ChainSpec;
pub fn poc_1_testnet_config() -> Result<ChainSpec<GenesisConfig>, String> { pub fn poc_1_testnet_config() -> Result<ChainSpec<GenesisConfig>, String> {
ChainSpec::from_embedded(include_bytes!("../res/poc-1.json")) ChainSpec::from_embedded(include_bytes!("../res/krummelanke.json"))
} }
fn staging_testnet_config_genesis() -> GenesisConfig { fn staging_testnet_config_genesis() -> GenesisConfig {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment