File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 3
3
4
4
use super :: * ;
5
5
6
- pub fn localnet_config ( ) -> Result < ChainSpec , String > {
6
+ pub fn localnet_config ( single_authority : bool ) -> Result < ChainSpec , String > {
7
7
let wasm_binary = WASM_BINARY . ok_or_else ( || "Development wasm not available" . to_string ( ) ) ?;
8
8
9
9
// Give front-ends necessary data to present to users
@@ -32,11 +32,15 @@ pub fn localnet_config() -> Result<ChainSpec, String> {
32
32
. with_genesis_config_patch ( localnet_genesis (
33
33
// Initial PoA authorities (Validators)
34
34
// 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
+ } ,
40
44
// Pre-funded accounts
41
45
true ,
42
46
) )
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ impl SubstrateCli for Cli {
41
41
42
42
fn load_spec ( & self , id : & str ) -> Result < Box < dyn sc_service:: ChainSpec > , String > {
43
43
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 ) ?) ,
45
46
"finney" => Box :: new ( chain_spec:: finney:: finney_mainnet_config ( ) ?) ,
46
47
"devnet" => Box :: new ( chain_spec:: devnet:: devnet_config ( ) ?) ,
47
48
"" | "test_finney" => Box :: new ( chain_spec:: testnet:: finney_testnet_config ( ) ?) ,
You can’t perform that action at this time.
0 commit comments