Skip to content

Commit bbeb358

Browse files
committed
Update README and add comments
Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
1 parent f50d921 commit bbeb358

3 files changed

Lines changed: 79 additions & 13 deletions

File tree

README.md

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Nitro Testnode
22

3-
Nitro-testnode brings up a full environment for local nitro testing (with Stylus support) including a dev-mode geth L1, and multiple instances with different roles.
3+
Nitro-testnode brings up a full environment for local Nitro testing (with Stylus support) including a dev-mode Geth L1, and multiple node instances with different roles.
44

55
### Requirements
66

@@ -44,9 +44,40 @@ Initialize the node in dev-mode (this will build the docker images from source)
4444
```
4545
To see more options, use `--help`.
4646

47+
## Node topology flags
48+
49+
By default, the testnode runs a single **sequencer** node that handles both consensus and execution in one process.
50+
51+
### `--follower-node`
52+
53+
Adds a **regular follower node** (`regular-follower-node`) that runs consensus and execution together in a single process, following the sequencer. Useful for testing read-only RPC nodes.
54+
55+
```bash
56+
./test-node.bash --init --dev --follower-node
57+
```
58+
59+
| Service | Ports |
60+
|---------|-------|
61+
| `regular-follower-node` | HTTP `8547` -> `7447`, WS `8548` -> `7548` |
62+
63+
### `--run-consensus-and-execution-in-different-processes`
64+
65+
Adds a **split-process follower** where consensus and execution run as separate containers communicating over authenticated RPC.
66+
67+
```bash
68+
./test-node.bash --init --dev --run-consensus-and-execution-in-different-processes
69+
```
70+
71+
| Service | Role | Ports |
72+
|---------|------|-------|
73+
| `consensus-follower-node` | Consensus (inbox, feed, validation) | HTTP `8547` -> `7147`, WS `8552` -> `8552` |
74+
| `execution-follower-node` | Execution (EVM, RPC, GraphQL) | HTTP `8547` -> `7247`, WS `9682` -> `9682` |
75+
76+
Both flags can be combined to run all three follower configurations simultaneously.
77+
4778
## Further information
4879

49-
### Branch Selection Guide (for devs working *on* nitro-testnode)
80+
### Branch selection guide (for devs working *on* nitro-testnode)
5081

5182
This repository maintains two main branches with distinct purposes.
5283

@@ -86,15 +117,15 @@ Target branch for changes supporting unreleased Nitro features.
86117

87118
### Working with docker containers
88119

89-
**sequencer** is the main docker to be used to access the nitro testchain. It's http and websocket interfaces are exposed at localhost ports 8547 and 8548 ports, respectively.
120+
**sequencer** is the main docker container used to access the Nitro testchain. Its HTTP and WebSocket interfaces are exposed at localhost ports 8547 and 8548, respectively.
90121

91-
Stopping, restarting nodes can be done with docker-compose.
122+
Stopping and restarting nodes can be done with docker-compose.
92123

93124
### Helper scripts
94125

95126
Some helper scripts are provided for simple testing of basic actions.
96127

97-
To fund the address 0x1111222233334444555566667777888899990000 on l2, use:
128+
To fund the address 0x1111222233334444555566667777888899990000 on L2, use:
98129

99130
```bash
100131
./test-node.bash script send-l2 --to address_0x1111222233334444555566667777888899990000
@@ -111,6 +142,41 @@ For help and further scripts, see:
111142
./test-node.bash script --help
112143
```
113144

145+
## Options reference
146+
147+
| Flag | Description |
148+
|------|-------------|
149+
| `--init` | Initialize the testnode (removes previous data, prompts for confirmation) |
150+
| `--init-force` | Initialize without confirmation prompt |
151+
| `--dev` | Build from local source in dev-mode (implies `--no-simple`) |
152+
| `--build` | Rebuild all docker images |
153+
| `--no-build` | Skip all docker image rebuilds |
154+
| `--simple` | Single node as sequencer/batch-poster/staker (default without `--dev`) |
155+
| `--no-simple` | Full configuration with separate sequencer/batch-poster/validator/relayer |
156+
| `--follower-node` | Run a follower node (single process, consensus + execution combined) |
157+
| `--run-consensus-and-execution-in-different-processes` | Run split consensus and execution follower nodes communicating over RPC |
158+
| `--validate` | Enable validation (implies `--no-simple`) |
159+
| `--batchposters` | Number of batch posters [0-3] (implies `--no-simple`) |
160+
| `--redundantsequencers` | Number of redundant sequencers [0-3] (implies `--no-simple`) |
161+
| `--l3node` | Enable an L3 node |
162+
| `--l3-fee-token` | Use a custom fee token on L3 (requires `--l3node`) |
163+
| `--l3-fee-token-decimals` | Set fee token decimals [0-36] (requires `--l3-fee-token`) |
164+
| `--l3-fee-token-pricer` | Enable fee token pricer (requires `--l3-fee-token`) |
165+
| `--l3-token-bridge` | Deploy L2-L3 token bridge (requires `--l3node`) |
166+
| `--l2-anytrust` | Enable AnyTrust DA on L2 |
167+
| `--l2-referenceda` | Enable reference DA on L2 |
168+
| `--l2-timeboost` | Enable TimeBOOST express lane auctions on L2 |
169+
| `--l2-tx-filtering` | Enable transaction filtering on L2 |
170+
| `--tokenbridge` | Deploy L1-L2 token bridge |
171+
| `--no-tokenbridge` | Skip token bridge deployment |
172+
| `--blockscout` | Build or launch Blockscout explorer |
173+
| `--pos` | Use proof-of-stake consensus client on L1 |
174+
| `--detach` | Detach from nodes after running them |
175+
| `--nowait` | Don't wait for nodes to be ready (requires `--detach`) |
176+
| `--no-run` | Don't launch nodes (useful with `--build` or `--init`) |
177+
| `--no-l2-traffic` | Disable L2 spam transaction traffic |
178+
| `--no-l3-traffic` | Disable L3 spam transaction traffic |
179+
114180
## Named accounts
115181

116182
```bash
@@ -121,7 +187,7 @@ sequencer: 0xe2148eE53c0755215Df69b2616E552154EdC584f
121187
validator: 0x6A568afe0f82d34759347bb36F14A6bB171d2CBe
122188
l2owner: 0x5E1497dD1f08C87b2d8FE23e9AAB6c1De833D927
123189
l3owner: 0x863c904166E801527125D8672442D736194A3362
124-
l3sequencer: 0x3E6134aAD4C4d422FF2A4391Dc315c4DDf98D1a5
190+
l3sequencer: 0x3E6134aAD4C4d422FF2A4391Dc315c4DDf98F1a5
125191
user_l1user: 0x058E6C774025ade66153C65672219191c72c7095
126192
user_token_bridge_deployer: 0x3EaCb30f025630857aDffac9B2366F953eFE4F98
127193
user_fee_token_deployer: 0x2AC5278D230f88B481bBE4A94751d7188ef48Ca2
@@ -138,5 +204,3 @@ To run the metrics stack (Prometheus + Grafana) read the instructions in the [me
138204
Discord - [Arbitrum](https://discord.com/invite/5KE54JwyTs)
139205

140206
Twitter: [Arbitrum](https://twitter.com/arbitrum)
141-
142-

docker-compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ services:
167167
- "config:/config"
168168
- "tokenbridge-data:/tokenbridge-data"
169169
command:
170-
- --conf.file=/config/consensus_config.json
170+
- --conf.file=/config/base_node_config.json
171171
- --node.feed.output.enable
172172
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
173173
- --node.seq-coordinator.my-url=http://sequencer:8547
@@ -201,7 +201,7 @@ services:
201201
- "config:/config"
202202
- "tokenbridge-data:/tokenbridge-data"
203203
command:
204-
- --conf.file=/config/consensus_config.json
204+
- --conf.file=/config/base_node_config.json
205205
- --node.seq-coordinator.my-url=http://sequencer:8547
206206
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
207207
- --graphql.enable
@@ -234,7 +234,7 @@ services:
234234
- "config:/config"
235235
- "tokenbridge-data:/tokenbridge-data"
236236
command:
237-
- --conf.file=/config/consensus_config.json
237+
- --conf.file=/config/base_node_config.json
238238
- --node.seq-coordinator.my-url=http://sequencer:8547
239239
- --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer
240240
- --graphql.enable

scripts/config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,10 @@ function writeConfigs(argv: any) {
428428
}
429429

430430
let consensusConfig = JSON.parse(baseConfJSON)
431-
consensusConfig.persistent.chain = "consensus-local"
432-
fs.writeFileSync(path.join(consts.configpath, "consensus_config.json"), JSON.stringify(consensusConfig))
431+
// Use a different persistent.chain name than the sequencer ("local") to avoid
432+
// storage lock conflicts between services sharing the same volume.
433+
consensusConfig.persistent.chain = "base-node-local"
434+
fs.writeFileSync(path.join(consts.configpath, "base_node_config.json"), JSON.stringify(consensusConfig))
433435

434436
let l3Config = JSON.parse(baseConfJSON)
435437
delete l3Config["init"]

0 commit comments

Comments
 (0)