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
Copy file name to clipboardExpand all lines: pages/operators/chain-operators/deploy/genesis.mdx
+1-11Lines changed: 1 addition & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,16 +75,6 @@ Once you have `genesis.json` and `rollup.json`:
75
75
2. Configure op-node with rollup.json.
76
76
3. Set up additional off-chain infrastructure as needed (block explorer, indexers, etc.). For more on architecture, see [Architecture overview](/operators/chain-operators/architecture).
77
77
78
-
### Step 3: Get data
79
-
80
-
Now that you have your `genesis.json` and `rollup.json` you can spin up a node on your network.
81
-
You can also use the following inspect subcommands to get additional data:
82
-
83
-
```bash
84
-
./bin/op-deployer inspect l1 --workdir .deployer <l2-chain-id># outputs all L1 contract addresses for an L2 chain
85
-
./bin/op-deployer inspect deploy-config --workdir .deployer <l2-chain-id># outputs the deploy config for an L2 chain
86
-
```
87
-
88
78
## Legacy method: using foundry script
89
79
90
80
The following guide shows you how to generate the L2 genesis file `genesis.json`. This is a JSON
For the full set of deployment configuration options and their meanings, you
32
28
can see the [rollup deployment configuration page](/operators/chain-operators/configuration/rollup).
33
29
34
-
## Deployment script
30
+
For a detailed explanation of the configuration options and their meanings, refer to the [rollup deployment configuration page](/operators/chain-operators/configuration/rollup).
31
+
32
+
## Using `op-deployer`
33
+
34
+
The recommended way to deploy the L1 smart contracts is with the `op-deployer` tool.
35
+
Follow the steps in this [section](/operators/chain-operators/tutorials/create-l2-rollup#using-op-deployer) to learn how it works.
36
+
37
+
38
+
## Deployment script (Legacy method)
39
+
40
+
<Callouttype="warning">
41
+
The following deployment information outlines the legacy method for deploying the OP Stack L1 contracts.
42
+
This method is not recommended and is provided only for historical context.
43
+
</Callout>
35
44
36
-
The smart contracts are deployed using [foundry](https://github.com/foundry-rs)
37
-
and you can find the script's source code in the monorepo at
45
+
The legacy method for deploying smart contracts uses [foundry](https://github.com/foundry-rs) and the deployment script located in the monorepo at
Before deploying the contracts, you can verify the state diff by using the `runWithStateDiff()` function signature in the deployment script, which produces
43
-
the outputs inside[`snapshots/state-diff/`](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock/snapshots/state-diff).
44
-
Run the deployment with state diffs by executing:
50
+
You can verify the state diff before deploying the contracts by using the `runWithStateDiff()` function in the deployment script.
51
+
This produces outputs in[`snapshots/state-diff/`](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock/snapshots/state-diff).
52
+
Run the deployment with state diffs using the following command:
Starting with permissioned fault proofs gives chain operators time to get comfortable
93
101
running the additional infrastructure requirements: [op-challenger](https://github.com/ethereum-optimism/optimism/tree/develop/op-challenger) and
94
102
[monitoring](https://github.com/ethereum-optimism/monitorism/tree/main). There are also
95
-
additional changes to the economics of operating a permissionless fault proof that chain
96
-
operators should have a firm understanding of.
103
+
additional changes to the economics of operating a permissionless fault proof that chain operators should fully understand.
Copy file name to clipboardExpand all lines: pages/operators/chain-operators/tools/op-deployer.mdx
+37-27Lines changed: 37 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,10 +28,17 @@ The base use case for `op-deployer` is deploying new OP Chains. This process is
28
28
29
29
To get started with `op-deployer`, create an intent file that defines your desired chain configuration. Use the built-in `op-deployer` utility to generate this file:
30
30
31
+
<Callouttype="info">
32
+
op-deployer uses a declarative intent file to determine how a new chain should be configured.
33
+
Then, it runs through a deployment pipeline to actually deploy the chain.
This command will create a directory called `.deployer` in your current working directory containing the intent file and an empty `state.json` file. `state.json` is populated with the results of your deployment, and never needs to be edited directly.
36
43
37
44
Your intent file will need to be modified to your parameters, but it will initially look something like this:
@@ -43,39 +50,40 @@ Your intent file will need to be modified to your parameters, but it will initia
43
50
44
51
45
52
```toml
46
-
deploymentStrategy = "live"# Deploying a chain to a live network i.e. Sepolia
47
-
l1ChainID = 11155111# The chain ID of the L1 chain you'll be deploying to
53
+
configType = "standard-overrides"
54
+
l1ChainID = 11155111# The chain ID of Sepolia (L1) you'll be deploying to.
48
55
fundDevAccounts = true# Whether or not to fund dev accounts using the test... junk mnemonic on L2.
* Replace `<rpc-url>` with your `L1_RPC_URL` and `<private key>` with your private key
112
+
103
113
This command will deploy the OP Stack to L1. It will deploy all L2s specified in the intent file. Superchain
104
114
configuration will be set to the Superchain-wide defaults - i.e., your chain will be opted into the [Superchain pause](https://specs.optimism.io/protocol/superchain-config.html#pausability)
105
115
and will use the same [protocol versions](https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/superchain-upgrades.md)
@@ -113,17 +123,17 @@ address as other chains on the Superchain.
113
123
114
124
Inspect the `state.json` file by navigating to your working directory. With the contracts deployed, generate the genesis and rollup configuration files by running the following commands:
Now that you have your `genesis.json` and `rollup.json` you can spin up a node on your network. You can also use the following inspect subcommands to get additional data:
131
+
Now that you have your `genesis.json` and `rollup.json` you can spin up a node on your network. You can also use the following inspect subcommands to get additional chain artifacts:
122
132
123
-
```
124
-
op-deployer inspect l1 --workdir .deployer <l2-chain-id> # outputs all L1 contract addresses for an L2 chain
125
-
op-deployer inspect deploy-config --workdir .deployer <l2-chain-id> # outputs the deploy config for an L2 chain
126
-
op-deployer inspect l2-semvers --workdir .deployer <l2-chain-id> # outputs the semvers for all L2 chains
133
+
```bash
134
+
./bin/op-deployer inspect l1 --workdir .deployer <l2-chain-id># outputs all L1 contract addresses for an L2 chain
135
+
./bin/op-deployer inspect deploy-config --workdir .deployer <l2-chain-id># outputs the deploy config for an L2 chain
136
+
./bin/op-deployer inspect l2-semvers --workdir .deployer <l2-chain-id># outputs the semvers for all L2 chains
The recommended flow for creating a genesis file and rollup configuration file on the OP Stack is as follows:
429
426
430
-
<Callout>
431
-
If you see a nondescript error that includes `EvmError: Revert` and `Script failed` then you likely need to change the `IMPL_SALT` environment variable.
432
-
This variable determines the addresses of various smart contracts that are deployed via [CREATE2](https://eips.ethereum.org/EIPS/eip-1014).
433
-
If the same `IMPL_SALT` is used to deploy the same contracts twice, the second deployment will fail.
434
-
**You can generate a new `IMPL_SALT` by running `direnv allow` anywhere in the Optimism Monorepo.**
427
+
1.**Deploy the L1 contracts** using [op-deployer](/operators/chain-operators/tools/op-deployer).
428
+
2.**Generate** both the L2 genesis file (`genesis.json`) and the rollup configuration file (`rollup.json`) using op-deployer's `inspect` commands.
429
+
3.**Initialize** your off-chain components (e.g., execution client, consensus client).
430
+
431
+
<Callouttype="info">
432
+
Using op-deployer for chain initialization is a requirement for all chains intending to be for chains who intend to be standard and join the superchain.
433
+
This ensures standardization and compatibility across the OP Stack ecosystem.
435
434
</Callout>
436
435
437
-
</Steps>
436
+
### Prerequisites
438
437
439
-
## Generate the L2 config files
438
+
1. You have installed the `op-deployer` binary following the instructions in [deployer docs](/operators/chain-operators/tools/op-deployer#installation).
439
+
After installation, extract the `op-deployer` into your `PATH` and `cd op-deployer`.
440
440
441
-
Now that you've set up the L1 smart contracts you can automatically generate several configuration files that are used within the Consensus Client and the Execution Client.
441
+
2. You have created and customized an intent file in a `.deployer` directory, typically by running:
1.`genesis.json` includes the genesis state of the chain for the Execution Client.
446
-
2.`rollup.json` includes configuration information for the Consensus Client.
447
-
3.`jwt.txt` is a [JSON Web Token](https://jwt.io/introduction) that allows the Consensus Client and the Execution Client to communicate securely (the same mechanism is used in Ethereum clients).
447
+
Replace `<YOUR_L1_CHAIN_ID>` and `<YOUR_L2_CHAIN_ID>` with their respective values, see a list of [`chainIds`](https://chainid.network/).
448
448
449
-
<Steps>
449
+
3. You have edited that intent file to your liking (roles, addresses, etc.).
450
+
451
+
### Step 1: Deploy the L1 contracts
450
452
451
-
{<h3>Navigate to the op-node package</h3>}
453
+
To deploy your chain to L1, run:
452
454
453
455
```bash
454
-
cd~/optimism/op-node
456
+
./bin/op-deployer apply --workdir .deployer \
457
+
--l1-rpc-url <RPC_URL_FOR_L1> \
458
+
--private-key <DEPLOYER_PRIVATE_KEY_HEX>
455
459
```
456
460
457
-
{<h3>Create genesis files</h3>}
461
+
* Replace `<RPC_URL_FOR_L1>` with the L1 RPC URL.
462
+
* Replace `<DEPLOYER_PRIVATE_KEY_HEX>` with the private key of the account used for deployment.
458
463
459
-
Now you'll generate the `genesis.json` and `rollup.json` files within the `op-node` folder:
{<h3>Copy genesis files into the op-geth directory</h3>}
479
+
* genesis.json is the file you will provide to your execution client (e.g. op-geth).
480
+
* rollup.json is the file you will provide to your consensus client (e.g. op-node).
481
481
482
-
Finally, you'll need to copy the `genesis.json` file and `jwt.txt` file into `op-geth` so you can use it to initialize and run `op-geth`:
482
+
### Step 3: Initialize your off-chain components
483
483
484
-
```bash
485
-
cp genesis.json ~/op-geth
486
-
cp jwt.txt ~/op-geth
487
-
```
484
+
Once you have `genesis.json` and `rollup.json`:
488
485
489
-
</Steps>
486
+
1. Initialize op-geth using genesis.json.
487
+
2. Configure op-node with rollup.json.
488
+
3. Set up additional off-chain infrastructure as needed (block explorer, indexers, etc.). For more on architecture, see [Architecture overview](/operators/chain-operators/architecture).
0 commit comments