From 7a1a38a3ff73549101cfd81a8e20247b97aafcb1 Mon Sep 17 00:00:00 2001 From: Aliaksandr Tsurko Date: Tue, 12 Nov 2024 17:25:07 +0100 Subject: [PATCH 1/2] Fix dev flag --- node/src/chain_spec/localnet.rs | 16 ++++++++++------ node/src/command.rs | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/node/src/chain_spec/localnet.rs b/node/src/chain_spec/localnet.rs index 1595c75ae1..06ff5b755e 100644 --- a/node/src/chain_spec/localnet.rs +++ b/node/src/chain_spec/localnet.rs @@ -3,7 +3,7 @@ use super::*; -pub fn localnet_config() -> Result { +pub fn localnet_config(single_authority: bool) -> Result { let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; // Give front-ends necessary data to present to users @@ -32,11 +32,15 @@ pub fn localnet_config() -> Result { .with_genesis_config_patch(localnet_genesis( // Initial PoA authorities (Validators) // aura | grandpa - vec![ - // Keys for debug - authority_keys_from_seed("Alice"), - authority_keys_from_seed("Bob"), - ], + if single_authority { + // single authority allows you to run the network using a single node + vec![authority_keys_from_seed("Alice")] + } else { + vec![ + authority_keys_from_seed("Alice"), + authority_keys_from_seed("Bob"), + ] + }, // Pre-funded accounts true, )) diff --git a/node/src/command.rs b/node/src/command.rs index a5a92a3770..7b6d6982b6 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -41,7 +41,8 @@ impl SubstrateCli for Cli { fn load_spec(&self, id: &str) -> Result, String> { Ok(match id { - "local" => Box::new(chain_spec::localnet::localnet_config()?), + "dev" => Box::new(chain_spec::localnet::localnet_config(true)?), + "local" => Box::new(chain_spec::localnet::localnet_config(false)?), "finney" => Box::new(chain_spec::finney::finney_mainnet_config()?), "devnet" => Box::new(chain_spec::devnet::devnet_config()?), "" | "test_finney" => Box::new(chain_spec::testnet::finney_testnet_config()?), From ac6726a4ca046ff14bc0f59a47f99677ef1363c0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Tsurko Date: Fri, 15 Nov 2024 16:49:27 +0100 Subject: [PATCH 2/2] Update spec version --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2455da5d04..cca99f6545 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -160,7 +160,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 208, + spec_version: 209, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,