Skip to content

Commit 7a1a38a

Browse files
committed
Fix dev flag
1 parent b096420 commit 7a1a38a

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

node/src/chain_spec/localnet.rs

+10-6
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

+2-1
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()?),

0 commit comments

Comments
 (0)