Skip to content

Commit

Permalink
first try
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyWooo committed Dec 12, 2024
1 parent bbb8612 commit a46a1ba
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/check-runtime-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:

jobs:
check-condition:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
skip_simulation: ${{ steps.check.outputs.skip_simulation }}
steps:
Expand All @@ -37,7 +37,7 @@ jobs:
echo "skip_simulation=$skip_simulation" | tee -a $GITHUB_OUTPUT
runtime-matrix:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
runtime: ${{ steps.runtime.outputs.runtime }}
name: Parse runtime matrix
Expand All @@ -56,7 +56,7 @@ jobs:
echo "runtime=$TASKS" >> $GITHUB_OUTPUT
simulate-runtime-upgrade:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- check-condition
- runtime-matrix
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Fork ${{ matrix.runtime.name }} and launch parachain
timeout-minutes: 20
run: |
./scripts/fork-parachain-and-launch.sh ${{ matrix.runtime.name }}
./parachain/scripts/fork-parachain-and-launch.sh ${{ matrix.runtime.name }}
- name: Install subwasm ${{ env.SUBWASM_VERSION }}
run: |
Expand All @@ -92,7 +92,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 10
run: |
./scripts/runtime-upgrade.sh ${{ matrix.runtime.name }}-parachain-runtime.compact.compressed.wasm ${{ env.RELEASE_TAG }}
./parachain/scripts/runtime-upgrade.sh ${{ matrix.runtime.name }}-parachain-runtime.compact.compressed.wasm ${{ env.RELEASE_TAG }}
- name: Collect docker logs if test fails
continue-on-error: true
Expand All @@ -112,7 +112,7 @@ jobs:
retention-days: 3

try-runtime:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- check-condition
- runtime-matrix
Expand Down
29 changes: 22 additions & 7 deletions parachain/scripts/fork-parachain-and-launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ set -eo pipefail

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


curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
echo "nvm version: $(nvm --version)"

nvm install 20
echo "start chopsticks: $1"
npx @acala-network/[email protected] --config=litentry.yml --allow-unresolved-imports=true --block 6361000


exit 0


# setup TMPDIR
export TMPDIR=$(mktemp -d)
cleanup() {
Expand All @@ -27,10 +42,10 @@ function usage() {
print_divider
echo "Usage: $0 [chain] [ws-rpc-endpoint] [binary]"
echo
echo "chain: rococo|litentry"
echo " default: rococo"
echo "chain: paseo|litentry"
echo " default: paseo"
echo "ws-rpc-endpoint: the ws rpc endpoint of the parachain"
echo " default: litentry-rococo's rpc endpoint"
echo " default: litentry-paseo's rpc endpoint"
echo "binary: path to the litentry parachain binary"
echo " default: the binary copied from litentry/litentry-parachain:latest"
print_divider
Expand All @@ -47,12 +62,12 @@ case "$1" in
;;
esac

ORIG_CHAIN=${1:-rococo}
FORK_CHAIN=${ORIG_CHAIN}-dev
ORIG_CHAIN=${1:-paseo}
# FORK_CHAIN=${ORIG_CHAIN}-dev

case "$ORIG_CHAIN" in
rococo)
ENDPOINT="${2:-wss://rpc.litentry-parachain.litentry.io}"
paseo)
ENDPOINT="${2:-wss://rpc.paseo-parachain.litentry.io}"
;;
litentry)
ENDPOINT="${2:-wss://rpc.litentry-parachain.litentry.io}"
Expand Down
2 changes: 1 addition & 1 deletion parachain/scripts/runtime-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ print_divider

# 2. check if the released runtime version is greater than the on-chain runtime version,
# which should be now accessible via localhost:9944
onchain_version=$(curl -s -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "state_getRuntimeVersion", "params": [] }' http://localhost:9944 | jq .result.specVersion)
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)
release_version=$(subwasm --json info "$output_wasm" | jq .core_version.specVersion)

echo "Check runtime version ..."
Expand Down

0 comments on commit a46a1ba

Please sign in to comment.