Skip to content

Commit

Permalink
update sidecar (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Oct 13, 2023
1 parent 6a82d4e commit d319a35
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions packages/e2e/scripts/sidecar-chopsticks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,35 @@

set -x

# clone sidecard
git clone https://github.com/paritytech/substrate-api-sidecar.git

# run chopsticks node
yarn dev:acala --port 8011 & ACALA_PID=$!
yarn dev:karura --port 8012 & KARURA_PID=$!

# prepare sidecar
cd substrate-api-sidecar
printf "Waiting for chains to be ready"
until nc -z localhost 8011 && nc -z localhost 8012; do
sleep 5
done

yarn
yarn add -D ts-node
SAS_SUBSTRATE_URL=ws://127.0.0.1:8011 SAS_EXPRESS_PORT=8111 npx --yes @substrate/api-sidecar & ACALA_SIDECAR_PID=$!
SAS_SUBSTRATE_URL=ws://127.0.0.1:8012 SAS_EXPRESS_PORT=8112 npx --yes @substrate/api-sidecar & KARURA_SIDECAR_PID=$!

SAS_SUBSTRATE_URL=ws://127.0.0.1:8011 SAS_EXPRESS_PORT=8111 yarn ts-node src/main.ts & ACALA_SIDECAR_PID=$!
SAS_SUBSTRATE_URL=ws://127.0.0.1:8012 SAS_EXPRESS_PORT=8112 yarn ts-node src/main.ts & KARURA_SIDECAR_PID=$!
printf "Waiting for sidecars to be ready"
until nc -z localhost 8111 && nc -z localhost 8112; do
sleep 5
done

# wait a bit for it to be ready
sleep 10
# clone sidecard
git clone --depth 1 --branch v17.2.0 --single-branch https://github.com/paritytech/substrate-api-sidecar.git

# prepare sidecar
cd substrate-api-sidecar
yarn install

# run the tests
yarn ts-node e2e-tests/latest/index.ts --chain acala --url http://127.0.0.1:8111
npx --yes ts-node e2e-tests/latest/index.ts --chain acala --url http://127.0.0.1:8111
ACALA_TEST_RESULT=$?

yarn ts-node e2e-tests/latest/index.ts --chain karura --url http://127.0.0.1:8112
npx --yes ts-node e2e-tests/latest/index.ts --chain karura --url http://127.0.0.1:8112
KARURA_TEST_RESULT=$?

cd ..
Expand Down

0 comments on commit d319a35

Please sign in to comment.