Skip to content

Commit 3b1d3b7

Browse files
committed
Extend nitro-testnode to run consensus and exection separately
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
1 parent 0d1b2ee commit 3b1d3b7

3 files changed

Lines changed: 122 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ To fund the address 0x1111222233334444555566667777888899990000 on l2, use:
100100
./test-node.bash script send-l2 --to address_0x1111222233334444555566667777888899990000
101101
```
102102

103+
To get private key of an account you can:
104+
```bash
105+
./test-node.bash script print-private-key --account funnel
106+
```
107+
103108
For help and further scripts, see:
104109

105110
```bash

docker-compose.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,99 @@ services:
154154
- "consensus:/consensus"
155155
- "config:/config"
156156

157+
execution-follower-node:
158+
pid: host # allow debugging
159+
image: nitro-node-dev-testnode
160+
entrypoint: /usr/local/bin/nitro
161+
ports:
162+
- "127.0.0.1:7247:8547"
163+
- "127.0.0.1:7248:8548"
164+
- "127.0.0.1:9682:9682"
165+
volumes:
166+
- "seqdata:/home/user/.arbitrum/local/nitro"
167+
- "l1keystore:/home/user/l1keystore"
168+
- "config:/config"
169+
- "tokenbridge-data:/tokenbridge-data"
170+
command:
171+
- --conf.file=/config/consensus_config.json
172+
- --node.feed.output.enable
173+
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
174+
- --node.seq-coordinator.my-url=http://sequencer:8547
175+
- --graphql.enable
176+
- --graphql.vhosts=*
177+
- --graphql.corsdomain=*
178+
- --ws.addr=0.0.0.0
179+
- --ws.port=9682
180+
- --ws.api=net,web3,eth,txpool,debug,nitroexecution
181+
- --execution.rpc-server.enable
182+
- --execution.rpc-server.public
183+
- --execution.rpc-server.authenticated=false
184+
- --execution.consensus-rpc-client.url=ws://consensus-follower-node:8552
185+
- --execution.consensus-rpc-client.jwtsecret=/config/jwt.hex
186+
- --execution.consensus-rpc-client.retries=3
187+
- --execution.consensus-rpc-client.connection-wait=15s
188+
- --execution.consensus-rpc-client.retry-delay=1s
189+
depends_on:
190+
- geth
191+
192+
consensus-follower-node:
193+
pid: host # allow debugging
194+
image: nitro-node-dev-testnode
195+
entrypoint: /usr/local/bin/nitro
196+
ports:
197+
- "127.0.0.1:7147:8547"
198+
- "127.0.0.1:7148:8548"
199+
- "127.0.0.1:8552:8552"
200+
volumes:
201+
- "seqdata:/home/user/.arbitrum/local/nitro"
202+
- "l1keystore:/home/user/l1keystore"
203+
- "config:/config"
204+
- "tokenbridge-data:/tokenbridge-data"
205+
command:
206+
- --conf.file=/config/consensus_config.json
207+
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
208+
- --node.seq-coordinator.my-url=http://sequencer:8547
209+
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
210+
- --graphql.enable
211+
- --graphql.vhosts=*
212+
- --graphql.corsdomain=*
213+
- --ws.addr=0.0.0.0
214+
- --ws.port=8552
215+
- --ws.api=net,web3,eth,txpool,debug,nitroconsensus
216+
- --node.rpc-server.enable
217+
- --node.rpc-server.public
218+
- --node.rpc-server.authenticated=false
219+
- --node.execution-rpc-client.url=ws://execution-follower-node:9682
220+
- --node.execution-rpc-client.jwtsecret=/config/jwt.hex
221+
- --node.execution-rpc-client.retries=3
222+
- --node.execution-rpc-client.connection-wait=15s
223+
- --node.execution-rpc-client.retry-delay=1s
224+
depends_on:
225+
- geth
226+
227+
regular-follower-node:
228+
pid: host # allow debugging
229+
image: nitro-node-dev-testnode
230+
entrypoint: /usr/local/bin/nitro
231+
ports:
232+
- "127.0.0.1:7447:8547"
233+
- "127.0.0.1:7548:8548"
234+
volumes:
235+
- "seqdata:/home/user/.arbitrum/local/nitro"
236+
- "l1keystore:/home/user/l1keystore"
237+
- "config:/config"
238+
- "tokenbridge-data:/tokenbridge-data"
239+
command:
240+
- --conf.file=/config/consensus_config.json
241+
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
242+
- --node.seq-coordinator.my-url=http://sequencer:8547
243+
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
244+
- --graphql.enable
245+
- --graphql.vhosts=*
246+
- --graphql.corsdomain=*
247+
depends_on:
248+
- geth
249+
157250
sequencer:
158251
pid: host # allow debugging
159252
image: nitro-node-dev-testnode

test-node.bash

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ blockscout=false
5050
tokenbridge=false
5151
l3node=false
5252
consensusclient=false
53+
run_consensus_and_execution_in_different_processes=false
54+
follower_node=false
5355
redundantsequencers=0
5456
l3_custom_fee_token=false
5557
l3_custom_fee_token_pricer=false
@@ -175,6 +177,14 @@ while [[ $# -gt 0 ]]; do
175177
build_utils=true
176178
shift
177179
;;
180+
--run-consensus-and-execution-in-different-processes)
181+
run_consensus_and_execution_in_different_processes=true
182+
shift
183+
;;
184+
--follower-node)
185+
follower_node=true
186+
shift
187+
;;
178188
--validate)
179189
simple=false
180190
validate=true
@@ -327,6 +337,7 @@ while [[ $# -gt 0 ]]; do
327337
echo --l2-timeboost run the L2 with Timeboost enabled, including auctioneer and bid validator
328338
echo --l2-tx-filtering run the L2 with transaction filtering enabled
329339
echo --batchposters batch posters [0-3]
340+
echo --follower-node run a follower node
330341
echo --redundantsequencers redundant sequencers [0-3]
331342
echo --detach detach from nodes after running them
332343
echo --blockscout build or launch blockscout
@@ -343,6 +354,7 @@ while [[ $# -gt 0 ]]; do
343354
echo --no-build-dev-blockscout don\'t rebuild dev blockscout docker image
344355
echo --build-utils rebuild scripts, rollupcreator, token bridge docker images
345356
echo --no-build-utils don\'t rebuild scripts, rollupcreator, token bridge docker images
357+
echo --run-consensus-and-execution-in-different-processes run consensus and execution node in different processed communicating over rpc
346358
echo --force-build-utils force rebuilding utils, useful if NITRO_CONTRACTS_BRANCH or TOKEN_BRIDGE_BRANCH changes
347359
echo
348360
echo script runs inside a separate docker. For SCRIPT-ARGS, run $0 script --help
@@ -353,6 +365,14 @@ done
353365
NODES="sequencer"
354366
INITIAL_SEQ_NODES="sequencer"
355367

368+
if $run_consensus_and_execution_in_different_processes && $simple; then
369+
NODES="$NODES consensus-follower-node execution-follower-node"
370+
fi
371+
372+
if $follower_node && $simple; then
373+
NODES="$NODES regular-follower-node"
374+
fi
375+
356376
if ! $simple; then
357377
NODES="$NODES redis"
358378
fi
@@ -623,10 +643,13 @@ if $force_init; then
623643
run_script redis-init --redundancy $redundantsequencers
624644
fi
625645

626-
echo == Funding l2 funnel and dev key
646+
echo == Spinning up sequencer nodes
627647
docker compose up --wait $INITIAL_SEQ_NODES
648+
echo == Sleeping for 45s allow for parent chain to recieve the contract creation tx and process it
628649
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
650+
echo == Funding l2 funnel and dev key
629651
run_script bridge-funds --ethamount 100000 --wait
652+
echo == Funding l2owner
630653
run_script send-l2 --ethamount 100 --to l2owner --wait
631654
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'"`
632655

0 commit comments

Comments
 (0)