Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ To fund the address 0x1111222233334444555566667777888899990000 on l2, use:
./test-node.bash script send-l2 --to address_0x1111222233334444555566667777888899990000
```

To get private key of an account you can:
```bash
./test-node.bash script print-private-key --account funnel
```

For help and further scripts, see:

```bash
Expand Down
93 changes: 93 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,99 @@ services:
- "consensus:/consensus"
- "config:/config"

execution-follower-node:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:7247:8547"
- "127.0.0.1:7248:8548"
- "127.0.0.1:9682:9682"
volumes:
- "seqdata:/home/user/.arbitrum/local/nitro"
- "l1keystore:/home/user/l1keystore"
- "config:/config"
- "tokenbridge-data:/tokenbridge-data"
command:
- --conf.file=/config/consensus_config.json
- --node.feed.output.enable
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
- --node.seq-coordinator.my-url=http://sequencer:8547
- --graphql.enable
- --graphql.vhosts=*
- --graphql.corsdomain=*
- --ws.addr=0.0.0.0
- --ws.port=9682
- --ws.api=net,web3,eth,txpool,debug,nitroexecution
- --execution.rpc-server.enable
- --execution.rpc-server.public
- --execution.rpc-server.authenticated=false
- --execution.consensus-rpc-client.url=ws://consensus-follower-node:8552
- --execution.consensus-rpc-client.jwtsecret=/config/jwt.hex
- --execution.consensus-rpc-client.retries=3
- --execution.consensus-rpc-client.connection-wait=15s
- --execution.consensus-rpc-client.retry-delay=1s
depends_on:
- geth

consensus-follower-node:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:7147:8547"
- "127.0.0.1:7148:8548"
- "127.0.0.1:8552:8552"
volumes:
- "seqdata:/home/user/.arbitrum/local/nitro"
- "l1keystore:/home/user/l1keystore"
- "config:/config"
- "tokenbridge-data:/tokenbridge-data"
command:
- --conf.file=/config/consensus_config.json
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
- --node.seq-coordinator.my-url=http://sequencer:8547
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
- --graphql.enable
- --graphql.vhosts=*
- --graphql.corsdomain=*
- --ws.addr=0.0.0.0
- --ws.port=8552
- --ws.api=net,web3,eth,txpool,debug,nitroconsensus
- --node.rpc-server.enable
- --node.rpc-server.public
- --node.rpc-server.authenticated=false
- --node.execution-rpc-client.url=ws://execution-follower-node:9682
- --node.execution-rpc-client.jwtsecret=/config/jwt.hex
- --node.execution-rpc-client.retries=3
- --node.execution-rpc-client.connection-wait=15s
- --node.execution-rpc-client.retry-delay=1s
depends_on:
- geth

regular-follower-node:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:7447:8547"
- "127.0.0.1:7548:8548"
volumes:
- "seqdata:/home/user/.arbitrum/local/nitro"
- "l1keystore:/home/user/l1keystore"
- "config:/config"
- "tokenbridge-data:/tokenbridge-data"
command:
- --conf.file=/config/consensus_config.json
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
- --node.seq-coordinator.my-url=http://sequencer:8547
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
- --graphql.enable
- --graphql.vhosts=*
- --graphql.corsdomain=*
depends_on:
- geth
Comment on lines +227 to +248
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't really need this but it was very helpful in debugging. I've added it behind --follower-node flag, but let me know if you prefer to remove it


sequencer:
pid: host # allow debugging
image: nitro-node-dev-testnode
Expand Down
25 changes: 24 additions & 1 deletion test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ blockscout=false
tokenbridge=false
l3node=false
consensusclient=false
run_consensus_and_execution_in_different_processes=false
follower_node=false
redundantsequencers=0
l3_custom_fee_token=false
l3_custom_fee_token_pricer=false
Expand Down Expand Up @@ -175,6 +177,14 @@ while [[ $# -gt 0 ]]; do
build_utils=true
shift
;;
--run-consensus-and-execution-in-different-processes)
run_consensus_and_execution_in_different_processes=true
shift
;;
--follower-node)
follower_node=true
shift
;;
--validate)
simple=false
validate=true
Expand Down Expand Up @@ -327,6 +337,7 @@ while [[ $# -gt 0 ]]; do
echo --l2-timeboost run the L2 with Timeboost enabled, including auctioneer and bid validator
echo --l2-tx-filtering run the L2 with transaction filtering enabled
echo --batchposters batch posters [0-3]
echo --follower-node run a follower node
echo --redundantsequencers redundant sequencers [0-3]
echo --detach detach from nodes after running them
echo --blockscout build or launch blockscout
Expand All @@ -343,6 +354,7 @@ while [[ $# -gt 0 ]]; do
echo --no-build-dev-blockscout don\'t rebuild dev blockscout docker image
echo --build-utils rebuild scripts, rollupcreator, token bridge docker images
echo --no-build-utils don\'t rebuild scripts, rollupcreator, token bridge docker images
echo --run-consensus-and-execution-in-different-processes run consensus and execution node in different processed communicating over rpc
echo --force-build-utils force rebuilding utils, useful if NITRO_CONTRACTS_BRANCH or TOKEN_BRIDGE_BRANCH changes
echo
echo script runs inside a separate docker. For SCRIPT-ARGS, run $0 script --help
Expand All @@ -353,6 +365,14 @@ done
NODES="sequencer"
INITIAL_SEQ_NODES="sequencer"

if $run_consensus_and_execution_in_different_processes && $simple; then
NODES="$NODES consensus-follower-node execution-follower-node"
fi

if $follower_node && $simple; then
NODES="$NODES regular-follower-node"
fi

if ! $simple; then
NODES="$NODES redis"
fi
Expand Down Expand Up @@ -623,10 +643,13 @@ if $force_init; then
run_script redis-init --redundancy $redundantsequencers
fi

echo == Funding l2 funnel and dev key
echo == Spinning up sequencer nodes
docker compose up --wait $INITIAL_SEQ_NODES
echo == Sleeping for 45s allow for parent chain to recieve the contract creation tx and process it
sleep 45 # in case we need to create a smart contract wallet, allow for parent chain to recieve the contract creation tx and process it
echo == Funding l2 funnel and dev key
run_script bridge-funds --ethamount 100000 --wait
echo == Funding l2owner
run_script send-l2 --ethamount 100 --to l2owner --wait
rollupAddress=`docker compose run --rm --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"`

Expand Down