You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section provides information on OP Stack genesis creation, deployment overview, and smart contract deployment. You'll find guides and overviews to help you understand and work with these topics.
description: Learn how to create a genesis file for the OP Stack.
4
+
description: Learn how to create genesis and rollup configuration files using op-deployer after L1 contract deployment.
5
5
content_type: guide
6
6
topic: genesis-creation
7
7
personas:
@@ -20,78 +20,93 @@ is_imported_content: 'false'
20
20
21
21
import { Callout } from'nextra/components'
22
22
23
-
# OP Stack genesis creation
23
+
# Overview
24
24
25
-
<Callouttype="info">
26
-
The recommended way to generate genesis and rollup configuration files is using `op-deployer`.
27
-
This ensures standardization and compatibility with the Superchain.
28
-
</Callout>
25
+
After deploying the L1 system contracts for your OP Stack chain, you need to generate two files to run nodes on the L2 network:
26
+
27
+
***Genesis file** (`genesis.json`): Initializes the execution client (`op-geth`)
28
+
***Rollup configuration file** (`rollup.json`): Configures the consensus client (`op-node`)
29
29
30
-
The `op-deployer` tool simplifies the creation of genesis and rollup configuration files (`genesis.json` and `rollup.json`).
31
-
These files are crucial for initializing the execution client (`op-geth`) and consensus client (`op-node`) for your network.
30
+
This guide shows you how to generate these files from your L1 contract deployment data using `op-deployer`.
32
31
33
-
The recommended flow for creating a genesis file and rollup configuration file on the OP Stack is as follows:
32
+
## Prerequisites
34
33
35
-
1.**Deploy the L1 contracts** using [op-deployer](/operators/chain-operators/tools/op-deployer).
36
-
2.**Generate** both the L2 genesis file (`genesis.json`) and the rollup configuration file (`rollup.json`) using op-deployer's `inspect` commands.
37
-
3.**Initialize** your off-chain components (e.g., execution client, consensus client).
34
+
Before generating genesis and rollup configuration files, ensure you have:
38
35
39
-
## Recommended method: using op-deployer
36
+
1. Deployed the L1 contracts successfully using the [`op-deployer apply`](/operators/chain-operators/tools/op-deployer#apply-deploy-your-chain) command
40
37
41
-
### Prerequisites
38
+
2. Access to your deployment workspace directory (`.deployer` if you've followed the instructions in the L1 deployment contracts guide)
42
39
43
-
1. You have installed the `op-deployer` binary following the instructions in [deployer docs](/operators/chain-operators/tools/op-deployer#installation).
44
-
After installation, extract the `op-deployer` into your `PATH` and `cd op-deployer`.
40
+
## Generating genesis and rollup files
45
41
46
-
2. You have created and customized an intent file in a `.deployer` directory, typically by running:
42
+
After your L1 contracts have been deployed, follow these steps to generate the configuration files:
Replace `<YOUR_L1_CHAIN_ID>` and `<YOUR_L2_CHAIN_ID>` with their respective values, see a list of [`chainIds`](https://chainid.network/).
46
+
The `op-deployer` tool creates a `state.json` file in your workspace directory that contains all the necessary information about your deployed contracts.
53
47
54
-
3. You have edited that intent file to your liking (roles, addresses, etc.).
48
+
Verify that this file exists in your workspace:
49
+
50
+
```bash
51
+
ls -la .deployer/state.json
52
+
```
55
53
56
-
### Step 1: Deploy the L1 contracts
54
+
### Step 2: Generate the L2 genesis file
57
55
58
-
To deploy your chain to L1, run:
56
+
Use the `inspect genesis` command to retrieve your L2 genesis file:
* genesis.json is the file you will provide to your execution client (e.g. op-geth).
82
-
* rollup.json is the file you will provide to your consensus client (e.g. op-node).
84
+
The `genesis.json` file contains the initial state of your L2 blockchain, including:
85
+
86
+
* Chain configuration parameters
87
+
* Initial account states
88
+
* Genesis block properties
89
+
90
+
The `rollup.json` file contains the rollup protocol parameters, including:
83
91
84
-
### Step 3: Initialize your off-chain components
92
+
* L1 contract addresses
93
+
* Sequencing settings
94
+
* Protocol upgrade activation times
85
95
86
-
Once you have `genesis.json` and `rollup.json`:
96
+
## Troubleshooting
87
97
88
-
1. Initialize op-geth using genesis.json.
89
-
2. Configure op-node with rollup.json.
90
-
3. Set up additional off-chain infrastructure as needed (block explorer, indexers, etc.). For more on architecture, see [Architecture overview](/operators/chain-operators/architecture).
98
+
If you encounter issues with the generated files:
99
+
100
+
*[Verify](/operators/chain-operators/tools/op-deployer#verify-verify-contract-source-code-on-block-explorers) that your L1 contract deployment was successful
101
+
* Check that you're using the correct **L2 chain ID** in the generation commands
102
+
* Ensure your `state.json` file is up-to-date with your latest deployment
103
+
104
+
<Callouttype="warning">
105
+
Never manually edit the generated genesis or rollup files unless you fully understand the implications. Incorrect configurations can lead to consensus failures or chain security issues.
106
+
</Callout>
91
107
92
108
## Next steps
93
109
94
-
* Learn how to [initialize](/operators/node-operators/configuration/base-config#initialization-via-genesis-file)
95
-
`op-geth` with your `genesis.json` file.
96
-
* Learn how to [initialize](/operators/node-operators/configuration/base-config#configuring-op-node)`op-node` with your `rollup.json` file.
97
-
* Learn more about the off chain [architecture](/operators/chain-operators/architecture).
110
+
* Learn how to [initialize](/operators/node-operators/configuration/base-config#initialization-via-genesis-file)`op-geth` with your `genesis.json` file
111
+
* Learn how to [configure](/operators/node-operators/configuration/base-config#configuring-op-node)`op-node` with your `rollup.json` file
112
+
* Learn more about the off-chain [architecture](/operators/chain-operators/architecture)
0 commit comments