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

Mak trappist tryruntime2 #33

Merged
merged 9 commits into from
Jun 19, 2023
Merged
11 changes: 9 additions & 2 deletions commands/try-runtime/try-runtime.cmd.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
"configuration": { "gitlab": { "job": { "tags": ["linux-docker-vm-c2"], "variables": {} } } },
"presets": {
"polkadot": {
"description": "Run try-runtime with specified network",
"description": "Run try-runtime with specified runtime for Polkadot",
"repos": ["polkadot", "command-bot-test"],
"args": {
"network": { "label": "Network", "type_one_of": ["polkadot", "kusama", "westend", "rococo"] }
"chain":{ "label": "Chain", "type_one_of": ["polkadot", "kusama", "westend", "rococo"] }
}
},
"trappist": {
"description": "Run try-runtime for Trappist",
"repos": ["trappist"],
"args": {
"chain":{ "label": "Chain", "type_one_of": ["trappist"] }
}
}
}
Expand Down
30 changes: 17 additions & 13 deletions commands/try-runtime/try-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@ main() {

cmd_runner_apply_patches --setup-cleanup true

local network="$1"

# remove $1 and let the rest args to be passed later as "$@"
shift

if [ -z "$network" ];
then
die "the network should be provided"
fi
local chain="$1"
local chain_node=""

case "$chain" in
polkadot|kusama|westend|rococo)
chain_node="polkadot"
;;
trappist)
chain_node="trappist-node"
;;
*)
die "Invalid chain $chain"
;;
esac

set -x
export RUST_LOG="${RUST_LOG:-remote-ext=debug,runtime=trace}"
Expand All @@ -34,16 +39,15 @@ main() {

cargo build --release --features try-runtime

cp "./target/release/${repository}" node-try-runtime
cp "./target/release/wbuild/${network}-runtime/${network}_runtime.wasm" runtime-try-runtime.wasm
cp "./target/release/${chain_node}" node-try-runtime
cp "./target/release/wbuild/${chain}-runtime/${chain}_runtime.wasm" runtime-try-runtime.wasm

./node-try-runtime \
try-runtime \
--runtime runtime-try-runtime.wasm \
-lruntime=debug \
on-runtime-upgrade \
live --uri "wss://${network}-try-runtime-node.parity-chains.parity.io:443" \
"$@"
live --uri "wss://${chain}-try-runtime-node.parity-chains.parity.io:443"
}

main "$@"