Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dev flag #956

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions node/src/chain_spec/localnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use super::*;

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

// Give front-ends necessary data to present to users
Expand Down Expand Up @@ -32,11 +32,15 @@ pub fn localnet_config() -> Result<ChainSpec, String> {
.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,
))
Expand Down
3 changes: 2 additions & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ impl SubstrateCli for Cli {

fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, 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()?),
Expand Down
Loading