|
| 1 | +# Rollkit EVM Based Sequencer Setup Guide |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +This guide covers how to set up and run the Based Sequencer implementation of Rollkit EVM rollups. This implementation provides a DA-based approach to transaction sequencing while using EVM as the execution layer. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +Before starting, ensure you have: |
| 10 | + |
| 11 | +- Go 1.20 or later |
| 12 | +- Docker and Docker Compose |
| 13 | +- Access to the go-execution-evm repository (op-geth branch) |
| 14 | +- Git |
| 15 | + |
| 16 | +## Setting Up the Environment |
| 17 | + |
| 18 | +### 1. Clone the Rollkit Repository |
| 19 | + |
| 20 | +```bash |
| 21 | +git clone https://github.com/rollkit/rollkit.git |
| 22 | +cd rollkit |
| 23 | +``` |
| 24 | + |
| 25 | +### 2. Build the Rollkit EVM Based Sequencer Implementation |
| 26 | + |
| 27 | +```bash |
| 28 | +make build-evm-based |
| 29 | +make build-da |
| 30 | +``` |
| 31 | + |
| 32 | +This will create the following binaries in the `build` directory: |
| 33 | + |
| 34 | +- `evm-based` - Based sequencer implementation |
| 35 | +- `local-da` - Local data availability node for testing |
| 36 | + |
| 37 | +## Setting Up the Data Availability (DA) Layer |
| 38 | + |
| 39 | +### Start the Local DA Node |
| 40 | + |
| 41 | +```bash |
| 42 | +cd build |
| 43 | +./local-da start |
| 44 | +``` |
| 45 | + |
| 46 | +This will start a local DA node on the default port (26658). |
| 47 | + |
| 48 | +## Setting Up the EVM Layer |
| 49 | + |
| 50 | +### 1. Clone the go-execution-evm Repository |
| 51 | + |
| 52 | +```bash |
| 53 | +git clone https://github.com/rollkit/go-execution-evm.git |
| 54 | +cd go-execution-evm |
| 55 | +git checkout op-geth |
| 56 | +``` |
| 57 | + |
| 58 | +### 2. Start the EVM Layer Using Docker Compose |
| 59 | + |
| 60 | +```bash |
| 61 | +docker compose up -d |
| 62 | +``` |
| 63 | + |
| 64 | +This will start Reth (Rust Ethereum client) with the appropriate configuration for Rollkit. |
| 65 | + |
| 66 | +### 3. Note the JWT Secret Path |
| 67 | + |
| 68 | +The JWT secret is typically located at `go-execution-evm/docker/jwttoken/jwt.hex`. You'll need this path for the sequencer configuration. |
| 69 | + |
| 70 | +## Running the Based Sequencer Implementation |
| 71 | + |
| 72 | +### 1. Initialize the Sequencer |
| 73 | + |
| 74 | +```bash |
| 75 | +cd build |
| 76 | +./evm-based init --rollkit.node.aggregator=true --rollkit.signer.passphrase secret |
| 77 | +``` |
| 78 | + |
| 79 | +### 2. Start the Sequencer |
| 80 | + |
| 81 | +```bash |
| 82 | +./evm-based start \ |
| 83 | + --evm.jwt-secret $(cat /path/to/go-execution-evm/docker/jwttoken/jwt.hex) \ |
| 84 | + --evm.genesis-hash 0x0a962a0d163416829894c89cb604ae422323bcdf02d7ea08b94d68d3e026a380 \ |
| 85 | + --rollkit.node.block_time 1s \ |
| 86 | + --rollkit.node.aggregator=true \ |
| 87 | + --rollkit.signer.passphrase secret \ |
| 88 | + --based.url http://localhost:26658 \ |
| 89 | + --based.namespace 0102030405060708090a \ |
| 90 | + --based.start-height 0 \ |
| 91 | + --based.max-height-drift 1 \ |
| 92 | + --based.gas-multiplier 1.0 \ |
| 93 | + --based.gas-price 1.0 |
| 94 | +``` |
| 95 | + |
| 96 | +Replace `/path/to/` with the actual path to your go-execution-evm repository. |
| 97 | + |
| 98 | +## Setting Up a Full Node |
| 99 | + |
| 100 | +To run a full node alongside your sequencer, follow these steps: |
| 101 | + |
| 102 | +### 1. Initialize a New Node Directory |
| 103 | + |
| 104 | +```bash |
| 105 | +./evm-based init --home ~/.rollkit/evm-based-fullnode |
| 106 | +``` |
| 107 | + |
| 108 | +### 2. Copy the Genesis File |
| 109 | + |
| 110 | +Copy the genesis file from the sequencer node to the full node: |
| 111 | + |
| 112 | +```bash |
| 113 | +cp ~/.rollkit/evm-based/config/genesis.json ~/.rollkit/evm-based-fullnode/config/ |
| 114 | +``` |
| 115 | + |
| 116 | +### 3. Get the Sequencer's P2P Address |
| 117 | + |
| 118 | +Find the sequencer's P2P address in its logs. It will look similar to: |
| 119 | + |
| 120 | +```bash |
| 121 | +INF listening on address=/ip4/127.0.0.1/tcp/26659/p2p/12D3KooWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| 122 | +``` |
| 123 | + |
| 124 | +### 4. Start the Full Node |
| 125 | + |
| 126 | +```bash |
| 127 | +./evm-based start \ |
| 128 | + --home ~/.rollkit/evm-based-fullnode \ |
| 129 | + --evm.jwt-secret $(cat /path/to/go-execution-evm/docker/jwttoken/jwt.hex) \ |
| 130 | + --evm.genesis-hash 0x0a962a0d163416829894c89cb604ae422323bcdf02d7ea08b94d68d3e026a380 \ |
| 131 | + --rollkit.node.block_time 1s \ |
| 132 | + --rollkit.node.aggregator=false \ |
| 133 | + --rollkit.p2p.peers <SEQUENCER_P2P_ID>@127.0.0.1:26659 \ |
| 134 | + --based.url http://localhost:26658 \ |
| 135 | + --based.namespace 0102030405060708090a |
| 136 | +``` |
| 137 | + |
| 138 | +Replace `<SEQUENCER_P2P_ID>` with the actual P2P ID from your sequencer's logs. |
| 139 | + |
| 140 | +## Verifying Node Operation |
| 141 | + |
| 142 | +After starting your nodes, you should see logs indicating successful block processing: |
| 143 | + |
| 144 | +```bash |
| 145 | +INF block marked as DA included blockHash=XXXX blockHeight=XX module=BlockManager |
| 146 | +``` |
| 147 | + |
| 148 | +## Configuration Reference |
| 149 | + |
| 150 | +### Common Flags |
| 151 | + |
| 152 | +| Flag | Description | |
| 153 | +|------|-------------| |
| 154 | +| `--rollkit.node.aggregator` | Set to true for sequencer mode, false for full node | |
| 155 | +| `--rollkit.signer.passphrase` | Passphrase for the signer | |
| 156 | +| `--rollkit.node.block_time` | Block time for the Rollkit node | |
| 157 | + |
| 158 | +### EVM Flags |
| 159 | + |
| 160 | +| Flag | Description | |
| 161 | +|------|-------------| |
| 162 | +| `--evm.eth-url` | Ethereum JSON-RPC URL (default `http://localhost:8545`) | |
| 163 | +| `--evm.engine-url` | Engine API URL (default `http://localhost:8551`) | |
| 164 | +| `--evm.jwt-secret` | JWT secret file path for the Engine API | |
| 165 | +| `--evm.genesis-hash` | Genesis block hash of the chain | |
| 166 | +| `--evm.fee-recipient` | Address to receive priority fees | |
| 167 | + |
| 168 | +### Based Sequencer Flags |
| 169 | + |
| 170 | +| Flag | Description | |
| 171 | +|------|-------------| |
| 172 | +| `--based.url` | URL for DA endpoint (default `http://localhost:26658`) | |
| 173 | +| `--based.auth` | Auth token for based DA layer | |
| 174 | +| `--based.namespace` | Hex-encoded namespace ID for submitting rollup transactions | |
| 175 | +| `--based.start-height` | Starting DA height for fetching transactions (default `0`) | |
| 176 | +| `--based.max-height-drift` | Max number of DA heights to look ahead during batching (default `1`) | |
| 177 | +| `--based.gas-multiplier` | Gas multiplier to apply on DA submission (default `1.0`) | |
| 178 | +| `--based.gas-price` | Base gas price to use during DA submission (default `1.0`) | |
| 179 | + |
| 180 | +## Conclusion |
| 181 | + |
| 182 | +You've now set up and configured the Based Sequencer implementation of Rollkit EVM rollups. This implementation provides a DA-based approach to transaction sequencing while using EVM as the execution layer. |
0 commit comments