From 5d801d48a3583828174594c5b0848c366c87dff3 Mon Sep 17 00:00:00 2001 From: George Knee Date: Tue, 16 Jul 2024 11:24:04 +0100 Subject: [PATCH 1/2] Update genesis.mdx --- .../chain-operators/deploy/genesis.mdx | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/pages/builders/chain-operators/deploy/genesis.mdx b/pages/builders/chain-operators/deploy/genesis.mdx index 221620cf8..72d54f871 100644 --- a/pages/builders/chain-operators/deploy/genesis.mdx +++ b/pages/builders/chain-operators/deploy/genesis.mdx @@ -8,13 +8,16 @@ import { Callout } from 'nextra/components' # OP Stack Genesis Creation -The following guide shows you how to generate the L2 allocs. This is a JSON -file that represents the L2 genesis state. You will provide this file to the -execution client (op-geth) to initialize your network. +The following guide shows you how to generate the L2 genesis file `genesis.json`. This is a JSON +file that represents the L2 genesis. You will provide this file to the +execution client (op-geth) to initialize your network. There is also a `rollup.json` which will be +provided to the consensus client (op-node). ## Solidity Script -At the time of this writing, the preferred method for genesis generation is to use the foundry script located in the monorepo. It can be found at +At the time of this writing, the preferred method for genesis generation is to use the foundry script +located in the monorepo to generate an "L2 state dump" and then pass this into the op-node genesis subcommand. +The foundry script can be found at [packages/contracts-bedrock/scripts/L2Genesis.s.sol](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/scripts/L2Genesis.s.sol). ### Configuration @@ -27,7 +30,7 @@ environment variable `FORK` either to the lower-case fork name (currently `delta`, `ecotone`, or `fjord`) or to `latest`, which will select the latest fork available (currently `fjord`). -By default, the script will dump the L2 genesis allocs of the detected or +By default, the script will dump the L2 genesis allocs (aka "state dump") of the detected or selected fork only, to the file at `STATE_DUMP_PATH`. The optional environment variable `OUTPUT_MODE` allows you to modify this behavior by setting it to one of the following values: @@ -50,7 +53,7 @@ the following values: written to on disk. ```bash -CONTRACT_ADDRESSES_PATH=deployments/artifact.json \ +CONTRACT_ADDRESSES_PATH= \ DEPLOY_CONFIG_PATH= \ STATE_DUMP_PATH= \ forge script scripts/L2Genesis.s.sol:L2Genesis \ @@ -59,14 +62,17 @@ STATE_DUMP_PATH= \ ## Subcommand (op-node genesis l2) -Historically, the genesis file creation was handled by the `genesis l2` +The genesis file creation is handled by the `genesis l2` subcommand, provided by the `op-node`. The following is an example of its usage -from [v1.7.6](https://github.com/ethereum-optimism/optimism/releases/tag/v1.7.6). +from [v1.7.6](https://github.com/ethereum-optimism/optimism/releases/tag/v1.7.6) -- +note that you need to pass the path to the l2 genesis state dump file output by +the foundry script above: ```bash go run cmd/main.go genesis l2 \ --deploy-config= \ - --l1-deployments value= \ + --l1-deployments= \ + --l2-allocs= \ --outfile.l2= \ --outfile.rollup= \ --l1-rpc=> @@ -80,5 +86,6 @@ with `--l1-rpc`. ## Next Steps * Learn how to [initialize](/builders/node-operators/configuration/base-config#initialization-via-genesis-file) - `op-geth` with your genesis file + `op-geth` with your `genesis.json` file. +* Learn how to [initialize](https://docs.optimism.io/builders/node-operators/configuration/base-config#configuring-op-node) `op-node` with your `rollup.json` file. * Learn more about the off chain [architecture](/builders/chain-operators/architecture). From 30b03878f6ae267743abcbaeca3b3457f3e22cc3 Mon Sep 17 00:00:00 2001 From: George Knee Date: Tue, 16 Jul 2024 15:19:22 +0100 Subject: [PATCH 2/2] Update pages/builders/chain-operators/deploy/genesis.mdx Co-authored-by: soyboy <85043086+sbvegan@users.noreply.github.com> --- pages/builders/chain-operators/deploy/genesis.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/builders/chain-operators/deploy/genesis.mdx b/pages/builders/chain-operators/deploy/genesis.mdx index 72d54f871..87e1ca785 100644 --- a/pages/builders/chain-operators/deploy/genesis.mdx +++ b/pages/builders/chain-operators/deploy/genesis.mdx @@ -10,7 +10,7 @@ import { Callout } from 'nextra/components' The following guide shows you how to generate the L2 genesis file `genesis.json`. This is a JSON file that represents the L2 genesis. You will provide this file to the -execution client (op-geth) to initialize your network. There is also a `rollup.json` which will be +execution client (op-geth) to initialize your network. There is also the rollup configuration file, `rollup.json`, which will be provided to the consensus client (op-node). ## Solidity Script