diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..a78e451c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI +run-name: CI triggered from @${{ github.actor }} of ${{ github.head_ref }} + +on: + workflow_dispatch: + merge_group: + pull_request: + push: + branches: + - master + - develop + + +jobs: + build_and_run: + runs-on: ubuntu-8 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }} + restore-keys: ${{ runner.os }}-buildx- + + - name: Startup Nitro testnode + run: ${{ github.workspace }}/.github/workflows/testnode.bash diff --git a/.github/workflows/testnode.bash b/.github/workflows/testnode.bash new file mode 100755 index 00000000..1e191417 --- /dev/null +++ b/.github/workflows/testnode.bash @@ -0,0 +1,40 @@ +#!/bin/bash +# The script starts up the test node and waits until the timeout (10min) or +# until send-l2 succeeds. +GITHUB_WORKSPACE=. +# Start the test node and get PID, to terminate it once send-l2 is done. +${GITHUB_WORKSPACE}/test-node.bash --init > output.log 2>&1 & +PID=$! + +sleep 5m + +START=$(date +%s) +SUCCEDED=0 + +while true; do + if ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then + echo "Sending l2 transaction succeeded" + SUCCEDED=1 + break + fi + + # Check if the timeout (10 min) has been reached. + NOW=$(date +%s) + DIFF=$((NOW - START)) + if [ "$DIFF" -ge 600 ]; then + echo "Timed out" + break + fi + + sleep 10 +done + +# Shut down the test node and wait for it to terminate. +kill $PID +wait $PID + +if [ "$SUCCEDED" -eq 0 ]; then + exit 1 +fi + +exit 0 diff --git a/scripts/accounts.ts b/scripts/accounts.ts index 73de095a..20c1cbbe 100644 --- a/scripts/accounts.ts +++ b/scripts/accounts.ts @@ -85,10 +85,11 @@ export function namedAddress( export const namedAccountHelpString = "Valid account names:\n" + - " funnel | sequencer | validator - known keys\n" + - " user_[Alphanumeric] - key will be generated from username\n" + - " threaduser_[Alphanumeric] - same as user_[Alphanumeric]_thread_[thread-id]\n" + - " key_0x[full private key] - user with specified private key\n" + + " funnel | sequencer | validator | l2owner - known keys used by l2\n" + + " l3owner | l3sequencer - known keys used by l3\n" + + " user_[Alphanumeric] - key will be generated from username\n" + + " threaduser_[Alphanumeric] - same as user_[Alphanumeric]_thread_[thread-id]\n" + + " key_0x[full private key] - user with specified private key\n" + "\n" + "Valid addresses: any account name, or\n" + " address_0x[full eth address]\n" + @@ -123,7 +124,7 @@ export const printPrivateKeyCommand = { builder: { account: { string: true, - describe: "address (see general help)", + describe: "account (see general help)", default: "funnel", }, },