Skip to content

Commit d0731c5

Browse files
authored
updated the instructions to use op-deployer
1 parent 47b847d commit d0731c5

File tree

1 file changed

+37
-13
lines changed

1 file changed

+37
-13
lines changed

pages/builders/chain-operators/deploy/genesis.mdx

+37-13
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ import { Callout } from 'nextra/components'
88

99
# OP Stack genesis creation
1010

11-
<Callout type="warning">
12-
This page has been **updated** to use <strong>op-deployer</strong> for genesis file creation. The foundry-script-based method (described below as "legacy") is no longer recommended for production.
11+
<Callout type="info">
12+
The recommended way to generate genesis and rollup configuration files is using `op-deployer`.
13+
This ensures standardization and compatibility with the Superchain.
1314
</Callout>
1415

16+
The `op-deployer` tool simplifies the creation of genesis and rollup configuration files (`genesis.json` and `rollup.json`).
17+
These files are crucial for initializing the execution client (`op-geth`) and consensus client (`op-node`) for your network.
18+
1519
The recommended flow for creating a genesis file and rollup configuration file on the OP Stack is as follows:
1620

1721
1. **Deploy the L1 contracts** using [op-deployer](/builders/chain-operators/tools/op-deployer).
@@ -22,18 +26,22 @@ The recommended flow for creating a genesis file and rollup configuration file o
2226

2327
### Prerequisites
2428

25-
1. You have installed the `op-deployer` binary following the instructions in [Deployer docs](/builders/chain-operators/tools/op-deployer).
29+
1. You have installed the `op-deployer` binary following the instructions in [deployer docs](/builders/chain-operators/tools/op-deployer#installation).
30+
After installation, extract the `op-deployer` into your `PATH` and `cd op-deployer`.
2631
2. You have created and customized an intent file in a `.deployer` directory, typically by running:
2732
```bash
28-
op-deployer init --l1-chain-id <YOUR_L1_CHAIN_ID> --l2-chain-ids <YOUR_L2_CHAIN_ID> --workdir .deployer
33+
./bin/op-deployer init --l1-chain-id <YOUR_L1_CHAIN_ID> --l2-chain-ids <YOUR_L2_CHAIN_ID> --workdir .deployer
2934
```
35+
36+
Replace `<YOUR_L1_CHAIN_ID>` and `<YOUR_L2_CHAIN_ID>` with their respective values, see a list of [`chainIds`](https://chainid.network/).
37+
3038
3. You have edited that intent file to your liking (roles, addresses, etc.).
3139

3240
### Step 1: Deploy the L1 contracts
3341

3442
To deploy your chain to L1, run:
3543
```bash
36-
op-deployer apply --workdir .deployer \
44+
./bin/op-deployer apply --workdir .deployer \
3745
--l1-rpc-url <RPC_URL_FOR_L1> \
3846
--private-key <DEPLOYER_PRIVATE_KEY_HEX>
3947
```
@@ -48,20 +56,30 @@ This command:
4856

4957
After your L1 contracts have been deployed, generate the L2 genesis and rollup configuration files by inspecting the deployer’s `state.json.`
5058
```bash
51-
op-deployer inspect genesis --workdir .deployer <L2_CHAIN_ID> > .deployer/genesis.json
52-
op-deployer inspect rollup --workdir .deployer <L2_CHAIN_ID> > .deployer/rollup.json
59+
./bin/op-deployer inspect genesis --workdir .deployer <L2_CHAIN_ID> > .deployer/genesis.json
60+
./bin/op-deployer inspect rollup --workdir .deployer <L2_CHAIN_ID> > .deployer/rollup.json
5361
```
5462

5563
* genesis.json is the file you will provide to your execution client (e.g. op-geth).
5664
* rollup.json is the file you will provide to your consensus client (e.g. op-node).
5765

5866
### Step 3: Initialize your off-chain components
5967

60-
Once you have genesis.json and rollup.json:
68+
Once you have `genesis.json` and `rollup.json`:
6169

6270
1. Initialize op-geth using genesis.json.
63-
1. Configure op-node with rollup.json.
64-
1. Set up additional off-chain infrastructure as needed (block explorer, indexers, etc.). For more on architecture, see [Architecture overview](/builders/chain-operators/architecture).
71+
2. Configure op-node with rollup.json.
72+
3. Set up additional off-chain infrastructure as needed (block explorer, indexers, etc.). For more on architecture, see [Architecture overview](/builders/chain-operators/architecture).
73+
74+
4. ### Step 3: Get data
75+
76+
Now that you have your `genesis.json` and `rollup.json` you can spin up a node on your network.
77+
You can also use the following inspect subcommands to get additional data:
78+
79+
```bash
80+
./bin/op-deployer inspect l1 --workdir .deployer <l2-chain-id> # outputs all L1 contract addresses for an L2 chain
81+
./bin/op-deployer inspect deploy-config --workdir .deployer <l2-chain-id> # outputs the deploy config for an L2 chain
82+
```
6583

6684
## Legacy method: using foundry script
6785

@@ -70,10 +88,16 @@ file that represents the L2 genesis. You will provide this file to the
7088
execution client (op-geth) to initialize your network. There is also the rollup configuration file, `rollup.json`, which will be
7189
provided to the consensus client (op-node).
7290

73-
## Solidity script
91+
<Callout type="warning">
92+
The following genesis creation information is the legacy method for creating OP Stack configuration files.
93+
This method is not recommended. It's preserved here for historical context.
94+
</Callout>
95+
96+
97+
## Solidity script (Legacy)
7498

75-
At the time of this writing, the preferred method for genesis generation is to use the foundry script
76-
located in the monorepo to generate an "L2 state dump" and then pass this into the op-node genesis subcommand.
99+
You can also use the foundry script
100+
located in the monorepo to generate an "L2 state dump" and then pass this into the op-node genesis subcommand.
77101
The foundry script can be found at
78102
[packages/contracts-bedrock/scripts/L2Genesis.s.sol](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/scripts/L2Genesis.s.sol).
79103

0 commit comments

Comments
 (0)