--- /dev/null +++ b/launch-config-westend.json @@ -0,0 +1,152 @@ +{ + "relaychain": { + "bin": "../polkadot/target/release/polkadot", + "chain": "westend-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--rpc-port=9843", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--rpc-port=9854", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--rpc-port=9865", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--rpc-port=9876", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9886, + "port": 30888, + "flags": [ + "--rpc-port=9886", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "ferdie", + "wsPort": 9897, + "rpcPort": 9896, + "port": 30999, + "flags": [ + "--rpc-port=9896", + "-lparachain::candidate_validation=debug" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "../unique-chain/target/release/nft", + "chain": "westend-local", + "balance": "1000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--rpc-port=9933", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--rpc-port=9934", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "port": 31202, + "wsPort": 9946, + "rpcPort": 9935, + "name": "charlie", + "flags": [ + "--rpc-cors=all", + "--rpc-port=9935", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "port": 31203, + "wsPort": 9947, + "rpcPort": 9936, + "name": "dave", + "flags": [ + "--rpc-cors=all", + "--rpc-port=9936", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "port": 31204, + "wsPort": 9948, + "rpcPort": 9937, + "name": "eve", + "flags": [ + "--rpc-cors=all", + "--rpc-port=9937", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -95,7 +95,7 @@ ) } -pub fn local_testnet_config(id: ParaId) -> ChainSpec { +pub fn local_testnet_rococo_config(id: ParaId) -> ChainSpec { ChainSpec::from_genesis( // Name "Local Testnet", @@ -144,6 +144,58 @@ ) } +pub fn local_testnet_westend_config(id: ParaId) -> ChainSpec { + ChainSpec::from_genesis( + // Name + "Local Testnet", + // ID + "local_testnet", + ChainType::Local, + move || { + testnet_genesis( + // Sudo account + get_account_id_from_seed::("Alice"), + vec![ + get_from_seed::("Alice"), + get_from_seed::("Bob"), + get_from_seed::("Charlie"), + get_from_seed::("Dave"), + get_from_seed::("Eve"), + ], + // Pre-funded accounts + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + get_account_id_from_seed::("Charlie//stash"), + get_account_id_from_seed::("Dave//stash"), + get_account_id_from_seed::("Eve//stash"), + get_account_id_from_seed::("Ferdie//stash"), + ], + id, + ) + }, + // Bootnodes + vec![], + // Telemetry + None, + // Protocol ID + None, + // Properties + None, + // Extensions + Extensions { + relay_chain: "westend-local".into(), + para_id: id.into(), + }, + ) +} + fn testnet_genesis( root_key: AccountId, initial_authorities: Vec, --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -42,8 +42,9 @@ para_id: ParaId, ) -> std::result::Result, String> { Ok(match id { + "westend-local" => Box::new(chain_spec::local_testnet_westend_config(para_id)), "dev" => Box::new(chain_spec::development_config(para_id)), - "" | "local" => Box::new(chain_spec::local_testnet_config(para_id)), + "" | "local" => Box::new(chain_spec::local_testnet_rococo_config(para_id)), path => Box::new(chain_spec::ChainSpec::from_json_file( std::path::PathBuf::from(path), )?), @@ -84,7 +85,7 @@ } fn load_spec(&self, id: &str) -> std::result::Result, String> { - load_spec(id, self.run.parachain_id.unwrap_or(200).into()) + load_spec(id, self.run.parachain_id.unwrap_or(2000).into()) } fn native_runtime_version(_: &Box) -> &'static RuntimeVersion { @@ -217,7 +218,7 @@ let block: Block = generate_genesis_block(&load_spec( ¶ms.chain.clone().unwrap_or_default(), - params.parachain_id.unwrap_or(200).into(), + params.parachain_id.unwrap_or(2000).into(), )?)?; let raw_header = block.header().encode(); let output_buf = if params.raw { @@ -280,7 +281,7 @@ .chain(cli.relaychain_args.iter()), ); - let id = ParaId::from(cli.run.parachain_id.or(para_id).unwrap_or(200)); + let id = ParaId::from(cli.run.parachain_id.or(para_id).unwrap_or(2000)); let parachain_account = AccountIdConversion::::into_account(&id);