Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyWooo committed Dec 11, 2024
1 parent 5c1d8b1 commit 5ca947e
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions parachain/scripts/runtime-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
set -eo pipefail

ROOTDIR=$(git rev-parse --show-toplevel)

# the script is used to simulate runtime upgrade, see:
# https://github.com/litentry/litentry-parachain/issues/378

# The latest state of the blockchain is scraped and used to bootstrap a chain locally via fork-off-substrate,
# see ./scripts/fork-parachain-and-launch.sh
#
# After that, this script:
# 1. get the runtime wasm
# 2. do runtime upgrade using wasm from step 1
# 3. verify if the runtime upgrade is successful

new_wasm=/tmp/runtime.wasm

function usage() {
Expand Down Expand Up @@ -95,10 +83,12 @@ print_divider
echo "Do runtime upgrade and verify ..."

nvm install 20
nvm use 20
echo "start chopsticks: $1"
npx @acala-network/[email protected] --config=$ROOTDIR/parachain/scripts/$1.yml --allow-unresolved-imports=true #--wasm-override $new_wasm
npx @acala-network/[email protected] --config=$ROOTDIR/parachain/scripts/$1.yml --allow-unresolved-imports=true --wasm-override $new_wasm &
PID=$!
echo "Started server with PID: $PID"

echo "after chopsticks: $1"
new_onchain_version=$(curl -s -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "state_getRuntimeVersion", "params": [] }' http://localhost:8000 | jq .result.specVersion)
if [ -n "$new_onchain_version" ] && \
[ "$new_onchain_version" -ne "$release_version" ]; then
Expand Down

0 comments on commit 5ca947e

Please sign in to comment.