git.delta.rocks / unique-network / refs/commits / ec4bf05d3dc0

difftreelog

add: westend-local launch config

Igor Kozyrev2021-11-09parent: #dc1fefd.patch.diff
in: master

3 files changed

addedlaunch-config-westend.jsondiffbeforeafterboth
--- /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
+}
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
95 )95 )
96}96}
9797
98pub fn local_testnet_config(id: ParaId) -> ChainSpec {98pub fn local_testnet_rococo_config(id: ParaId) -> ChainSpec {
99 ChainSpec::from_genesis(99 ChainSpec::from_genesis(
100 // Name100 // Name
101 "Local Testnet",101 "Local Testnet",
144 )144 )
145}145}
146
147pub fn local_testnet_westend_config(id: ParaId) -> ChainSpec {
148 ChainSpec::from_genesis(
149 // Name
150 "Local Testnet",
151 // ID
152 "local_testnet",
153 ChainType::Local,
154 move || {
155 testnet_genesis(
156 // Sudo account
157 get_account_id_from_seed::<sr25519::Public>("Alice"),
158 vec![
159 get_from_seed::<AuraId>("Alice"),
160 get_from_seed::<AuraId>("Bob"),
161 get_from_seed::<AuraId>("Charlie"),
162 get_from_seed::<AuraId>("Dave"),
163 get_from_seed::<AuraId>("Eve"),
164 ],
165 // Pre-funded accounts
166 vec![
167 get_account_id_from_seed::<sr25519::Public>("Alice"),
168 get_account_id_from_seed::<sr25519::Public>("Bob"),
169 get_account_id_from_seed::<sr25519::Public>("Charlie"),
170 get_account_id_from_seed::<sr25519::Public>("Dave"),
171 get_account_id_from_seed::<sr25519::Public>("Eve"),
172 get_account_id_from_seed::<sr25519::Public>("Ferdie"),
173 get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
174 get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
175 get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
176 get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
177 get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
178 get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
179 ],
180 id,
181 )
182 },
183 // Bootnodes
184 vec![],
185 // Telemetry
186 None,
187 // Protocol ID
188 None,
189 // Properties
190 None,
191 // Extensions
192 Extensions {
193 relay_chain: "westend-local".into(),
194 para_id: id.into(),
195 },
196 )
197}
146198
147fn testnet_genesis(199fn testnet_genesis(
148 root_key: AccountId,200 root_key: AccountId,
modifiednode/cli/src/command.rsdiffbeforeafterboth
--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -42,8 +42,9 @@
 	para_id: ParaId,
 ) -> std::result::Result<Box<dyn sc_service::ChainSpec>, 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<Box<dyn sc_service::ChainSpec>, 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<dyn ChainSpec>) -> &'static RuntimeVersion {
@@ -217,7 +218,7 @@
 
 			let block: Block = generate_genesis_block(&load_spec(
 				&params.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::<polkadot_primitives::v0::AccountId>::into_account(&id);