Skip to content

Commit

Permalink
Add smoke test for altlayer config (OffchainLabs#59)
Browse files Browse the repository at this point in the history
* Add smoke test for altlayer config

* add docker compose down

* update docker compose

* cleanup

* address comments

* use full node as l2 url

* re-run ci
  • Loading branch information
Sneh1999 authored Oct 24, 2024
1 parent b33fc8d commit 896e4d2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
./smoke-test-nitro-simple.bash,
./smoke-test-full-node.bash,
./smoke-test-espresso-finality-node.bash,
./smoke-test-altlayer.bash,
]

runs-on: ubuntu-24.04
Expand Down
25 changes: 25 additions & 0 deletions smoke-test-altlayer.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail


# Run altlayer config with batch poster, sequencer, full node and validator
./test-node.bash --init-force --validate --batchposters 1 --latest-espresso-image --detach
docker compose up -d full-node --detach

# Sending L2 transaction through the full-node's api
user=user_l2user
./test-node.bash script send-l2 --l2url ws://full-node:8548 --ethamount 100 --to $user --wait

# Check the balance from full-node's api
userAddress=$(docker compose run scripts print-address --account $user | tail -n 1 | tr -d '\r\n')

while true; do
balance=$(cast balance $userAddress --rpc-url http://127.0.0.1:8947)
if [ ${#balance} -gt 0 ]; then
break
fi
sleep 1
done

echo "Smoke test succeeded."
docker compose down

0 comments on commit 896e4d2

Please sign in to comment.