difftreelog
refactor(zombienet) minor fixes and clarity
in: master
3 files changed
.docker/forkless-config/zombienet-forkless-nodata.tomldiffbeforeafterboth1[settings]2provider = "native"34[relaychain]5default_command = "/polkadot/target/release/polkadot"6default_args = [ "-lparachain::candidate_validation=debug", "-lxcm=trace", ]7chain = "{{ RELAY_CHAIN_TYPE }}-local"89 [[relaychain.nodes]]10 name = "relay-alice"11 ws_port = 984412 rpc_port = 984313 p2p_port = 304441415 [[relaychain.node_groups]]16 name = "relay"17 count = 41819[[parachains]]20id = 100021chain_spec_modifier_commands = [[22 "chainql",23 "--tla-code=rawSpec=import '{{'raw'|chainSpec}}'",24 "--tla-str=forkFrom={{ REPLICA_FROM }}",25 "fork.jsonnet",26]]2728 [[parachains.collators]]29 name = "alice"30 command = "/unique-chain/current/release/unique-collator"31 ws_port = 994432 rpc_port = 993333 p2p_port = 3120034 args = [35 "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug",36 "--ws-max-connections=1000",37 ]3839 [[parachains.collators]]40 name = "bob"41 command = "/unique-chain/current/release/unique-collator"42 ws_port = 994543 rpc_port = 993444 p2p_port = 3120145 args = [46 "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug",47 "--ws-max-connections=1000",48 ]1[settings]2provider = "native"34[relaychain]5default_command = "/polkadot/target/release/polkadot"6default_args = [ "-lparachain::candidate_validation=debug", "-lxcm=trace", ]7chain = "{{ RELAY_CHAIN_TYPE }}-local"89 [[relaychain.nodes]]10 name = "relay-alice"11 ws_port = 984412 rpc_port = 984313 p2p_port = 304441415 [[relaychain.node_groups]]16 name = "relay"17 count = 41819[[parachains]]20id = 10002122 [[parachains.collators]]23 name = "alice"24 command = "/unique-chain/current/release/unique-collator"25 ws_port = 994426 rpc_port = 993327 p2p_port = 3120028 args = [29 "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug",30 "--ws-max-connections=1000",31 ]3233 [[parachains.collators]]34 name = "bob"35 command = "/unique-chain/current/release/unique-collator"36 ws_port = 994537 rpc_port = 993438 p2p_port = 3120139 args = [40 "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug",41 "--ws-max-connections=1000",42 ]launch-zombienet.tomldiffbeforeafterboth--- a/launch-zombienet.toml
+++ b/launch-zombienet.toml
@@ -1,10 +1,10 @@
-# To launch this zombienet out-of-the-box, you can use `yarn frankenstein` in the `tests` folder.
+# To launch this zombienet out-of-the-box, run `yarn frankenstein` in the `tests` folder.
[settings]
provider = "native"
[relaychain]
-# RELAY_DIR is an environment variable. You should likely specify it as ../polkadot/
+# RELAY_DIR is an environment variable. If you're launching ZN from the repository's root, you should likely specify it as ../polkadot/
default_command = "{{RELAY_DIR}}target/release/polkadot"
default_args = [ "-lparachain::candidate_validation=debug", "-lxcm=trace", ]
chain = "rococo-local"
@@ -24,7 +24,7 @@
[[parachains.collators]]
name = "alice"
- # PARA_DIR is an environment variable. You should likely specify it as ./
+ # PARA_DIR is an environment variable. If you're launching ZN from the repository's root, you should likely specify it as ./
command = "{{PARA_DIR}}target/release/unique-collator"
ws_port = 9944
rpc_port = 9933
@@ -33,7 +33,7 @@
[[parachains.collators]]
name = "bob"
- # PARA_DIR is an environment variable. You should likely specify it as ./
+ # PARA_DIR is an environment variable. If you're launching ZN from the repository's root, you should likely specify it as ./
command = "{{PARA_DIR}}target/release/unique-collator"
ws_port = 9945
rpc_port = 9934
tests/src/util/frankenstein.tsdiffbeforeafterboth--- a/tests/src/util/frankenstein.ts
+++ b/tests/src/util/frankenstein.ts
@@ -96,7 +96,7 @@
}
const raiseZombienet = async (): Promise<void> => {
- const isUpgradeTesting = !!NEW_RELAY_BIN || !!NEW_RELAY_WASM || !!NEW_RELAY_BIN && !!NEW_PARA_WASM;
+ const isUpgradeTesting = !!NEW_RELAY_BIN || !!NEW_RELAY_WASM || !!NEW_PARA_BIN || !!NEW_PARA_WASM;
/*
// If there is nothing to upgrade, what is the point
if (!isUpgradeTesting) {
@@ -120,18 +120,19 @@
await cryptoWaitReady();
+ // Launch Zombienet!
+ network = await zombie.start(ZOMBIENET_CREDENTIALS, networkConfig, {silent: false});
+
// Get the relay chain info like the epoch length and spec version
// Then restart each parachain's binaries
// // Stop and restart each node
// // Send specified keys to parachain nodes in case the parachain requires it
// If it is not needed to upgrade runtimes themselves, the job is done!
- network = await zombie.start(ZOMBIENET_CREDENTIALS, networkConfig, {silent: false});
-
// Record some required information regarding the relay chain
await network.relay[0].connectApi();
let relayInfo = getRelayInfo(network.relay[0].apiInstance!);
- await network.relay[0].apiInstance?.disconnect();
+ await network.relay[0].apiInstance!.disconnect();
if (isUpgradeTesting) {
console.log('Relay stats:', relayInfo);
}
@@ -172,6 +173,7 @@
await node.restart();
// applyaurakey?
+ // Zombienet handles it on first-time node creation
}
}