Skip to content

Commit b903817

Browse files
authored
Merge pull request #956 from opentensor/fix/dev-flag
Fix dev flag
2 parents d23c372 + ac6726a commit b903817

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

node/src/chain_spec/localnet.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use super::*;
55

6-
pub fn localnet_config() -> Result<ChainSpec, String> {
6+
pub fn localnet_config(single_authority: bool) -> Result<ChainSpec, String> {
77
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
88

99
// Give front-ends necessary data to present to users
@@ -32,11 +32,15 @@ pub fn localnet_config() -> Result<ChainSpec, String> {
3232
.with_genesis_config_patch(localnet_genesis(
3333
// Initial PoA authorities (Validators)
3434
// aura | grandpa
35-
vec![
36-
// Keys for debug
37-
authority_keys_from_seed("Alice"),
38-
authority_keys_from_seed("Bob"),
39-
],
35+
if single_authority {
36+
// single authority allows you to run the network using a single node
37+
vec![authority_keys_from_seed("Alice")]
38+
} else {
39+
vec![
40+
authority_keys_from_seed("Alice"),
41+
authority_keys_from_seed("Bob"),
42+
]
43+
},
4044
// Pre-funded accounts
4145
true,
4246
))

node/src/command.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ impl SubstrateCli for Cli {
4141

4242
fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
4343
Ok(match id {
44-
"local" => Box::new(chain_spec::localnet::localnet_config()?),
44+
"dev" => Box::new(chain_spec::localnet::localnet_config(true)?),
45+
"local" => Box::new(chain_spec::localnet::localnet_config(false)?),
4546
"finney" => Box::new(chain_spec::finney::finney_mainnet_config()?),
4647
"devnet" => Box::new(chain_spec::devnet::devnet_config()?),
4748
"" | "test_finney" => Box::new(chain_spec::testnet::finney_testnet_config()?),

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
160160
// `spec_version`, and `authoring_version` are the same between Wasm and native.
161161
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
162162
// the compatible custom types.
163-
spec_version: 208,
163+
spec_version: 209,
164164
impl_version: 1,
165165
apis: RUNTIME_API_VERSIONS,
166166
transaction_version: 1,

0 commit comments

Comments
 (0)