Skip to content
Merged
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
86 changes: 19 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ This repository is a modular Rust workspace for the Scroll rollup node. It is de

```
.
├── bin/
│ └── rollup/ # Main binary crate (the node)
│ ├── src/
│ └── assets/
├── book/ # mdBook documentation (published to GitHub Pages)
├── crates/ # Internal library crates
│ ├── node/ # Main binary crate (the node)
│ ├── codec/
│ ├── database/
│ │ ├── db/
Expand All @@ -27,20 +25,21 @@ This repository is a modular Rust workspace for the Scroll rollup node. It is de
│ ├── chain-orchestrator/
│ ├── l1/
│ ├── network/
│ ├── node/
│ ├── primitives/
│ ├── providers/
│ ├── scroll-wire/
│ ├── signer/
│ ├── sequencer/
│ └── watcher/
├── sequencer-migration/ # Migration tooling from l2geth to l2reth
├── tests/ # Integration tests
├── Cargo.toml # Workspace manifest
└── ...
```

## Crate Descriptions

- **bin/rollup/**: The main binary crate. This is the entry point for running the rollup node.
- **crates/node/**: The main binary crate. This is the entry point for running the rollup node.
- **crates/codec/**: Implements encoding/decoding logic for rollup data and payloads.
- **crates/database/db/**: Database abstraction and storage logic for batches, blocks, and messages.
- **crates/database/migration/**: Database schema migrations using SeaORM.
Expand All @@ -56,6 +55,9 @@ This repository is a modular Rust workspace for the Scroll rollup node. It is de
- **crates/scroll-wire/**: Wire protocol definitions for Scroll-specific networking.
- **crates/sequencer/**: Sequencer logic for ordering and batching transactions.
- **crates/watcher/**: Monitors L1 chain state and handles reorgs and notifications.
- **book/**: mdBook documentation published to [https://scroll-tech.github.io/rollup-node/](https://scroll-tech.github.io/rollup-node/)
- **tests/**: Integration tests for the rollup node, including E2E and sequencer migration tests
- **sequencer-migration/**: Scripts and tooling for migrating from l2geth to rollup-node (l2reth)

## Building the Project

Expand All @@ -70,19 +72,20 @@ cargo build --bin rollup-node
Or, from the binary crate directory:

```sh
cd bin/rollup
cd crates/node
cargo build
```

## Running the Node

After building, run the node with:
For comprehensive instructions on running a node, including:
- Hardware requirements
- Configuration options
- Example configurations for mainnet and sepolia
- Logging and debugging
- Troubleshooting

```sh
cargo run --workspace --bin rollup-node -- [ARGS]
```

Replace `[ARGS]` with any runtime arguments you require.
Please refer to the official documentation: **[https://scroll-tech.github.io/rollup-node/](https://scroll-tech.github.io/rollup-node/)**

## Running Tests

Expand Down Expand Up @@ -116,61 +119,10 @@ cargo build --release --bin rollup-node

The release binary will be located at `target/release/rollup-node`.

## Running a Sequencer Node

To run a sequencer node you should build the binary in release mode using the instructions defined above.

Then, you can run the sequencer node with the following command:

### Using Private Key File
```sh
./target/release/rollup-node node --chain dev -d --sequencer.enabled --signer.key-file /path/to/your/private.key --http --http.api admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev
```

**Note**: The private key file should contain a hex-encoded private key (`64` characters, optionally prefixed with `0x`).

### Using AWS KMS
```sh
./target/release/rollup-node node --chain dev -d --sequencer.enabled --signer.aws-kms-key-id arn:aws:kms:REGION:ACCOUNT:key/KEY-ID --http --http.api admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev
```

### Signer Configuration Notes
## Documentation

When running a sequencer, a signer is required unless the `--test` flag is specified. The two signing methods are mutually exclusive - use either `--signer.key-file` or `--signer.aws-kms-key-id`, but not both.

**Private Key File**: Keep your private key file secure and never commit it to version control.

**AWS KMS**: Requires KMS permissions `kms:GetPublicKey` and `kms:Sign` for the specified key.

### General Information

The above commands will start a dev node in sequencer mode with all rpc apis enabled. You can adjust the `--http.api` flag to include or exclude specific APIs as needed.

The chain will be configured with a genesis that funds 20 addresses derived from the mnemonic:
```
test test test test test test test test test test test junk
```

### Configuration Options

A list of sequencer specific configuration options can be seen below:

```sh
--scroll-sequencer-enabled
Enable the scroll block sequencer
--scroll-block-time <SCROLL_BLOCK_TIME>
The block time for the sequencer [default: 2000]
--payload-building-duration <PAYLOAD_BUILDING_DURATION>
The payload building duration for the sequencer (milliseconds) [default: 500]
--max-l1-messages-per-block <MAX_L1_MESSAGES_PER_BLOCK>
The max L1 messages per block for the sequencer [default: 4]
--fee-recipient <FEE_RECIPIENT>
The fee recipient for the sequencer [default: 0x5300000000000000000000000000000000000005]
--signer.key-file <FILE_PATH>
Path to the hex-encoded private key file for the signer (optional 0x prefix). Mutually exclusive with AWS KMS key ID
--signer.aws-kms-key-id <KEY_ID>
AWS KMS Key ID or ARN for signing transactions. Mutually exclusive with key file
```
- **[Official Documentation Book](https://scroll-tech.github.io/rollup-node/)** - Comprehensive guide for running follower and sequencer nodes
- **[Sequencer Migration Guide](./sequencer-migration/README.md)** - Documentation for migrating from l2geth to rollup-node

## Contributing

Expand Down
1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

- [Introduction](./chapter_1.md)
- [Running a Node](./running-a-node.md)
- [Running a Sequencer](./running-a-sequencer.md)
- [Running with Docker Compose](./docker-operations.md)
2 changes: 1 addition & 1 deletion book/src/docker-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ your URLs and API keys are correct.

### Rollup Node Service

**Image**: `scrolltech/rollup-node:v0.0.1-rc67`
**Image**: `scrolltech/rollup-node:v1.0.5`

**Port Mappings**:

Expand Down
12 changes: 6 additions & 6 deletions book/src/running-a-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ Replace:
#### L1 Provider Configuration

- `--l1.url <URL>`: L1 Ethereum RPC endpoint URL (required for follower nodes)
- `--l1.cups <NUMBER>`: Compute units per second for rate limiting (default: 1000)
- `--l1.cups <NUMBER>`: Compute units per second for rate limiting (default: 10000)
- `--l1.max-retries <NUMBER>`: Maximum retry attempts for L1 requests (default: 10)
- `--l1.initial-backoff <MS>`: Initial backoff duration for retries in milliseconds (default: 100)
- `--l1.query-range <BLOCKS>`: Block range for querying L1 logs (default: 2000)
- `--l1.query-range <BLOCKS>`: Block range for querying L1 logs (default: 500)

#### Blob Provider Configuration

Expand Down Expand Up @@ -112,8 +112,8 @@ These can be used as reliable blob sources without requiring your own beacon nod

#### Chain Orchestrator Configuration

- `--chain.optimistic-sync-trigger <BLOCKS>`: Block gap that triggers optimistic sync (default: 100)
- `--chain.chain-buffer-size <SIZE>`: In-memory chain buffer size (default: 100)
- `--chain.optimistic-sync-trigger <BLOCKS>`: Block gap that triggers optimistic sync (default: 1000)
- `--chain.chain-buffer-size <SIZE>`: In-memory chain buffer size (default: 2000)

#### Engine Configuration

Expand All @@ -125,7 +125,7 @@ These can be used as reliable blob sources without requiring your own beacon nod
- `--http.addr <ADDRESS>`: HTTP server listening address (default: 127.0.0.1)
- `--http.port <PORT>`: HTTP server port (default: 8545)
- `--http.api <APIS>`: Enabled RPC API namespaces (comma-separated)
- Available: `admin`, `debug`, `eth`, `net`, `trace`, `txpool`, `web3`, `rpc`, `reth`, `ots`
- Available: `admin`, `debug`, `eth`, `net`, `trace`, `txpool`, `web3`, `rpc`, `reth`, `ots`, `flashbots`, `miner`, `mev`
- `--http.corsdomain <ORIGINS>`: CORS allowed origins (comma-separated)

#### Rollup Node RPC
Expand Down Expand Up @@ -247,7 +247,7 @@ Available log levels (from least to most verbose):
```bash
RUST_LOG=info,scroll=debug,rollup=debug,sqlx=off \
./target/release/rollup-node node \
--chain scroll \
--chain scroll-mainnet \
--datadir /var/lib/scroll-node \
--l1.url https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY \
--blob.s3_url https://scroll-mainnet-blob-data.s3.us-west-2.amazonaws.com/ \
Expand Down
Loading
Loading