Skip to content

Commit 749741a

Browse files
authored
feat: fix docker compose (#195)
* feat: fix docker compose * fix: remove dev from launch_l1.bash * feat: pin prometheus image
1 parent e6a8355 commit 749741a

File tree

7 files changed

+33
-37
lines changed

7 files changed

+33
-37
lines changed

crates/node/src/args.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ impl ScrollRollupNodeConfig {
264264
.enable_eth_scroll_wire_bridge
265265
.then_some(network.eth_wire_block_listener().await?);
266266

267-
// Instantiate the signer
268267
// Instantiate the signer
269268
let signer = if self.test {
270269
// Use a random private key signer for testing
@@ -393,15 +392,15 @@ pub struct SignerArgs {
393392
#[arg(
394393
long = "signer.key-file",
395394
value_name = "FILE_PATH",
396-
help = "Path to the hex-encoded private key file for the signer (optional 0x prefix). Mutually exclusive with AWS KMS key ID"
395+
help = "Path to the hex-encoded private key file for the signer (optional 0x prefix). Mutually exclusive with --signer.aws-kms-key-id"
397396
)]
398397
pub key_file: Option<PathBuf>,
399398

400399
/// AWS KMS Key ID for signing transactions
401400
#[arg(
402401
long = "signer.aws-kms-key-id",
403402
value_name = "KEY_ID",
404-
help = "AWS KMS Key ID for signing transactions. Mutually exclusive with key file"
403+
help = "AWS KMS Key ID for signing transactions. Mutually exclusive with --signer.key-file"
405404
)]
406405
pub aws_kms_key_id: Option<String>,
407406
}

docker-compose/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# .env
2+
SHADOW_FORK=false
3+
FORK_BLOCK_NUMBER=8700000
4+
ENV=dev

docker-compose/.env.shadow-fork

Lines changed: 0 additions & 4 deletions
This file was deleted.

docker-compose/README.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Scroll Rollup Node Docker Compose
22

3-
This guide explains how to use Docker Compose to launch the Scroll Rollup Node, including standard and shadow-fork modes.
3+
This guide explains how to use Docker Compose to launch the Scroll Rollup Node, including standard and shadow-fork
4+
modes.
45

56
---
67

78
## Prerequisites
9+
810
- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed
911
- Clone this repository
1012

@@ -24,20 +26,20 @@ This guide explains how to use Docker Compose to launch the Scroll Rollup Node,
2426
This will launch the rollup node, Prometheus, and Grafana with default settings.
2527

2628
3. **Access the services:**
27-
- Rollup Node JSON-RPC: [http://localhost:8545](http://localhost:8545)
28-
- Rollup Node WebSocket: [ws://localhost:8546](ws://localhost:8546)
29-
- Prometheus: [http://localhost:19090](http://localhost:19090)
30-
- Grafana: [http://localhost:13000](http://localhost:13000)
29+
- Rollup Node JSON-RPC: [http://localhost:8545](http://localhost:8545)
30+
- Rollup Node WebSocket: [ws://localhost:8546](ws://localhost:8546)
31+
- Prometheus: [http://localhost:19090](http://localhost:19090)
32+
- Grafana: [http://localhost:13000](http://localhost:13000)
3133

3234
---
3335

3436
## Shadow-Fork Mode
3537

3638
Shadow-fork mode allows you to run the node against a forked L1 chain for testing and development.
3739

38-
### 1. Edit the `.env.shadow-fork` file
40+
### 1. Edit the `.env` file
3941

40-
The file `docker-compose/.env.shadow-fork` contains environment variables for shadow-fork mode:
42+
The file `docker-compose/.env` contains environment variables for enabling shadow-fork mode:
4143

4244
```
4345
SHADOW_FORK=true
@@ -50,40 +52,34 @@ ENV=sepolia # Or 'mainnet' for mainnet fork
5052
**Recommended (Docker Compose v1.28+):**
5153

5254
```sh
53-
docker compose --env-file .env.shadow-fork --profile shadow-fork up -d
55+
docker compose --env-file .env --profile shadow-fork up -d
5456
```
5557

5658
- This will start both the L1 devnet and the rollup node in shadow-fork mode.
5759
- The `FORK_BLOCK_NUMBER` and `ENV` variables control the fork point and network.
5860

59-
**Alternative:**
60-
You can also copy or rename `.env.shadow-fork` to `.env` if you want it to be loaded automatically:
61-
62-
```sh
63-
cp .env.shadow-fork .env
64-
# Then run:
65-
docker compose --profile shadow-fork up -d
66-
```
67-
6861
---
6962

7063
## Stopping the Stack
7164

7265
To stop all services:
66+
7367
```sh
7468
docker compose down
7569
```
7670

7771
---
7872

7973
## Troubleshooting
74+
8075
- Make sure the ports (8545, 8546, 19090, 13000) are not used by other processes.
8176
- If you change environment variables, restart the stack with `docker compose down && docker compose up -d`.
8277
- For shadow-fork mode, always ensure you specify the correct `--env-file` or have the right `.env` file in place.
8378

8479
---
8580

8681
## More
82+
8783
- See `docker-compose/docker-compose.yml` for all available services and configuration options.
8884
- For advanced usage, refer to the official [Docker Compose documentation](https://docs.docker.com/compose/).
8985

docker-compose/docker-compose.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ services:
88
profiles:
99
- shadow-fork
1010
env_file:
11-
- .env.shadow-fork
12-
environment:
13-
- ENV=${ENV}
14-
- FORK_BLOCK_NUMBER=${FORK_BLOCK_NUMBER}
11+
- .env
1512
ports:
1613
- "8543:8545" # JSON-RPC
1714
- "8544:8546" # WebSocket
@@ -26,10 +23,8 @@ services:
2623
container_name: rollup-node
2724
entrypoint: ["bash", "/launch_rollup_node.bash"]
2825
env_file:
29-
- .env.shadow-fork
26+
- .env
3027
environment:
31-
- ENV=${ENV:-dev}
32-
- SHADOW_FORK=${SHADOW_FORK:-false}
3328
- RUST_LOG=sqlx=off,info
3429
ports:
3530
- "8545:8545" # JSON-RPC
@@ -42,7 +37,7 @@ services:
4237
- scroll-network
4338

4439
prometheus:
45-
image: prom/prometheus:latest
40+
image: prom/prometheus:v3.3.1
4641
container_name: prometheus
4742
ports:
4843
- "19090:9090" # Prometheus Web UI

docker-compose/launch_l1.bash

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ if [ "${FORK_BLOCK_NUMBER}" != "" ]; then
66
EXTRA_PARAMS="--fork-block-number ${FORK_BLOCK_NUMBER}"
77
fi
88

9-
if [ "${ENV:-}" = "sepolia" ]; then
10-
exec anvil --fork-url http://l1reth-rpc.sepolia.scroll.tech:8545 --chain-id 11155111 --host 0.0.0.0 --block-time 12 $EXTRA_PARAMS
11-
elif [ "${ENV:-}" = "mainnet" ]; then
9+
if [ "${ENV:-}" = "mainnet" ]; then
1210
exec anvil --fork-url http://l1geth-rpc.mainnet.scroll.tech:8545/l1 --chain-id 1 --host 0.0.0.0 --block-time 12 $EXTRA_PARAMS
13-
fi
11+
elif [ "${ENV:-}" = "sepolia" ]; then
12+
exec anvil --fork-url http://l1reth-rpc.sepolia.scroll.tech:8545 --chain-id 11155111 --host 0.0.0.0 --block-time 12 $EXTRA_PARAMS
13+
fi

docker-compose/launch_rollup_node.bash

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ wait_for_l1_devnet() {
99
}
1010

1111
if [ "${ENV:-}" = "dev" ]; then
12-
exec rollup-node node --chain dev --datadir=/l2reth --metrics=0.0.0.0:6060 --disable-discovery --http --http.addr=0.0.0.0 --http.port=8545 --http.corsdomain "*" --http.api admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev --ws --ws.addr=0.0.0.0 --ws.port=8546 --ws.api admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev --log.stdout.format log-fmt -vvv --sequencer.enabled --sequencer.block-time 250 --sequencer.payload-building-duration 230 --txpool.pending-max-count=1000000 --builder.gaslimit=10000000000 --rpc.max-connections=5000
12+
exec rollup-node node --chain dev --datadir=/l2reth --metrics=0.0.0.0:6060 --disable-discovery \
13+
--http --http.addr=0.0.0.0 --http.port=8545 --http.corsdomain "*" --http.api admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev \
14+
--ws --ws.addr=0.0.0.0 --ws.port=8546 --ws.api admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev \
15+
--log.stdout.format log-fmt -vvv \
16+
--test \
17+
--sequencer.enabled --sequencer.block-time 250 --sequencer.payload-building-duration 230 --txpool.pending-max-count=1000000 --builder.gaslimit=10000000000 \
18+
--rpc.max-connections=5000
1319
elif [ "${ENV:-}" = "sepolia" ]; then
1420
if [ "${SHADOW_FORK}" = "true" ]; then
1521
wait_for_l1_devnet

0 commit comments

Comments
 (0)