Skip to content
Closed

Fix CI #1316

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions components/AskAIButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { RiSparkling2Fill } from '@remixicon/react';
import { useFeature } from '@growthbook/growthbook-react';

const AskAIButton = () => {
const enableDocsAIWidget = useFeature('enable_docs_ai_widget').on;
const enableDocsAIWidget = true;

if (!enableDocsAIWidget) {
return null;
Expand Down
17 changes: 0 additions & 17 deletions lib/growthbook.ts

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@eth-optimism/contracts-ts": "^0.17.0",
"@eth-optimism/tokenlist": "^9.0.9",
"@feelback/react": "^0.3.4",
"@growthbook/growthbook-react": "^1.3.1",
"@headlessui/react": "^2.1.8",
"@remixicon/react": "^4.6.0",
"algoliasearch": "^4.23.3",
Expand Down
27 changes: 12 additions & 15 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as gtag from '../utils/gtag';
import * as aa from 'search-insights';
import AlgoliaContext from '@/utils/contexts/AlgoliaContext';
import ScrollDispatcher from '@/components/ScrollDispatcher';
import { CustomGrowthBookProvider } from '../providers/GrowthbookProvider';

export default function App({ Component, pageProps }) {
const [queryID, setQueryID] = useState(null);
Expand All @@ -29,19 +28,17 @@ export default function App({ Component, pageProps }) {
});

return (
<CustomGrowthBookProvider>
<AlgoliaContext.Provider
value={{
queryID,
setQueryID,
objectID,
setObjectID
}}
>
<ScrollDispatcher>
<Component {...pageProps} />
</ScrollDispatcher>
</AlgoliaContext.Provider>
</CustomGrowthBookProvider>
<AlgoliaContext.Provider
value={{
queryID,
setQueryID,
objectID,
setObjectID
}}
>
<ScrollDispatcher>
<Component {...pageProps} />
</ScrollDispatcher>
</AlgoliaContext.Provider>
);
}
90 changes: 40 additions & 50 deletions pages/builders/chain-operators/deploy/genesis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,37 @@ lang: en-US
description: Learn how to create a genesis file for the OP Stack.
---

import { Callout } from 'nextra/components'
import { Callout } from 'nextra/components';

# OP Stack genesis creation

<Callout type="info">
The recommended way to generate genesis and rollup configuration files is using `op-deployer`.
This ensures standardization and compatibility with the Superchain.
</Callout>
<Callout type='info'>The recommended way to generate genesis and rollup configuration files is using `op-deployer`. This ensures standardization and compatibility with the Superchain.</Callout>

The `op-deployer` tool simplifies the creation of genesis and rollup configuration files (`genesis.json` and `rollup.json`).
These files are crucial for initializing the execution client (`op-geth`) and consensus client (`op-node`) for your network.

The recommended flow for creating a genesis file and rollup configuration file on the OP Stack is as follows:

1. **Deploy the L1 contracts** using [op-deployer](/builders/chain-operators/tools/op-deployer).
2. **Generate** both the L2 genesis file (`genesis.json`) and the rollup configuration file (`rollup.json`) using op-deployer's `inspect` commands.
3. **Initialize** your off-chain components (e.g., execution client, consensus client).
1. **Deploy the L1 contracts** using [op-deployer](/builders/chain-operators/tools/op-deployer).
2. **Generate** both the L2 genesis file (`genesis.json`) and the rollup configuration file (`rollup.json`) using op-deployer's "inspect" commands.
3. **Initialize** your off-chain components (e.g., execution client, consensus client).

## Recommended method: using op-deployer

### Prerequisites

1. You have installed the `op-deployer` binary following the instructions in [deployer docs](/builders/chain-operators/tools/op-deployer#installation).
After installation, extract the `op-deployer` into your `PATH` and `cd op-deployer`.
1. You have installed the `op-deployer` binary following the instructions in [deployer docs](/builders/chain-operators/tools/op-deployer#installation).
After installation, extract the `op-deployer` into your `PATH` and `cd op-deployer`.

2. You have created and customized an intent file in a `.deployer` directory, typically by running:
2. You have created and customized an intent file in a `.deployer` directory, typically by running:

```bash
./bin/op-deployer init --l1-chain-id <YOUR_L1_CHAIN_ID> --l2-chain-ids <YOUR_L2_CHAIN_ID> --workdir .deployer
```
```bash
./bin/op-deployer init --l1-chain-id <YOUR_L1_CHAIN_ID> --l2-chain-ids <YOUR_L2_CHAIN_ID> --workdir .deployer
```

Replace `<YOUR_L1_CHAIN_ID>` and `<YOUR_L2_CHAIN_ID>` with their respective values, see a list of [`chainIds`](https://chainid.network/).
Replace `<YOUR_L1_CHAIN_ID>` and `<YOUR_L2_CHAIN_ID>` with their respective values, see a list of [`chainIds`](https://chainid.network/).

3. You have edited that intent file to your liking (roles, addresses, etc.).
3. You have edited that intent file to your liking (roles, addresses, etc.).

### Step 1: Deploy the L1 contracts

Expand All @@ -51,9 +48,9 @@ To deploy your chain to L1, run:

This command:

* Reads your intent file in `.deployer/.`
* Deploys the OP Stack contracts to the specified L1.
* Updates a local `state.json` file with the results of the deployment.
- Reads your intent file in `.deployer/.`
- Deploys the OP Stack contracts to the specified L1.
- Updates a local `state.json` file with the results of the deployment.

### Step 2: Generate your L2 genesis file and rollup file

Expand All @@ -64,16 +61,16 @@ After your L1 contracts have been deployed, generate the L2 genesis and rollup c
./bin/op-deployer inspect rollup --workdir .deployer <L2_CHAIN_ID> > .deployer/rollup.json
```

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

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

Once you have `genesis.json` and `rollup.json`:

1. Initialize op-geth using genesis.json.
2. Configure op-node with rollup.json.
3. Set up additional off-chain infrastructure as needed (block explorer, indexers, etc.). For more on architecture, see [Architecture overview](/builders/chain-operators/architecture).
1. Initialize op-geth using genesis.json.
2. Configure op-node with rollup.json.
3. Set up additional off-chain infrastructure as needed (block explorer, indexers, etc.). For more on architecture, see [Architecture overview](/builders/chain-operators/architecture).

### Step 3: Get data

Expand All @@ -83,7 +80,6 @@ You can also use the following inspect subcommands to get additional data:
````bash
./bin/op-deployer inspect l1 --workdir .deployer <l2-chain-id> # outputs all L1 contract addresses for an L2 chain
./bin/op-deployer inspect deploy-config --workdir .deployer <l2-chain-id> # outputs the deploy config for an L2 chain
```

## Legacy method: using foundry script

Expand All @@ -92,11 +88,7 @@ file that represents the L2 genesis. You will provide this file to the
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).

<Callout type="warning">
The following genesis creation information is the legacy method for creating OP Stack configuration files.
This method is not recommended. It's preserved here for historical context.
</Callout>

<Callout type='warning'>The following genesis creation information is the legacy method for creating OP Stack configuration files. This method is not recommended. It's preserved here for historical context.</Callout>

## Solidity script (Legacy)

Expand All @@ -105,9 +97,7 @@ located in the monorepo to generate an "L2 state dump" and then pass this into t
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).

<Callout type="info">
When generating the genesis file, please use the same `op-contracts/vX.Y.Z` release commit used for L1 contract deployments.
</Callout>
<Callout type='info'>When generating the genesis file, please use the same `op-contracts/vX.Y.Z` release commit used for L1 contract deployments.</Callout>

### Configuration

Expand All @@ -124,22 +114,22 @@ 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:

* `latest` (default) - only dump the selected fork's allocs.
* `all` - also dump all intermediary fork's allocs. This only works if
`STATE_DUMP_PATH` is not set. In this case, all allocs will be written to files
`/state-dump-<fork>.json`. Another path cannot currently be specified for this
use case.
* `none` - won't dump any allocs. Only makes sense for internal test usage.
- `latest` (default) - only dump the selected fork's allocs.
- `all` - also dump all intermediary fork's allocs. This only works if
`STATE_DUMP_PATH` is not set. In this case, all allocs will be written to files
`/state-dump-<fork>.json`. Another path cannot currently be specified for this
use case.
- `none` - won't dump any allocs. Only makes sense for internal test usage.

### Creation

* `CONTRACT_ADDRESSES_PATH` represents the deployment artifact that was
generated during a contract deployment.
* `DEPLOY_CONFIG_PATH` represents a path on the filesystem that points to a
deployment config. The same deploy config JSON file should be used for L1 contracts
deployment as when generating the L2 genesis allocs.
* `STATE_DUMP_PATH` represents the filepath at which the allocs will be
written to on disk.
- `CONTRACT_ADDRESSES_PATH` represents the deployment artifact that was
generated during a contract deployment.
- `DEPLOY_CONFIG_PATH` represents a path on the filesystem that points to a
deployment config. The same deploy config JSON file should be used for L1 contracts
deployment as when generating the L2 genesis allocs.
- `STATE_DUMP_PATH` represents the filepath at which the allocs will be
written to on disk.

```bash
CONTRACT_ADDRESSES_PATH=<CONTRACT_ADDRESSES_PATH> \
Expand Down Expand Up @@ -169,7 +159,7 @@ go run cmd/main.go genesis l2 \

## Next steps

* Learn how to [initialize](/builders/node-operators/configuration/base-config#initialization-via-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).
- Learn how to [initialize](/builders/node-operators/configuration/base-config#initialization-via-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).
28 changes: 0 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions providers/GrowthbookProvider.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { FeelbackYesNo, PRESET_LIKE_DISLIKE } from '@feelback/react';
import '@feelback/react/styles/feelback.css';
import { Search } from './components/Search';
import { AskAIButton } from './components/AskAIButton';
import { useFeature } from '@growthbook/growthbook-react';

const config: DocsThemeConfig = {
logo: (
Expand Down Expand Up @@ -117,7 +116,7 @@ const config: DocsThemeConfig = {
const { asPath, defaultLocale, locale } = useRouter();
const { frontMatter } = useConfig();
const url = 'https://docs.optimism.io' + (defaultLocale === locale ? asPath : `/${locale}${asPath}`);
const enableDocsAIWidget = useFeature('enable_docs_ai_widget').on;
const enableDocsAIWidget = true;

return (
<>
Expand Down