Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anodar tmp #43

Closed
wants to merge 14 commits into from
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions .github/workflows/testnode.bash
Original file line number Diff line number Diff line change
@@ -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
11 changes: 6 additions & 5 deletions scripts/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
Expand Down Expand Up @@ -123,7 +124,7 @@ export const printPrivateKeyCommand = {
builder: {
account: {
string: true,
describe: "address (see general help)",
describe: "account (see general help)",
default: "funnel",
},
},
Expand Down
Loading