diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index ff970214..5b9b87d0 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -2,3 +2,4 @@ - [Introduction](./chapter_1.md) - [Running a Node](./running-a-node.md) +- [Running with Docker Compose](./docker-operations.md) diff --git a/book/src/docker-operations.md b/book/src/docker-operations.md new file mode 100644 index 00000000..41233c8a --- /dev/null +++ b/book/src/docker-operations.md @@ -0,0 +1,574 @@ +# Running with Docker Compose + +This guide covers how to run the Scroll rollup node using Docker Compose. The Docker setup provides a complete +environment including the rollup node, monitoring infrastructure, and optional L1 devnet for shadow-fork testing. + +## Overview + +The Docker Compose stack includes the following services: + +- **rollup-node**: The main Scroll rollup node +- **prometheus**: Metrics collection and time-series database +- **grafana**: Visualization dashboard for metrics +- **l1-devnet** (optional): Local L1 Ethereum node for shadow-fork mode + +## Prerequisites + +- [Docker](https://docs.docker.com/get-docker/) installed (version 20.10 or later) +- [Docker Compose](https://docs.docker.com/compose/install/) installed (version 1.28 or later) +- At least 16 GB RAM +- Sufficient disk space for chain data + +## Quick Start + +### 1. Navigate to Docker Compose Directory + +```bash +cd docker-compose +``` + +### 2. Configure Environment + +The docker-compose setup uses a `.env` file for configuration. You **must** configure your own L1 RPC and beacon node +endpoints. + +Key environment variables: + +- `ENV`: The network to connect to (`sepolia`, `mainnet`, or `dev`) +- `SHADOW_FORK`: Enable shadow-fork mode (`true` or `false`) +- `FORK_BLOCK_NUMBER`: Block number to fork from (when shadow-fork is enabled) +- `L1_URL`: Your L1 Ethereum RPC endpoint URL (e.g., Alchemy, Infura, QuickNode) +- `BEACON_URL`: Your beacon node URL for blob data + +**Note**: You must provide your own RPC endpoints. Configure these in your `.env` file before starting the stack. + +### 3. Start the Stack + +For standard operation (following public networks): + +```bash +docker compose up -d +``` + +For shadow-fork mode: + +```bash +docker compose --profile shadow-fork up -d +``` + +### 4. Access the Services + +Once running, the following endpoints are available: + +- **Rollup Node JSON-RPC**: [http://localhost:8545](http://localhost:8545) +- **Rollup Node WebSocket**: [ws://localhost:8546](ws://localhost:8546) +- **Rollup Node Metrics**: [http://localhost:6060/metrics](http://localhost:6060/metrics) +- **Prometheus UI**: [http://localhost:19090](http://localhost:19090) +- **Grafana Dashboards**: [http://localhost:13000](http://localhost:13000) + +## Operating Modes + +### Standard Mode (Follower Node) + +Standard mode connects the rollup node to public Scroll networks (Sepolia or Mainnet). + +#### Sepolia Testnet + +Edit your `.env` file with your RPC endpoints: + +```env +ENV=sepolia +SHADOW_FORK=false +L1_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY +BEACON_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY +``` + +Replace `YOUR_API_KEY` with your actual API key from your RPC provider (Alchemy, Infura, QuickNode, etc.). + +Start the services: + +```bash +docker compose up -d +``` + +The node will: + +- Connect to your configured L1 RPC endpoint +- Connect to your configured beacon node +- Sync from the Scroll Sepolia network +- Connect to trusted peers on the network + +#### Mainnet + +Edit your `.env` file with your RPC endpoints: + +```env +ENV=mainnet +SHADOW_FORK=false +L1_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY +BEACON_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY +``` + +Replace `YOUR_API_KEY` with your actual API key from your RPC provider (Alchemy, Infura, QuickNode, etc.). + +Start the services: + +```bash +docker compose up -d +``` + +The node will: + +- Connect to your configured L1 RPC endpoint +- Connect to your configured beacon node +- Sync from the Scroll Mainnet network +- Connect to trusted peers on the network + +### Shadow-Fork Mode + +Shadow-fork mode runs the rollup node against a forked L1 chain, useful for testing and development without affecting +the live network. + +#### Configuration + +Edit your `.env` file: + +```env +ENV=sepolia # or mainnet +SHADOW_FORK=true +FORK_BLOCK_NUMBER=8700000 # Adjust to your desired fork point +``` + +#### Starting Shadow-Fork + +```bash +docker compose --profile shadow-fork up -d +``` + +This will: + +1. Start an L1 devnet (Anvil) forked from the specified block +2. Start the rollup node configured to use the local L1 devnet +3. Start Prometheus and Grafana for monitoring + +#### How Shadow-Fork Works + +The `l1-devnet` service uses Foundry's Anvil to create a local fork: + +```bash +anvil --fork-url \ + --fork-block-number \ + --chain-id \ + --host 0.0.0.0 \ + --block-time 12 +``` + +The rollup node then connects to this local L1 at `http://l1-devnet:8545` instead of the public L1 RPC. + +#### Use Cases + +Shadow-fork mode is ideal for: + +- Testing node behavior at specific block heights +- Debugging derivation issues +- Development without consuming testnet resources +- Simulating historical scenarios + +### Development Mode + +For local development with a completely isolated environment: + +```env +ENV=dev +``` + +This mode: + +- Uses the `dev` chain spec +- Enables sequencer mode +- Bypasses signing requirements with `--test` flag +- Disables peer discovery +- Sets fast block times (250ms) + +### Configuring RPC Endpoints + +You **must** configure your own L1 RPC and beacon node URLs using a provider of your choice: + +**Recommended Providers:** + +- [Alchemy](https://www.alchemy.com/) - Offers free tier with generous limits +- [Infura](https://infura.io/) - Reliable infrastructure with free tier +- [QuickNode](https://www.quicknode.com/) - High-performance nodes +- Your own self-hosted L1 archive node + +**Requirements:** + +- L1 RPC endpoint must support Ethereum mainnet or Sepolia testnet +- Beacon node must provide EIP-4844 blob data access +- Both endpoints should be reliable with good uptime + +#### Configuration Priority + +The launch script determines which URLs to use in this order: + +1. **User-provided URLs** (via `L1_URL` or `BEACON_URL`) - highest priority +2. **Shadow-fork URLs** (if `SHADOW_FORK=true`) - uses local L1 devnet +3. **Error** - If no URLs are configured and not in shadow-fork mode, the node will fail to start + +#### Example: Using Alchemy for Sepolia + +Edit your `.env` file: + +```env +ENV=sepolia +SHADOW_FORK=false +L1_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY +BEACON_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY +``` + +Then start: + +```bash +docker compose up -d +``` + +#### Verifying RPC Connectivity + +After starting the node, verify connectivity to your RPC endpoints by checking the logs: + +```bash +docker compose logs rollup-node | grep -i "l1\|beacon" +``` + +You should see logs indicating successful connection to your configured endpoints. If you see connection errors, verify +your URLs and API keys are correct. + +## Service Details + +### Rollup Node Service + +**Image**: `scrolltech/rollup-node:v0.0.1-rc67` + +**Port Mappings**: + +- `8545`: JSON-RPC interface +- `8546`: WebSocket interface +- `6060`: Metrics endpoint + +**Volumes**: + +- `./volumes/l2reth`: Node data directory (chain state, database) +- `./launch_rollup_node.bash`: Entrypoint script (read-only) + +**Configuration**: + +The `launch_rollup_node.bash` script configures the node based on the `ENV` variable: + +- **dev**: Local sequencer mode with fast block times +- **sepolia**: Sepolia follower with optional shadow-fork +- **mainnet**: Mainnet follower with optional shadow-fork + +Key command-line flags used: + +```bash +--chain # Chain specification +--datadir=/l2reth # Data directory +--metrics=0.0.0.0:6060 # Metrics endpoint +--disable-discovery # P2P discovery disabled in Docker +--http --http.addr=0.0.0.0 --http.port=8545 +--ws --ws.addr=0.0.0.0 --ws.port=8546 +--http.api admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev +--l1.url # L1 RPC endpoint +--blob.beacon_node_urls # Beacon node endpoint +--blob.s3_url # S3 Blob URL +--trusted-peers # Trusted P2P peers +``` + +### L1 Devnet Service (Shadow-Fork Only) + +**Image**: `ghcr.io/foundry-rs/foundry:v1.2.3` + +**Port Mappings**: + +- `8543`: JSON-RPC interface (mapped from internal 8545) +- `8544`: WebSocket interface (mapped from internal 8546) + +**Volumes**: + +- `./volumes/l1devnet`: Anvil state directory +- `./launch_l1.bash`: Entrypoint script (read-only) + +**Profile**: `shadow-fork` (only starts when this profile is active) + +### Prometheus Service + +**Image**: `prom/prometheus:v3.3.1` + +**Port Mappings**: + +- `19090`: Prometheus web UI + +**Volumes**: + +- `./resource/prometheus.yml`: Configuration file (read-only) +- `./volumes/prometheus`: Time-series database storage + +**Configuration**: + +Prometheus scrapes metrics from the rollup node every 10 seconds at `http://rollup-node:6060/metrics`. The configuration +includes: + +- **Scrape interval**: 10 seconds +- **Retention time**: 1 day +- **Retention size**: 512 MB +- **WAL compression**: Enabled + +### Grafana Service + +**Image**: `grafana/grafana:12.0.2` + +**Port Mappings**: + +- `13000`: Grafana web UI (mapped from internal 3000) + +**Volumes**: + +- `./resource/grafana-datasource.yml`: Prometheus datasource config (read-only) +- `./resource/grafana-dashboard-providers.yml`: Dashboard provider config (read-only) +- `./resource/dashboards/`: Pre-built dashboard JSON files (read-only) +- `./volumes/grafana`: Grafana database and settings + +**Configuration**: + +- **Anonymous access**: Enabled with Admin role (for easy local access) +- **Default home dashboard**: Overview dashboard +- **Pre-provisioned dashboards**: + - `overview.json`: High-level node metrics + - `performance.json`: Performance and throughput metrics + - `state_history.json`: State and history metrics + - `transaction_pool.json`: Transaction pool metrics + - `rollup_node.json`: Rollup-specific metrics + +## Monitoring and Observability + +### Accessing Grafana Dashboards + +1. Open [http://localhost:13000](http://localhost:13000) in your browser +2. No login required (anonymous access enabled) +3. Select from pre-configured dashboards in the sidebar + +### Available Dashboards + +#### Overview Dashboard + +Provides high-level metrics including: + +- Block production rate +- Sync status +- L1/L2 block heights +- Network peer count + +#### Performance Dashboard + +Detailed performance metrics: + +- CPU and memory usage +- Database operations per second +- RPC request latency +- Block processing time + +#### Transaction Pool Dashboard + +Transaction pool monitoring: + +- Pending transaction count +- Transaction pool size +- Transaction arrival rate +- Gas price distribution + +#### Rollup Node Dashboard + +Rollup-specific metrics: + +- L1 batch processing +- Derivation pipeline throughput +- Engine API calls +- Consolidation status + +### Prometheus Queries + +Access Prometheus at [http://localhost:19090](http://localhost:19090) to run custom queries. + +Example queries: + +```promql +# Current block height +scroll_block_height + +# Block processing rate (blocks per second) +rate(scroll_blocks_processed_total[1m]) + +# L1 batch processing time +histogram_quantile(0.95, scroll_l1_batch_processing_seconds_bucket) + +# RPC request rate by method +rate(scroll_rpc_requests_total[5m]) +``` + +### Viewing Logs + +#### All Services + +```bash +docker compose logs -f +``` + +#### Specific Service + +```bash +docker compose logs -f rollup-node +docker compose logs -f prometheus +docker compose logs -f grafana +``` + +#### With Timestamps + +```bash +docker compose logs -f -t rollup-node +``` + +#### Last N Lines + +```bash +docker compose logs --tail=100 rollup-node +``` + +## Volume Management + +### Data Persistence + +The Docker Compose setup uses local volumes in `./volumes/` to persist data: + +``` +volumes/ +├── l1devnet/ # L1 devnet state (shadow-fork only) +├── l2reth/ # Rollup node data (chain state, database) +├── prometheus/ # Prometheus time-series data +└── grafana/ # Grafana configuration and dashboards +``` + +### Backing Up Data + +To backup your node data: + +```bash +# Stop the services first +docker compose down + +# Create a backup +tar -czf backup-$(date +%Y%m%d).tar.gz volumes/ + +# Restart services +docker compose up -d +``` + +### Resetting Node Data + +To completely reset and resync: + +```bash +# Stop services +docker compose down + +# Remove all volumes +rm -rf volumes/ + +# Restart (will create fresh volumes) +docker compose up -d +``` + +### Resetting Specific Services + +```bash +# Reset only L2 node data +docker compose down +rm -rf volumes/l2reth/ +docker compose up -d + +# Reset only monitoring data +docker compose down +rm -rf volumes/prometheus/ volumes/grafana/ +docker compose up -d +``` + +## Network Configuration + +### Port Usage + +The Docker Compose stack uses the following host ports: + +| Service | Port | Protocol | Purpose | +|-------------|-------|-----------|----------------------------| +| rollup-node | 8545 | HTTP | JSON-RPC API | +| rollup-node | 8546 | WebSocket | WebSocket API | +| rollup-node | 6060 | HTTP | Metrics endpoint | +| l1-devnet | 8543 | HTTP | L1 JSON-RPC (shadow-fork) | +| l1-devnet | 8544 | WebSocket | L1 WebSocket (shadow-fork) | +| prometheus | 19090 | HTTP | Prometheus UI | +| grafana | 13000 | HTTP | Grafana UI | + +## Troubleshooting + +### Rollup Node Not Syncing + +**Check L1 connectivity:** + +For shadow-fork mode, ensure l1-devnet is running: + +```bash +docker compose ps l1-devnet +``` + +For standard mode, verify L1 RPC endpoint is accessible. + +**Check logs for derivation errors:** + +```bash +docker compose logs -f rollup-node | grep -i error +``` + +**Verify beacon node connectivity:** + +```bash +# From within the container +docker compose exec rollup-node curl http://l1reth-cl.sepolia.scroll.tech:5052/eth/v1/node/health +``` + +### Shadow-Fork L1 Devnet Issues + +**Check Anvil is forking correctly:** + +```bash +docker compose logs l1-devnet +``` + +**Verify fork block number exists:** + +Ensure `FORK_BLOCK_NUMBER` is not ahead of the current L1 chain tip. + +**Test L1 devnet connectivity:** + +```bash +curl -X POST http://localhost:8543 \ + -H "Content-Type: application/json" \ + -d '{ + "jsonrpc": "2.0", + "method": "eth_blockNumber", + "params": [], + "id": 1 + }' +``` + +## More + +For general node operation and configuration, see the [Running a Node](./running-a-node.md) guide. diff --git a/docker-compose/.env b/docker-compose/.env index 7543dfca..f1eca6e3 100644 --- a/docker-compose/.env +++ b/docker-compose/.env @@ -1,4 +1,30 @@ -# .env +# .env - Docker Compose Environment Configuration + +# Network environment: dev, sepolia, or mainnet +ENV=dev + +# Shadow-fork mode: set to true to fork from L1 at a specific block SHADOW_FORK=false + +# Block number to fork from (only used when SHADOW_FORK=true) FORK_BLOCK_NUMBER=8700000 -ENV=dev + +# Provide your own L1 Ethereum RPC endpoint URL +# +# For Sepolia testnet: +# L1_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY +# +# For Mainnet: +# L1_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY +# +# Note: Not required in shadow-fork mode (uses local L1 devnet) +L1_URL= + +# Provide your own Beacon chain endpoint for blob data (EIP-4844) +# +# Note: Not required in shadow-fork mode +BEACON_URL= + +# Provide your S3 Blob storage if any. This is not required and can +# be ignored if a BEACON_URL is provided. +BLOB_S3_URL= diff --git a/docker-compose/README.md b/docker-compose/README.md index 517eaff6..6364bcaf 100644 --- a/docker-compose/README.md +++ b/docker-compose/README.md @@ -9,6 +9,8 @@ modes. - [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed - Clone this repository +- **L1 RPC endpoint** with API key (from Alchemy, Infura, QuickNode, etc.) +- **Beacon node endpoint** for blob data access --- @@ -19,13 +21,22 @@ modes. cd docker-compose ``` -2. **Start the node and monitoring stack:** +2. **Configure your RPC endpoints in the `.env` file:** + ```sh + # Edit .env and set your RPC URLs: + ENV=sepolia # or mainnet + L1_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY + BEACON_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY + ``` + Replace `YOUR_API_KEY` with your actual API key from your RPC provider. + +3. **Start the node and monitoring stack:** ```sh docker compose up -d ``` - This will launch the rollup node, Prometheus, and Grafana with default settings. + This will launch the rollup node, Prometheus, and Grafana. -3. **Access the services:** +4. **Access the services:** - Rollup Node JSON-RPC: [http://localhost:8545](http://localhost:8545) - Rollup Node WebSocket: [ws://localhost:8546](ws://localhost:8546) - Prometheus: [http://localhost:19090](http://localhost:19090) @@ -39,12 +50,15 @@ Shadow-fork mode allows you to run the node against a forked L1 chain for testin ### 1. Edit the `.env` file -The file `docker-compose/.env` contains environment variables for enabling shadow-fork mode: +The file `docker-compose/.env` contains environment variables for configuration: ``` SHADOW_FORK=true FORK_BLOCK_NUMBER=8700000 # Change to your desired fork block ENV=sepolia # Or 'mainnet' for mainnet fork + +# Note: L1_URL and BEACON_URL are not required in shadow-fork mode +# The local L1 devnet will be used automatically ``` ### 2. Launch with the shadow-fork profile @@ -83,8 +97,41 @@ rm -rf volumes --- +## Configuration Options + +### Environment Variables + +Key variables in the `.env` file: + +- `ENV`: Network to connect to (`dev`, `sepolia`, or `mainnet`) +- `SHADOW_FORK`: Enable shadow-fork mode (`true` or `false`) +- `FORK_BLOCK_NUMBER`: Block number to fork from (shadow-fork mode only) +- `L1_URL`: **Required** - Your L1 RPC endpoint URL (e.g., Alchemy, Infura, QuickNode) +- `BEACON_URL`: **Required** - Your beacon node URL for blob data + +### Configuring RPC Endpoints + +You **must** provide your own RPC endpoints to run the node: + +```env +ENV=sepolia +L1_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY +BEACON_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY +``` + +**Recommended RPC Providers:** +- [Alchemy](https://www.alchemy.com/) - Free tier available +- [Infura](https://infura.io/) - Free tier available +- [QuickNode](https://www.quicknode.com/) - High-performance nodes + +The configuration priority is: +1. User-provided URLs (via `L1_URL`/`BEACON_URL`) +2. Shadow-fork URLs (if `SHADOW_FORK=true`) - uses local L1 devnet +3. Error - Node will not start without valid configuration + ## More - See `docker-compose/docker-compose.yml` for all available services and configuration options. +- For detailed documentation, refer to the project book in `book/src/docker-operations.md`. - For advanced usage, refer to the official [Docker Compose documentation](https://docs.docker.com/compose/). diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 2dc68b85..69b989fc 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: l1-devnet: image: ghcr.io/foundry-rs/foundry:v1.2.3 @@ -19,7 +17,7 @@ services: - scroll-network rollup-node: - image: scrolltech/rollup-node:v0.0.1-rc29 + image: scrolltech/rollup-node:v0.0.1-rc67 container_name: rollup-node entrypoint: ["bash", "/launch_rollup_node.bash"] env_file: diff --git a/docker-compose/launch_l1.bash b/docker-compose/launch_l1.bash index 837f8f3b..1a573e9e 100644 --- a/docker-compose/launch_l1.bash +++ b/docker-compose/launch_l1.bash @@ -7,7 +7,7 @@ if [ "${FORK_BLOCK_NUMBER}" != "" ]; then fi if [ "${ENV:-}" = "mainnet" ]; then - 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 + exec anvil --fork-url ${L1_URL} --chain-id 1 --host 0.0.0.0 --block-time 12 $EXTRA_PARAMS elif [ "${ENV:-}" = "sepolia" ]; then - exec anvil --fork-url http://l1reth-rpc.sepolia.scroll.tech:8545 --chain-id 11155111 --host 0.0.0.0 --block-time 12 $EXTRA_PARAMS + exec anvil --fork-url ${L1_URL} --chain-id 11155111 --host 0.0.0.0 --block-time 12 $EXTRA_PARAMS fi diff --git a/docker-compose/launch_rollup_node.bash b/docker-compose/launch_rollup_node.bash index f72550d0..bc93bad4 100644 --- a/docker-compose/launch_rollup_node.bash +++ b/docker-compose/launch_rollup_node.bash @@ -14,30 +14,75 @@ if [ "${ENV:-}" = "dev" ]; then --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 \ --test \ + --consensus.algorithm noop --blob.mock \ --sequencer.enabled --sequencer.block-time 250 --sequencer.payload-building-duration 230 --txpool.pending-max-count=1000000 --builder.gaslimit=10000000000 \ --rpc.max-connections=5000 elif [ "${ENV:-}" = "sepolia" ]; then - if [ "${SHADOW_FORK}" = "true" ]; then + # Determine L1 URL + if [ -n "${L1_URL}" ]; then + # Use custom L1 URL if provided + URL_PARAMS="--l1.url ${L1_URL}" + elif [ "${SHADOW_FORK}" = "true" ]; then + # Use shadow-fork L1 devnet wait_for_l1_devnet URL_PARAMS="--l1.url http://l1-devnet:8545" else + # Use default Scroll Sepolia L1 RPC URL_PARAMS="--l1.url http://l1reth-rpc.sepolia.scroll.tech:8545" fi + + # Determine Beacon URL + if [ -n "${BEACON_URL}" ]; then + BEACON_PARAMS="--blob.beacon_node_urls ${BEACON_URL}" + else + BEACON_PARAMS="--blob.beacon_node_urls http://l1reth-cl.sepolia.scroll.tech:5052" + fi + + # Determine Blob S3 URL + if [ -n "${BLOB_S3_URL}" ]; then + BLOB_S3_PARAMS="--blob.s3_url ${BLOB_S3_URL}" + else + BLOB_S3_PARAMS="--blob.s3_url https://scroll-sepolia-blob-data.s3.us-west-2.amazonaws.com/" + fi + exec rollup-node node --chain scroll-sepolia --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 $URL_PARAMS --beacon.url http://l1reth-cl.sepolia.scroll.tech:5052 \ + --rpc.rollup-node \ + --log.stdout.format log-fmt -vvv $URL_PARAMS $BEACON_PARAMS $BLOB_S3_PARAMS \ --trusted-peers "enode://29cee709c400533ae038a875b9ca975c8abef9eade956dcf3585e940acd5c0ae916968f514bd37d1278775aad1b7db30f7032a70202a87fd7365bd8de3c9f5fc@44.242.39.33:30303,enode://ceb1636bac5cbb262e5ad5b2cd22014bdb35ffe7f58b3506970d337a63099481814a338dbcd15f2d28757151e3ecd40ba38b41350b793cd0d910ff0436654f8c@35.85.84.250:30303,enode://dd1ac5433c5c2b04ca3166f4cb726f8ff6d2da83dbc16d9b68b1ea83b7079b371eb16ef41c00441b6e85e32e33087f3b7753ea9e8b1e3f26d3e4df9208625e7f@54.148.111.168:30303" elif [ "${ENV:-}" = "mainnet" ]; then - if [ "${SHADOW_FORK}" = "true" ]; then + # Determine L1 URL + if [ -n "${L1_URL}" ]; then + # Use custom L1 URL if provided + URL_PARAMS="--l1.url ${L1_URL}" + elif [ "${SHADOW_FORK}" = "true" ]; then + # Use shadow-fork L1 devnet wait_for_l1_devnet URL_PARAMS="--l1.url http://l1-devnet:8545" else + # Use default Scroll Mainnet L1 RPC URL_PARAMS="--l1.url http://l1geth-rpc.mainnet.scroll.tech:8545/l1" fi + + # Determine Beacon URL + if [ -n "${BEACON_URL}" ]; then + BEACON_PARAMS="--blob.beacon_node_urls ${BEACON_URL}" + else + BEACON_PARAMS="--blob.beacon_node_urls http://l1reth-cl.mainnet.scroll.tech:5052" + fi + + # Determine Blob S3 URL + if [ -n "${BLOB_S3_URL}" ]; then + BLOB_S3_PARAMS="--blob.s3_url ${BLOB_S3_URL}" + else + BLOB_S3_PARAMS="--blob.s3_url https://scroll-mainnet-blob-data.s3.us-west-2.amazonaws.com/" + fi + exec rollup-node node --chain scroll-mainnet --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 $URL_PARAMS --beacon.url http://l1reth-cl.mainnet.scroll.tech:5052 \ + --rpc.rollup-node \ + --log.stdout.format log-fmt -vvv $URL_PARAMS $BEACON_PARAMS $BLOB_S3_PARAMS \ --trusted-peers "enode://c6ac91f43df3d63916ac1ae411cdd5ba249d55d48a7bec7f8cd5bb351a31aba437e5a69e8a1de74d73fdfeba8af1cfe9caf9846ecd3abf60d1ffdf4925b55b23@54.186.123.248:30303,enode://fdcc807b5d1353f3a1e98b90208ce6ef1b7d446136e51eaa8ad657b55518a2f8b37655e42375d61622e6ea18f3faf9d070c9bbdf012cf5484bcbad33b7a15fb1@44.227.91.206:30303,enode://6beb5a3efbb39be73d17630b6da48e94c0ce7ec665172111463cb470197b20c12faa1fa6f835b81c28571277d1017e65c4e426cc92a46141cf69118ecf28ac03@44.237.194.52:30303,enode://7cf893d444eb8e129dca0f6485b3df579911606e7c728be4fa55fcc5f155a37c3ce07d217ccec5447798bde465ac2bdba2cb8763d107e9f3257e787579e9f27e@52.35.203.107:30303,enode://c7b2d94e95da343db6e667a01cef90376a592f2d277fbcbf6e9c9186734ed8003d01389571bd10cdbab7a6e5adfa6f0c7b55644d0db24e0b9deb4ec80f842075@54.70.236.187:30303" fi \ No newline at end of file