From 4c711d0349800822a95692010f185fecde3b3fb8 Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 30 Jan 2025 08:05:06 +0100 Subject: [PATCH 1/7] initial commit --- pages/builders/chain-operators/tutorials/create-l2-rollup.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx index 0090367f1..4b31fa3b8 100644 --- a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx +++ b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx @@ -88,7 +88,6 @@ You can either use a node provider like [Alchemy](https://www.alchemy.com/) (eas You're going to be spinning up your OP Stack chain directly from source code instead of using a container system like [Docker](https://www.docker.com/). Although this adds a few extra steps, it means you'll have an easier time modifying the behavior of the stack if you'd like to do so. -If you want a summary of the various components you'll be using, take another look at the [What You're Going to Deploy](#what-youre-going-to-deploy) section above. You're using the home directory `~/` as the work directory for this tutorial for simplicity. From 9fc51d3bcb0a9e520a65798cb2e7fb580630c8c8 Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 31 Jan 2025 15:28:39 +0100 Subject: [PATCH 2/7] updated the testnet tutorial --- .../tutorials/create-l2-rollup.mdx | 75 ++++++++++++++----- 1 file changed, 58 insertions(+), 17 deletions(-) diff --git a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx index 4b31fa3b8..b59c6a76f 100644 --- a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx +++ b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx @@ -86,8 +86,8 @@ You can either use a node provider like [Alchemy](https://www.alchemy.com/) (eas ## Build the source code -You're going to be spinning up your OP Stack chain directly from source code instead of using a container system like [Docker](https://www.docker.com/). -Although this adds a few extra steps, it means you'll have an easier time modifying the behavior of the stack if you'd like to do so. +You're going to be spinning up your OP Stack chain using pre-built binaries from the latest Optimism release instead of building directly from source. +This simplifies the setup process and ensures you're using the latest stable version. You're using the home directory `~/` as the work directory for this tutorial for simplicity. @@ -112,30 +112,73 @@ git clone https://github.com/ethereum-optimism/optimism.git cd optimism ``` -{

Check out the correct branch

} + + +## Download the latest Optimism release + +The latest stable releases of `op-node`, `op-batcher`, and `op-proposer` can be found on the [Optimism releases page](https://github.com/ethereum-optimism/optimism/releases). -You will be using the `tutorials/chain` branch of the Optimism Monorepo to deploy an OP Stack testnet chain during this tutorial. -This is a non-production branch that lags behind the `develop` branch. -You should **NEVER** use the `develop` or `tutorials/chain` branches in production. +Always use the latest releases when building your chain. +Using outdated versions may lead to compatibility issues or missing critical features. -```bash -git checkout tutorials/chain -``` + -{

Check your dependencies

} +{

Navigate to Optimism releases

} - -Don't skip this step! Make sure you have all of the required dependencies installed before continuing. + Open the Official [Optimism releases page](https://github.com/ethereum-optimism/optimism/releases) in your browser. + + {

Identify latest release

} + +* Look for the most recent version tagged as `vX.Y.Z`. + +* Verify release date matches current expectations. + +* Check release notes for critical compatibility information. + +{

Download required binaries

} + +In the *Assets* section of the release, download these files for your operating system: + +* `op-node___.tar.gz` +* `op-batcher___.tar.gz` +* `op-proposer___.tar.gz` + + +**Identify your system**: +* **Windows**: Use `windows` packages. +* **macOS**: `darwin` packages (Intel: `amd64`, Apple Silicon: `arm64`). +* **Linux**: `linux` packages (`amd64` or `arm64`). -Run the following script and double check that you have all of the required versions installed. -If you don't have the correct versions installed, you may run into unexpected errors. +{

Verify file integrity

} + +1. Open the checksums.txt file in the release assets +2. Compare listed SHA256 values with your downloaded files using: + * Windows: PowerShell Get-FileHash command + * macOS: Terminal shasum command + * Linux: Terminal sha256sum command + +{

Extract binaries

} + +Using your system's archive tool: +1. Extract all .tar.gz files +2. Preserve directory structure during extraction + +Move these extracted files to a directory in your system PATH: +* `op-node` +* `op-batcher` +* `op-proposer` + +{

Verify installation

} ```bash -./packages/contracts-bedrock/scripts/getting-started/versions.sh +op-node --version +op-batcher --version +op-proposer --version ``` +
{

Install dependencies

} @@ -150,8 +193,6 @@ make op-node op-batcher op-proposer pnpm build ``` - - ### Build `op-geth` From a2e4533dbe3718bd0e346120d92bcba3765162cb Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 31 Jan 2025 15:54:02 +0100 Subject: [PATCH 3/7] updated latest release for testnet tutorial --- .../tutorials/create-l2-rollup.mdx | 53 ++++++++----------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx index b59c6a76f..1dfe9466e 100644 --- a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx +++ b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx @@ -88,6 +88,7 @@ You can either use a node provider like [Alchemy](https://www.alchemy.com/) (eas You're going to be spinning up your OP Stack chain using pre-built binaries from the latest Optimism release instead of building directly from source. This simplifies the setup process and ensures you're using the latest stable version. +Although this adds a few extra steps, it means you'll have an easier time modifying the behavior of the stack if you'd like to do so. You're using the home directory `~/` as the work directory for this tutorial for simplicity. @@ -111,62 +112,54 @@ git clone https://github.com/ethereum-optimism/optimism.git ```bash cd optimism ``` +{

Check out the correct branch

} -
- -## Download the latest Optimism release - -The latest stable releases of `op-node`, `op-batcher`, and `op-proposer` can be found on the [Optimism releases page](https://github.com/ethereum-optimism/optimism/releases). - - -Always use the latest releases when building your chain. -Using outdated versions may lead to compatibility issues or missing critical features. + +You will be using the `tutorials/chain` branch of the Optimism Monorepo to deploy an OP Stack testnet chain during this tutorial. +This is a non-production branch that lags behind the `develop` branch. +You should **NEVER** use the `develop` or `tutorials/chain` branches in production. - +```bash +git checkout tutorials/chain +``` -{

Navigate to Optimism releases

} + +The components in the `tutorials/chain` branch are outdated and may not work as expected. +To ensure compatibility and stability, you will download the latest releases of `op-node`, `op-batcher`, and `op-proposer` from the Optimism releases page. +These latest versions will override any outdated components in the `tutorials/chain` branch. + - Open the Official [Optimism releases page](https://github.com/ethereum-optimism/optimism/releases) in your browser. +{

Download the latest Optimism releases

} +Open the Official [Optimism releases page](https://github.com/ethereum-optimism/optimism/releases) in your browser to download the latest stable releases of `op-node`, `op-batcher`, and `op-proposer`. - {

Identify latest release

} +{

Identify latest release

} * Look for the most recent version tagged as `vX.Y.Z`. - * Verify release date matches current expectations. - * Check release notes for critical compatibility information. {

Download required binaries

} In the *Assets* section of the release, download these files for your operating system: - * `op-node___.tar.gz` * `op-batcher___.tar.gz` * `op-proposer___.tar.gz` - -**Identify your system**: -* **Windows**: Use `windows` packages. -* **macOS**: `darwin` packages (Intel: `amd64`, Apple Silicon: `arm64`). -* **Linux**: `linux` packages (`amd64` or `arm64`). - - {

Verify file integrity

} 1. Open the checksums.txt file in the release assets -2. Compare listed SHA256 values with your downloaded files using: - * Windows: PowerShell Get-FileHash command - * macOS: Terminal shasum command - * Linux: Terminal sha256sum command +2. Compare listed `SHA256` values with your downloaded files using: + * Windows: PowerShell `Get-FileHash` command + * macOS: Terminal `shasum` command + * Linux: Terminal `sha256sum` command {

Extract binaries

} Using your system's archive tool: -1. Extract all .tar.gz files -2. Preserve directory structure during extraction +1. Extract all `.tar.gz` files +2. Override any outdated components in the `tutorials/chain` branch during extraction by moving these extracted files to a directory in your system `PATH`: -Move these extracted files to a directory in your system PATH: * `op-node` * `op-batcher` * `op-proposer` From 3cc152af14c026c4c178925d35e98cef689a9687 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Fri, 31 Jan 2025 16:00:45 +0100 Subject: [PATCH 4/7] Update pages/builders/chain-operators/tutorials/create-l2-rollup.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../chain-operators/tutorials/create-l2-rollup.mdx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx index 1dfe9466e..a88f952cb 100644 --- a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx +++ b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx @@ -125,9 +125,12 @@ git checkout tutorials/chain ``` -The components in the `tutorials/chain` branch are outdated and may not work as expected. -To ensure compatibility and stability, you will download the latest releases of `op-node`, `op-batcher`, and `op-proposer` from the Optimism releases page. -These latest versions will override any outdated components in the `tutorials/chain` branch. +The components in the `tutorials/chain` branch are outdated and may have compatibility issues with the latest L1 networks. +To ensure compatibility and stability, you will: +1. Download the latest releases of `op-node`, `op-batcher`, and `op-proposer` from the Optimism releases page +2. Use these latest versions to override the outdated components in the `tutorials/chain` branch +3. Maintain compatibility with current L1 network specifications +
{

Download the latest Optimism releases

} From 20b122ba2659210788f7b278b6d362b8820b666a Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 31 Jan 2025 16:05:59 +0100 Subject: [PATCH 5/7] format lint --- .../tutorials/create-l2-rollup.mdx | 881 +++++++++--------- words.txt | 4 - 2 files changed, 431 insertions(+), 454 deletions(-) diff --git a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx index 1dfe9466e..764136937 100644 --- a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx +++ b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx @@ -8,13 +8,12 @@ import { Callout, Steps } from 'nextra/components' import { WipCallout } from '@/components/WipCallout' -# Creating your own L2 rollup testnet - +# Creating your own L2 rollup testnet -Please **be prepared to set aside approximately one hour** to get everything running properly and **make sure to read through the guide carefully**. -You don't want to miss any important steps that might cause issues down the line. + Please **be prepared to set aside approximately one hour** to get everything running properly and **make sure to read through the guide carefully**. + You don't want to miss any important steps that might cause issues down the line. This tutorial is **designed for developers** who want to learn about the OP Stack by spinning up an OP Stack testnet chain. @@ -22,15 +21,15 @@ You'll walk through the full deployment process and teach you all of the compone It's useful to understand what each of these components does before you start deploying your chain. To learn about the different components please -read the [deployment overview page](/builders/chain-operators/deploy/overview). +read the [deployment overview page](/builders/chain-operators/deploy/overview). You can use this testnet to experiment and perform tests, or you can choose to modify the chain to adapt it to your own needs. **The OP Stack is free and open source software licensed entirely under the MIT license**. You don't need permission from anyone to modify or deploy the stack in any configuration you want. -Modifications to the OP Stack may prevent a chain from being able to benefit from aspects of the [Optimism Superchain](/superchain/superchain-explainer). -Make sure to check out the [Superchain Explainer](/superchain/superchain-explainer) to learn more. + Modifications to the OP Stack may prevent a chain from being able to benefit from aspects of the [Optimism Superchain](/superchain/superchain-explainer). + Make sure to check out the [Superchain Explainer](/superchain/superchain-explainer) to learn more. ## Software dependencies @@ -57,6 +56,7 @@ You may experience unexpected errors on older versions of Node.js. #### `foundry` It's recommended to use the scripts in the monorepo's `package.json` for managing `foundry` to ensure you're always working with the correct version. This approach simplifies the installation, update, and version checking process. Make sure to clone the monorepo locally before proceeding. + #### `direnv` Parts of this tutorial use [`direnv`](https://direnv.net) as a way of loading environment variables from `.envrc` files into your shell. @@ -67,8 +67,8 @@ After [installing `direnv`](https://direnv.net/docs/installation.html), you will Make sure you've followed [the guide on the `direnv` website](https://direnv.net/docs/hook.html), then **close your terminal and reopen it** so that the changes take effect (or `source` your config file if you know how to do that). -Make sure that you have correctly hooked `direnv` into your shell by modifying your shell configuration file (like `~/.bashrc` or `~/.zshrc`). -If you haven't edited a config file then you probably haven't configured `direnv` properly (and things might not work later). + Make sure that you have correctly hooked `direnv` into your shell by modifying your shell configuration file (like `~/.bashrc` or `~/.zshrc`). + If you haven't edited a config file then you probably haven't configured `direnv` properly (and things might not work later). ## Get access to a sepolia node @@ -86,91 +86,100 @@ You can either use a node provider like [Alchemy](https://www.alchemy.com/) (eas ## Build the source code -You're going to be spinning up your OP Stack chain using pre-built binaries from the latest Optimism release instead of building directly from source. +You're going to be spinning up your OP Stack chain using pre-built binaries from the latest Optimism release instead of building directly from source. This simplifies the setup process and ensures you're using the latest stable version. Although this adds a few extra steps, it means you'll have an easier time modifying the behavior of the stack if you'd like to do so. -You're using the home directory `~/` as the work directory for this tutorial for simplicity. -You can use any directory you'd like but using the home directory will allow you to copy/paste the commands in this guide. -If you choose to use a different directory, make sure you're using the correct directory in the commands throughout this tutorial. + You're using the home directory `~/` as the work directory for this tutorial for simplicity. + You can use any directory you'd like but using the home directory will allow you to copy/paste the commands in this guide. + If you choose to use a different directory, make sure you're using the correct directory in the commands throughout this tutorial. ### Build the Optimism monorepo + {

Clone the Optimism Monorepo

} -{

Clone the Optimism Monorepo

} + ```bash + cd ~ + git clone https://github.com/ethereum-optimism/optimism.git + ``` -```bash -cd ~ -git clone https://github.com/ethereum-optimism/optimism.git -``` + {

Enter the Optimism Monorepo

} -{

Enter the Optimism Monorepo

} + ```bash + cd optimism + ``` -```bash -cd optimism -``` -{

Check out the correct branch

} + {

Check out the correct branch

} - -You will be using the `tutorials/chain` branch of the Optimism Monorepo to deploy an OP Stack testnet chain during this tutorial. -This is a non-production branch that lags behind the `develop` branch. -You should **NEVER** use the `develop` or `tutorials/chain` branches in production. - + + You will be using the `tutorials/chain` branch of the Optimism Monorepo to deploy an OP Stack testnet chain during this tutorial. + This is a non-production branch that lags behind the `develop` branch. + You should **NEVER** use the `develop` or `tutorials/chain` branches in production. + -```bash -git checkout tutorials/chain -``` + ```bash + git checkout tutorials/chain + ``` - -The components in the `tutorials/chain` branch are outdated and may not work as expected. -To ensure compatibility and stability, you will download the latest releases of `op-node`, `op-batcher`, and `op-proposer` from the Optimism releases page. -These latest versions will override any outdated components in the `tutorials/chain` branch. - + + The components in the `tutorials/chain` branch are outdated and may not work as expected.\ + To ensure compatibility and stability, you will download the latest releases of `op-node`, `op-batcher`, and `op-proposer` from the Optimism releases page.\ + These latest versions will override any outdated components in the `tutorials/chain` branch. + -{

Download the latest Optimism releases

} -Open the Official [Optimism releases page](https://github.com/ethereum-optimism/optimism/releases) in your browser to download the latest stable releases of `op-node`, `op-batcher`, and `op-proposer`. + {

Download the latest Optimism releases

} -{

Identify latest release

} + 1. Visit the [Official Optimism releases page](https://github.com/ethereum-optimism/optimism/releases) + 2. Look for the latest stable release tagged as `vX.Y.Z` + 3. Download the following components for your operating system: -* Look for the most recent version tagged as `vX.Y.Z`. -* Verify release date matches current expectations. -* Check release notes for critical compatibility information. + * `op-node` + * `op-batcher` + * `op-proposer` -{

Download required binaries

} + {

Verify release integrity

} -In the *Assets* section of the release, download these files for your operating system: -* `op-node___.tar.gz` -* `op-batcher___.tar.gz` -* `op-proposer___.tar.gz` + 1. Download the `checksums.txt` file from the release assets + 2. Verify file integrity using the appropriate command for your OS: -{

Verify file integrity

} + ```bash + # On Linux + sha256sum -c checksums.txt + # On macOS + shasum -a 256 -c checksums.txt + # On Windows (PowerShell) + Get-FileHash | Format-List + ``` -1. Open the checksums.txt file in the release assets -2. Compare listed `SHA256` values with your downloaded files using: - * Windows: PowerShell `Get-FileHash` command - * macOS: Terminal `shasum` command - * Linux: Terminal `sha256sum` command + {

Download required binaries

} -{

Extract binaries

} + In the *Assets* section of the release, download these files for your operating system: -Using your system's archive tool: -1. Extract all `.tar.gz` files -2. Override any outdated components in the `tutorials/chain` branch during extraction by moving these extracted files to a directory in your system `PATH`: + * `op-node___.tar.gz` + * `op-batcher___.tar.gz` + * `op-proposer___.tar.gz` -* `op-node` -* `op-batcher` -* `op-proposer` + {

Extract binaries

} -{

Verify installation

} + Using your system's archive tool: -```bash -op-node --version -op-batcher --version -op-proposer --version -``` + 1. Extract all `.tar.gz` files + 2. Override any outdated components in the `tutorials/chain` branch during extraction by moving these extracted files to a directory in your system `PATH`: + + * `op-node` + * `op-batcher` + * `op-proposer` + + {

Verify installation

} + + ```bash + op-node --version + op-batcher --version + op-proposer --version + ```
{

Install dependencies

} @@ -189,26 +198,24 @@ pnpm build ### Build `op-geth` + {

Clone op-geth

} -{

Clone op-geth

} + ```bash + cd ~ + git clone https://github.com/ethereum-optimism/op-geth.git + ``` -```bash -cd ~ -git clone https://github.com/ethereum-optimism/op-geth.git -``` + {

Enter op-geth

} -{

Enter op-geth

} + ```bash + cd op-geth + ``` -```bash -cd op-geth -``` - -{

Build op-geth

} - -```bash -make geth -``` + {

Build op-geth

} + ```bash + make geth + ```
## Fill out environment variables @@ -216,28 +223,26 @@ make geth You'll need to fill out a few environment variables before you can start deploying your chain. + {

Enter the Optimism Monorepo

} -{

Enter the Optimism Monorepo

} - -```bash -cd ~/optimism -``` - -{

Duplicate the sample environment variable file

} + ```bash + cd ~/optimism + ``` -```bash -cp .envrc.example .envrc -``` + {

Duplicate the sample environment variable file

} -{

Fill out the environment variable file

} + ```bash + cp .envrc.example .envrc + ``` -Open up the environment variable file and fill out the following variables: + {

Fill out the environment variable file

} -| Variable Name | Description | -| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `L1_RPC_URL` | URL for your L1 node (a Sepolia node in this case). | -| `L1_RPC_KIND` | Kind of L1 RPC you're connecting to, used to inform optimal transactions receipts fetching. Valid options: `alchemy`, `quicknode`, `infura`, `parity`, `nethermind`, `debug_geth`, `erigon`, `basic`, `any`. | + Open up the environment variable file and fill out the following variables: + | Variable Name | Description | + | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | + | `L1_RPC_URL` | URL for your L1 node (a Sepolia node in this case). | + | `L1_RPC_KIND` | Kind of L1 RPC you're connecting to, used to inform optimal transactions receipts fetching. Valid options: `alchemy`, `quicknode`, `infura`, `parity`, `nethermind`, `debug_geth`, `erigon`, `basic`, `any`. |
## Generate addresses @@ -250,66 +255,64 @@ You'll need four addresses and their private keys when setting up the chain: * The `Sequencer` address signs blocks on the p2p network. + {

Enter the Optimism Monorepo

} -{

Enter the Optimism Monorepo

} + ```bash + cd ~/optimism + ``` -```bash -cd ~/optimism -``` + {

Generate new addresses

} -{

Generate new addresses

} + + You should **not** use the `wallets.sh` tool for production deployments. + If you are deploying an OP Stack based chain into production, you should likely be using a combination of hardware security modules and hardware wallets. + - -You should **not** use the `wallets.sh` tool for production deployments. -If you are deploying an OP Stack based chain into production, you should likely be using a combination of hardware security modules and hardware wallets. - + ```bash + ./packages/contracts-bedrock/scripts/getting-started/wallets.sh + ``` -```bash -./packages/contracts-bedrock/scripts/getting-started/wallets.sh -``` + {

Check the output

} -{

Check the output

} - -Make sure that you see output that looks something like the following: - -```text -Copy the following into your .envrc file: - -# Admin address -export GS_ADMIN_ADDRESS=0x9625B9aF7C42b4Ab7f2C437dbc4ee749d52E19FC -export GS_ADMIN_PRIVATE_KEY=0xbb93a75f64c57c6f464fd259ea37c2d4694110df57b2e293db8226a502b30a34 - -# Batcher address -export GS_BATCHER_ADDRESS=0xa1AEF4C07AB21E39c37F05466b872094edcf9cB1 -export GS_BATCHER_PRIVATE_KEY=0xe4d9cd91a3e53853b7ea0dad275efdb5173666720b1100866fb2d89757ca9c5a - -# Proposer address -export GS_PROPOSER_ADDRESS=0x40E805e252D0Ee3D587b68736544dEfB419F351b -export GS_PROPOSER_PRIVATE_KEY=0x2d1f265683ebe37d960c67df03a378f79a7859038c6d634a61e40776d561f8a2 - -# Sequencer address -export GS_SEQUENCER_ADDRESS=0xC06566E8Ec6cF81B4B26376880dB620d83d50Dfb -export GS_SEQUENCER_PRIVATE_KEY=0x2a0290473f3838dbd083a5e17783e3cc33c905539c0121f9c76614dda8a38dca -``` + Make sure that you see output that looks something like the following: -{

Save the addresses

} + ```text + Copy the following into your .envrc file: + + # Admin address + export GS_ADMIN_ADDRESS=0x9625B9aF7C42b4Ab7f2C437dbc4ee749d52E19FC + export GS_ADMIN_PRIVATE_KEY=0xbb93a75f64c57c6f464fd259ea37c2d4694110df57b2e293db8226a502b30a34 -Copy the output from the previous step and paste it into your `.envrc` file as directed. + # Batcher address + export GS_BATCHER_ADDRESS=0xa1AEF4C07AB21E39c37F05466b872094edcf9cB1 + export GS_BATCHER_PRIVATE_KEY=0xe4d9cd91a3e53853b7ea0dad275efdb5173666720b1100866fb2d89757ca9c5a + + # Proposer address + export GS_PROPOSER_ADDRESS=0x40E805e252D0Ee3D587b68736544dEfB419F351b + export GS_PROPOSER_PRIVATE_KEY=0x2d1f265683ebe37d960c67df03a378f79a7859038c6d634a61e40776d561f8a2 + + # Sequencer address + export GS_SEQUENCER_ADDRESS=0xC06566E8Ec6cF81B4B26376880dB620d83d50Dfb + export GS_SEQUENCER_PRIVATE_KEY=0x2a0290473f3838dbd083a5e17783e3cc33c905539c0121f9c76614dda8a38dca + ``` -{

Fund the addresses

} + {

Save the addresses

} -**You will need to send ETH to the `Admin`, `Proposer`, and `Batcher` addresses.** -The exact amount of ETH required depends on the L1 network being used. -**You do not need to send any ETH to the `Sequencer` address as it does not send transactions.** + Copy the output from the previous step and paste it into your `.envrc` file as directed. -It's recommended to fund the addresses with the following amounts when using Sepolia: + {

Fund the addresses

} -* `Admin` — 0.5 Sepolia ETH -* `Batcher` — 0.1 Sepolia ETH -* `Proposer` — 0.2 Sepolia ETH + **You will need to send ETH to the `Admin`, `Proposer`, and `Batcher` addresses.** + The exact amount of ETH required depends on the L1 network being used. + **You do not need to send any ETH to the `Sequencer` address as it does not send transactions.** -**To get the required Sepolia ETH to fund the addresses, we recommend using the [Superchain Faucet](https://console.optimism.io/faucet?utm_source=docs)** together with [Coinbase verification](https://help.coinbase.com/en/coinbase/getting-started/getting-started-with-coinbase/id-doc-verification). + It's recommended to fund the addresses with the following amounts when using Sepolia: + * `Admin` — 0.5 Sepolia ETH + * `Batcher` — 0.1 Sepolia ETH + * `Proposer` — 0.2 Sepolia ETH + + **To get the required Sepolia ETH to fund the addresses, we recommend using the [Superchain Faucet](https://console.optimism.io/faucet?utm_source=docs)** together with [Coinbase verification](https://help.coinbase.com/en/coinbase/getting-started/getting-started-with-coinbase/id-doc-verification).
## Load environment variables @@ -317,43 +320,41 @@ It's recommended to fund the addresses with the following amounts when using Sep Now that you've filled out the environment variable file, you need to load those variables into your terminal. + {

Enter the Optimism Monorepo

} -{

Enter the Optimism Monorepo

} + ```bash + cd ~/optimism + ``` -```bash -cd ~/optimism -``` - -{

Load the variables with direnv

} - - -You're about to use `direnv` to load environment variables from the `.envrc` file into your terminal. -Make sure that you've [installed `direnv`](https://direnv.net/docs/installation.html) and that you've properly [hooked `direnv` into your shell](#configuring-direnv). - + {

Load the variables with direnv

} -Next you'll need to allow `direnv` to read this file and load the variables into your terminal using the following command. + + You're about to use `direnv` to load environment variables from the `.envrc` file into your terminal. + Make sure that you've [installed `direnv`](https://direnv.net/docs/installation.html) and that you've properly [hooked `direnv` into your shell](#configuring-direnv). + -```bash -direnv allow -``` + Next you'll need to allow `direnv` to read this file and load the variables into your terminal using the following command. - -WARNING: `direnv` will unload itself whenever your `.envrc` file changes. -**You *must* rerun the following command every time you change the `.envrc` file.** - + ```bash + direnv allow + ``` -{

Confirm that the variables were loaded

} + + WARNING: `direnv` will unload itself whenever your `.envrc` file changes. + **You *must* rerun the following command every time you change the `.envrc` file.** + -After running `direnv allow` you should see output that looks something like the following (the exact output will vary depending on the variables you've set, don't worry if it doesn't look exactly like this): + {

Confirm that the variables were loaded

} -```bash -direnv: loading ~/optimism/.envrc -direnv: export +DEPLOYMENT_CONTEXT +ETHERSCAN_API_KEY +GS_ADMIN_ADDRESS +GS_ADMIN_PRIVATE_KEY +GS_BATCHER_ADDRESS +GS_BATCHER_PRIVATE_KEY +GS_PROPOSER_ADDRESS +GS_PROPOSER_PRIVATE_KEY +GS_SEQUENCER_ADDRESS +GS_SEQUENCER_PRIVATE_KEY +IMPL_SALT +L1_RPC_KIND +L1_RPC_URL +PRIVATE_KEY +TENDERLY_PROJECT +TENDERLY_USERNAME -``` + After running `direnv allow` you should see output that looks something like the following (the exact output will vary depending on the variables you've set, don't worry if it doesn't look exactly like this): -**If you don't see this output, you likely haven't [properly configured `direnv`](#configuring-direnv).** -Make sure you've configured `direnv` properly and run `direnv allow` again so that you see the desired output. + ```bash + direnv: loading ~/optimism/.envrc + direnv: export +DEPLOYMENT_CONTEXT +ETHERSCAN_API_KEY +GS_ADMIN_ADDRESS +GS_ADMIN_PRIVATE_KEY +GS_BATCHER_ADDRESS +GS_BATCHER_PRIVATE_KEY +GS_PROPOSER_ADDRESS +GS_PROPOSER_PRIVATE_KEY +GS_SEQUENCER_ADDRESS +GS_SEQUENCER_PRIVATE_KEY +IMPL_SALT +L1_RPC_KIND +L1_RPC_URL +PRIVATE_KEY +TENDERLY_PROJECT +TENDERLY_USERNAME + ``` + **If you don't see this output, you likely haven't [properly configured `direnv`](#configuring-direnv).** + Make sure you've configured `direnv` properly and run `direnv allow` again so that you see the desired output.
## Configure your network @@ -362,38 +363,36 @@ Once you've built both repositories, you'll need to head back to the Optimism Mo Currently, chain configuration lives inside of the [`contracts-bedrock`](https://github.com/ethereum-optimism/optimism/tree/v1.1.4/packages/contracts-bedrock) package in the form of a JSON file. + {

Enter the Optimism Monorepo

} -{

Enter the Optimism Monorepo

} - -```bash -cd ~/optimism -``` - -{

Move into the contracts-bedrock package

} + ```bash + cd ~/optimism + ``` -```bash -cd packages/contracts-bedrock -``` + {

Move into the contracts-bedrock package

} -{

Install Foundry dependencies

} + ```bash + cd packages/contracts-bedrock + ``` -```bash -forge install -``` + {

Install Foundry dependencies

} -{

Generate the configuration file

} + ```bash + forge install + ``` -Run the following script to generate the `getting-started.json` configuration file inside of the `deploy-config` directory. + {

Generate the configuration file

} -```bash -./scripts/getting-started/config.sh -``` + Run the following script to generate the `getting-started.json` configuration file inside of the `deploy-config` directory. -{

Review the configuration file (Optional)

} + ```bash + ./scripts/getting-started/config.sh + ``` -If you'd like, you can review the configuration file that was just generated by opening up `deploy-config/getting-started.json` in your favorite text editor. -It's recommended to keep this file as-is for now so you don't run into any unexpected errors. + {

Review the configuration file (Optional)

} + If you'd like, you can review the configuration file that was just generated by opening up `deploy-config/getting-started.json` in your favorite text editor. + It's recommended to keep this file as-is for now so you don't run into any unexpected errors.
## Deploy the Create2 factory (optional) @@ -402,50 +401,48 @@ If you're deploying an OP Stack chain to a network other than Sepolia, you may n This factory contract is used to deploy OP Stack smart contracts in a deterministic fashion. -This step is typically only necessary if you are deploying your OP Stack chain to custom L1 chain. -If you are deploying your OP Stack chain to Sepolia, you can safely skip this step. + This step is typically only necessary if you are deploying your OP Stack chain to custom L1 chain. + If you are deploying your OP Stack chain to Sepolia, you can safely skip this step. + {

Check if the factory exists

} -{

Check if the factory exists

} - -The Create2 factory contract will be deployed at the address `0x4e59b44847b379578588920cA78FbF26c0B4956C`. -You can check if this contract has already been deployed to your L1 network with a block explorer or by running the following command: - -```bash -cast codesize 0x4e59b44847b379578588920cA78FbF26c0B4956C --rpc-url $L1_RPC_URL -``` + The Create2 factory contract will be deployed at the address `0x4e59b44847b379578588920cA78FbF26c0B4956C`. + You can check if this contract has already been deployed to your L1 network with a block explorer or by running the following command: -If the command returns `0` then the contract has not been deployed yet. -If the command returns `69` then the contract has been deployed and you can safely skip this section. + ```bash + cast codesize 0x4e59b44847b379578588920cA78FbF26c0B4956C --rpc-url $L1_RPC_URL + ``` -{

Fund the factory deployer

} + If the command returns `0` then the contract has not been deployed yet. + If the command returns `69` then the contract has been deployed and you can safely skip this section. -You will need to send some ETH to the address that will be used to deploy the factory contract, `0x3fAB184622Dc19b6109349B94811493BF2a45362`. -This address can only be used to deploy the factory contract and will not be used for anything else. -Send at least 1 ETH to this address on your L1 chain. + {

Fund the factory deployer

} -{

Deploy the factory

} + You will need to send some ETH to the address that will be used to deploy the factory contract, `0x3fAB184622Dc19b6109349B94811493BF2a45362`. + This address can only be used to deploy the factory contract and will not be used for anything else. + Send at least 1 ETH to this address on your L1 chain. -Using `cast`, deploy the factory contract to your L1 chain: + {

Deploy the factory

} -```bash -cast publish --rpc-url $L1_RPC_URL 0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222 -``` + Using `cast`, deploy the factory contract to your L1 chain: -{

Wait for the transaction to be mined

} + ```bash + cast publish --rpc-url $L1_RPC_URL 0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222 + ``` -Make sure that the transaction is included in a block on your L1 chain before continuing. + {

Wait for the transaction to be mined

} -{

Verify that the factory was deployed

} + Make sure that the transaction is included in a block on your L1 chain before continuing. -Run the code size check again to make sure that the factory was properly deployed: + {

Verify that the factory was deployed

} -```bash -cast codesize 0x4e59b44847b379578588920cA78FbF26c0B4956C --rpc-url $L1_RPC_URL -``` + Run the code size check again to make sure that the factory was properly deployed: + ```bash + cast codesize 0x4e59b44847b379578588920cA78FbF26c0B4956C --rpc-url $L1_RPC_URL + ```
## Deploy the L1 contracts @@ -453,20 +450,18 @@ cast codesize 0x4e59b44847b379578588920cA78FbF26c0B4956C --rpc-url $L1_RPC_URL Once you've configured your network, it's time to deploy the L1 contracts necessary for the functionality of the chain. - -{

Deploy the L1 contracts

} - -```bash -forge script scripts/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow -``` - - -If you see a nondescript error that includes `EvmError: Revert` and `Script failed` then you likely need to change the `IMPL_SALT` environment variable. -This variable determines the addresses of various smart contracts that are deployed via [CREATE2](https://eips.ethereum.org/EIPS/eip-1014). -If the same `IMPL_SALT` is used to deploy the same contracts twice, the second deployment will fail. -**You can generate a new `IMPL_SALT` by running `direnv allow` anywhere in the Optimism Monorepo.** - - + {

Deploy the L1 contracts

} + + ```bash + forge script scripts/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow + ``` + + + If you see a nondescript error that includes `EvmError: Revert` and `Script failed` then you likely need to change the `IMPL_SALT` environment variable. + This variable determines the addresses of various smart contracts that are deployed via [CREATE2](https://eips.ethereum.org/EIPS/eip-1014). + If the same `IMPL_SALT` is used to deploy the same contracts twice, the second deployment will fail. + **You can generate a new `IMPL_SALT` by running `direnv allow` anywhere in the Optimism Monorepo.** +
## Generate the L2 config files @@ -480,45 +475,43 @@ You need to generate three important files: 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). + {

Navigate to the op-node package

} -{

Navigate to the op-node package

} + ```bash + cd ~/optimism/op-node + ``` -```bash -cd ~/optimism/op-node -``` + {

Create genesis files

} -{

Create genesis files

} + Now you'll generate the `genesis.json` and `rollup.json` files within the `op-node` folder: -Now you'll generate the `genesis.json` and `rollup.json` files within the `op-node` folder: + ```bash + go run cmd/main.go genesis l2 \ + --deploy-config ../packages/contracts-bedrock/deploy-config/getting-started.json \ + --l1-deployments ../packages/contracts-bedrock/deployments/getting-started/.deploy \ + --outfile.l2 genesis.json \ + --outfile.rollup rollup.json \ + --l1-rpc $L1_RPC_URL + ``` -```bash -go run cmd/main.go genesis l2 \ - --deploy-config ../packages/contracts-bedrock/deploy-config/getting-started.json \ - --l1-deployments ../packages/contracts-bedrock/deployments/getting-started/.deploy \ - --outfile.l2 genesis.json \ - --outfile.rollup rollup.json \ - --l1-rpc $L1_RPC_URL -``` - -{

Create an authentication key

} - -Next you'll create a [JSON Web Token](https://jwt.io/introduction) that will be used to authenticate the Consensus Client and the Execution Client. -This token is used to ensure that only the Consensus Client and the Execution Client can communicate with each other. -You can generate a JWT with the following command: + {

Create an authentication key

} -```bash -openssl rand -hex 32 > jwt.txt -``` + Next you'll create a [JSON Web Token](https://jwt.io/introduction) that will be used to authenticate the Consensus Client and the Execution Client. + This token is used to ensure that only the Consensus Client and the Execution Client can communicate with each other. + You can generate a JWT with the following command: -{

Copy genesis files into the op-geth directory

} + ```bash + openssl rand -hex 32 > jwt.txt + ``` -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`: + {

Copy genesis files into the op-geth directory

} -```bash -cp genesis.json ~/op-geth -cp jwt.txt ~/op-geth -``` + 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`: + ```bash + cp genesis.json ~/op-geth + cp jwt.txt ~/op-geth + ```
## Initialize `op-geth` @@ -529,31 +522,29 @@ You're going to be running a Sequencer node, so you'll need to import the `Seque This private key is what your Sequencer will use to sign new blocks. + {

Navigate to the op-geth directory

} -{

Navigate to the op-geth directory

} - -```bash -cd ~/op-geth -``` - -{

Create a data directory folder

} + ```bash + cd ~/op-geth + ``` -```bash -mkdir datadir -``` + {

Create a data directory folder

} -{

Build the op-geth binary

} + ```bash + mkdir datadir + ``` -```bash -make geth -``` + {

Build the op-geth binary

} -{

Initialize op-geth

} + ```bash + make geth + ``` -```bash -build/bin/geth init --state.scheme=hash --datadir=datadir genesis.json -``` + {

Initialize op-geth

} + ```bash + build/bin/geth init --state.scheme=hash --datadir=datadir genesis.json + ```
## Start `op-geth` @@ -562,54 +553,52 @@ Now you'll start `op-geth`, your Execution Client. Note that you won't start seeing any transactions until you start the Consensus Client in the next step. - -{

Open up a new terminal

} - -You'll need a terminal window to run `op-geth` in. - -{

Navigate to the op-geth directory

} - -```bash -cd ~/op-geth -``` - -{

Run op-geth

} - - -You're using `--gcmode=archive` to run `op-geth` here because this node will act as your Sequencer. -It's useful to run the Sequencer in archive mode because the `op-proposer` requires access to the full state. -Feel free to run other (non-Sequencer) nodes in full mode if you'd like to save disk space. Just make sure at least one other archive node exists and the `op-proposer` points to it. - - - -It's important that you've already initialized the geth node at this point as per the previous section. Failure to do this will cause startup issues between `op-geth` and `op-node`. - - -```bash -./build/bin/geth \ - --datadir ./datadir \ - --http \ - --http.corsdomain="*" \ - --http.vhosts="*" \ - --http.addr=0.0.0.0 \ - --http.api=web3,debug,eth,txpool,net,engine \ - --ws \ - --ws.addr=0.0.0.0 \ - --ws.port=8546 \ - --ws.origins="*" \ - --ws.api=debug,eth,txpool,net,engine \ - --syncmode=full \ - --gcmode=archive \ - --nodiscover \ - --maxpeers=0 \ - --networkid=42069 \ - --authrpc.vhosts="*" \ - --authrpc.addr=0.0.0.0 \ - --authrpc.port=8551 \ - --authrpc.jwtsecret=./jwt.txt \ - --rollup.disabletxpoolgossip=true -``` - + {

Open up a new terminal

} + + You'll need a terminal window to run `op-geth` in. + + {

Navigate to the op-geth directory

} + + ```bash + cd ~/op-geth + ``` + + {

Run op-geth

} + + + You're using `--gcmode=archive` to run `op-geth` here because this node will act as your Sequencer. + It's useful to run the Sequencer in archive mode because the `op-proposer` requires access to the full state. + Feel free to run other (non-Sequencer) nodes in full mode if you'd like to save disk space. Just make sure at least one other archive node exists and the `op-proposer` points to it. + + + + It's important that you've already initialized the geth node at this point as per the previous section. Failure to do this will cause startup issues between `op-geth` and `op-node`. + + + ```bash + ./build/bin/geth \ + --datadir ./datadir \ + --http \ + --http.corsdomain="*" \ + --http.vhosts="*" \ + --http.addr=0.0.0.0 \ + --http.api=web3,debug,eth,txpool,net,engine \ + --ws \ + --ws.addr=0.0.0.0 \ + --ws.port=8546 \ + --ws.origins="*" \ + --ws.api=debug,eth,txpool,net,engine \ + --syncmode=full \ + --gcmode=archive \ + --nodiscover \ + --maxpeers=0 \ + --networkid=42069 \ + --authrpc.vhosts="*" \ + --authrpc.addr=0.0.0.0 \ + --authrpc.port=8551 \ + --authrpc.jwtsecret=./jwt.txt \ + --rollup.disabletxpoolgossip=true + ```
## Start `op-node` @@ -619,58 +608,56 @@ Like Ethereum, the OP Stack has a Consensus Client (`op-node`) and an Execution The Consensus Client "drives" the Execution Client over the Engine API. - -{

Open up a new terminal

} - -You'll need a terminal window to run the `op-node` in. - -{

Navigate to the op-node directory

} - -```bash -cd ~/optimism/op-node -``` - -{

Run op-node

} - -```bash -./bin/op-node \ - --l2=http://localhost:8551 \ - --l2.jwt-secret=./jwt.txt \ - --sequencer.enabled \ - --sequencer.l1-confs=5 \ - --verifier.l1-confs=4 \ - --rollup.config=./rollup.json \ - --rpc.addr=0.0.0.0 \ - --p2p.disable \ - --rpc.enable-admin \ - --p2p.sequencer.key=$GS_SEQUENCER_PRIVATE_KEY \ - --l1=$L1_RPC_URL \ - --l1.rpckind=$L1_RPC_KIND -``` - -Once you run this command, you should start seeing the `op-node` begin to sync L2 blocks from the L1 chain. -Once the `op-node` has caught up to the tip of the L1 chain, it'll begin to send blocks to `op-geth` for execution. -At that point, you'll start to see blocks being created inside of `op-geth`. - - -**By default, your `op-node` will try to use a peer-to-peer to speed up the synchronization process.** -If you're using a chain ID that is also being used by others, like the default chain ID for this tutorial (42069), your `op-node` will receive blocks signed by other sequencers. -These requests will fail and waste time and network resources. -**To avoid this, this tutorial starts with peer-to-peer synchronization disabled (`--p2p.disable`).** - -Once you have multiple nodes, you may want to enable peer-to-peer synchronization. -You can add the following options to the `op-node` command to enable peer-to-peer synchronization with specific nodes: - -``` - --p2p.static= \ - --p2p.listen.ip=0.0.0.0 \ - --p2p.listen.tcp=9003 \ - --p2p.listen.udp=9003 \ -``` - -You can alternatively also remove the [--p2p.static](/builders/node-operators/configuration/consensus-config#p2pstatic) option, but you may see failed requests from other chains using the same chain ID. - - + {

Open up a new terminal

} + + You'll need a terminal window to run the `op-node` in. + + {

Navigate to the op-node directory

} + + ```bash + cd ~/optimism/op-node + ``` + + {

Run op-node

} + + ```bash + ./bin/op-node \ + --l2=http://localhost:8551 \ + --l2.jwt-secret=./jwt.txt \ + --sequencer.enabled \ + --sequencer.l1-confs=5 \ + --verifier.l1-confs=4 \ + --rollup.config=./rollup.json \ + --rpc.addr=0.0.0.0 \ + --p2p.disable \ + --rpc.enable-admin \ + --p2p.sequencer.key=$GS_SEQUENCER_PRIVATE_KEY \ + --l1=$L1_RPC_URL \ + --l1.rpckind=$L1_RPC_KIND + ``` + + Once you run this command, you should start seeing the `op-node` begin to sync L2 blocks from the L1 chain. + Once the `op-node` has caught up to the tip of the L1 chain, it'll begin to send blocks to `op-geth` for execution. + At that point, you'll start to see blocks being created inside of `op-geth`. + + + **By default, your `op-node` will try to use a peer-to-peer to speed up the synchronization process.** + If you're using a chain ID that is also being used by others, like the default chain ID for this tutorial (42069), your `op-node` will receive blocks signed by other sequencers. + These requests will fail and waste time and network resources. + **To avoid this, this tutorial starts with peer-to-peer synchronization disabled (`--p2p.disable`).** + + Once you have multiple nodes, you may want to enable peer-to-peer synchronization. + You can add the following options to the `op-node` command to enable peer-to-peer synchronization with specific nodes: + + ``` + --p2p.static= \ + --p2p.listen.ip=0.0.0.0 \ + --p2p.listen.tcp=9003 \ + --p2p.listen.udp=9003 \ + ``` + + You can alternatively also remove the [--p2p.static](/builders/node-operators/configuration/consensus-config#p2pstatic) option, but you may see failed requests from other chains using the same chain ID. +
## Start `op-batcher` @@ -683,43 +670,41 @@ It's best to give the `Batcher` address at least 1 Sepolia ETH to ensure that it Keep an eye on the balance of the `Batcher` address because it can expend ETH quickly if there are a lot of transactions to publish. - -{

Open up a new terminal

} - -You'll need a terminal window to run the `op-batcher` in. - -{

Navigate to the op-batcher directory

} - -```bash -cd ~/optimism/op-batcher -``` - -{

Run op-batcher

} - -```bash -./bin/op-batcher \ - --l2-eth-rpc=http://localhost:8545 \ - --rollup-rpc=http://localhost:9545 \ - --poll-interval=1s \ - --sub-safety-margin=6 \ - --num-confirmations=1 \ - --safe-abort-nonce-too-low-count=3 \ - --resubmission-timeout=30s \ - --rpc.addr=0.0.0.0 \ - --rpc.port=8548 \ - --rpc.enable-admin \ - --max-channel-duration=25 \ - --l1-eth-rpc=$L1_RPC_URL \ - --private-key=$GS_BATCHER_PRIVATE_KEY -``` - - -The [`--max-channel-duration=n`](/builders/chain-operators/configuration/batcher#set-your--op_batcher_max_channel_duration) setting tells the batcher to write all the data to L1 every `n` L1 blocks. -When it is low, transactions are written to L1 frequently and other nodes can synchronize from L1 quickly. -When it is high, transactions are written to L1 less frequently and the batcher spends less ETH. -If you want to reduce costs, either set this value to 0 to disable it or increase it to a higher value. - - + {

Open up a new terminal

} + + You'll need a terminal window to run the `op-batcher` in. + + {

Navigate to the op-batcher directory

} + + ```bash + cd ~/optimism/op-batcher + ``` + + {

Run op-batcher

} + + ```bash + ./bin/op-batcher \ + --l2-eth-rpc=http://localhost:8545 \ + --rollup-rpc=http://localhost:9545 \ + --poll-interval=1s \ + --sub-safety-margin=6 \ + --num-confirmations=1 \ + --safe-abort-nonce-too-low-count=3 \ + --resubmission-timeout=30s \ + --rpc.addr=0.0.0.0 \ + --rpc.port=8548 \ + --rpc.enable-admin \ + --max-channel-duration=25 \ + --l1-eth-rpc=$L1_RPC_URL \ + --private-key=$GS_BATCHER_PRIVATE_KEY + ``` + + + The [`--max-channel-duration=n`](/builders/chain-operators/configuration/batcher#set-your--op_batcher_max_channel_duration) setting tells the batcher to write all the data to L1 every `n` L1 blocks. + When it is low, transactions are written to L1 frequently and other nodes can synchronize from L1 quickly. + When it is high, transactions are written to L1 less frequently and the batcher spends less ETH. + If you want to reduce costs, either set this value to 0 to disable it or increase it to a higher value. +
## Start `op-proposer` @@ -727,29 +712,27 @@ If you want to reduce costs, either set this value to 0 to disable it or increas Now start `op-proposer`, which proposes new state roots. + {

Open up a new terminal

} -{

Open up a new terminal

} - -You'll need a terminal window to run the `op-proposer` in. - -{

Navigate to the op-proposer directory

} + You'll need a terminal window to run the `op-proposer` in. -```bash -cd ~/optimism/op-proposer -``` + {

Navigate to the op-proposer directory

} -{

Run op-proposer

} + ```bash + cd ~/optimism/op-proposer + ``` -```bash -./bin/op-proposer \ - --poll-interval=12s \ - --rpc.port=8560 \ - --rollup-rpc=http://localhost:9545 \ - --l2oo-address=$(cat ../packages/contracts-bedrock/deployments/getting-started/.deploy | jq -r .L2OutputOracleProxy) \ - --private-key=$GS_PROPOSER_PRIVATE_KEY \ - --l1-eth-rpc=$L1_RPC_URL -``` + {

Run op-proposer

} + ```bash + ./bin/op-proposer \ + --poll-interval=12s \ + --rpc.port=8560 \ + --rollup-rpc=http://localhost:9545 \ + --l2oo-address=$(cat ../packages/contracts-bedrock/deployments/getting-started/.deploy | jq -r .L2OutputOracleProxy) \ + --private-key=$GS_PROPOSER_PRIVATE_KEY \ + --l1-eth-rpc=$L1_RPC_URL + ```
## Connect your wallet to your chain @@ -764,25 +747,23 @@ Once you've connected your wallet, you'll probably notice that you don't have an The easiest way to deposit Sepolia ETH into your chain is to send ETH directly to the `L1StandardBridge` contract. + {

Navigate to the contracts-bedrock directory

} -{

Navigate to the contracts-bedrock directory

} - -```bash -cd ~/optimism/packages/contracts-bedrock -``` - -{

Get the address of the L1StandardBridgeProxy contract

} + ```bash + cd ~/optimism/packages/contracts-bedrock + ``` -```bash -cat deployments/getting-started/.deploy | jq -r .L1StandardBridgeProxy -``` + {

Get the address of the L1StandardBridgeProxy contract

} -{

Send some Sepolia ETH to the L1StandardBridgeProxy contract

} + ```bash + cat deployments/getting-started/.deploy | jq -r .L1StandardBridgeProxy + ``` -Grab the L1 bridge proxy contract address and, using the wallet that you want to have ETH on your Rollup, send that address a small amount of ETH on Sepolia (0.1 or less is fine). -This will trigger a deposit that will mint ETH into your wallet on L2. -It may take up to 5 minutes for that ETH to appear in your wallet on L2. + {

Send some Sepolia ETH to the L1StandardBridgeProxy contract

} + Grab the L1 bridge proxy contract address and, using the wallet that you want to have ETH on your Rollup, send that address a small amount of ETH on Sepolia (0.1 or less is fine). + This will trigger a deposit that will mint ETH into your wallet on L2. + It may take up to 5 minutes for that ETH to appear in your wallet on L2.
## See your rollup in action diff --git a/words.txt b/words.txt index e1b28a20a..1028fb35d 100644 --- a/words.txt +++ b/words.txt @@ -123,7 +123,6 @@ Farcaster Faultproof FDLIMIT fdlimit -featureset Flashblocks Flashbots forkable @@ -282,7 +281,6 @@ pprof Precommitments precommitments preconfigured -Preconfigured predeploy Predeployed predeployed @@ -378,7 +376,6 @@ Superchain superchain Superchain's Superchainerc -superchainerc Superchains Superscan Supersim @@ -411,7 +408,6 @@ unmetered Unprotect unsubmitted UPNP -usafe VERKLE verkle VHOSTS From be17ee2224ce02113d7b5a70ea2145264da4459f Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 31 Jan 2025 16:43:07 +0100 Subject: [PATCH 6/7] fix lint issues --- .../tutorials/create-l2-rollup.mdx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx index f6a0605e3..581e2f32a 100644 --- a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx +++ b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx @@ -124,13 +124,14 @@ Although this adds a few extra steps, it means you'll have an easier time modify git checkout tutorials/chain ``` - -The components in the `tutorials/chain` branch are outdated and may have compatibility issues with the latest L1 networks. -To ensure compatibility and stability, you will: -1. Download the latest releases of `op-node`, `op-batcher`, and `op-proposer` from the Optimism releases page -2. Use these latest versions to override the outdated components in the `tutorials/chain` branch -3. Maintain compatibility with current L1 network specifications - + + The components in the `tutorials/chain` branch are outdated and may have compatibility issues with the latest L1 networks.\ + To ensure compatibility and stability, you will: + + 1. Download the latest releases of `op-node`, `op-batcher`, and `op-proposer` from the Optimism releases page + 2. Use these latest versions to override the outdated components in the `tutorials/chain` branch + 3. Maintain compatibility with current L1 network specifications + {

Download the latest Optimism releases

} From 3ee141cfcc6f4a080058fb6c89603ce0aa14d85a Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 6 Feb 2025 16:33:48 +0100 Subject: [PATCH 7/7] updated the release instructions --- .../tutorials/create-l2-rollup.mdx | 167 ++++++++++-------- 1 file changed, 96 insertions(+), 71 deletions(-) diff --git a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx index 581e2f32a..186a93bc4 100644 --- a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx +++ b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx @@ -112,77 +112,102 @@ Although this adds a few extra steps, it means you'll have an easier time modify cd optimism ``` - {

Check out the correct branch

} - - - You will be using the `tutorials/chain` branch of the Optimism Monorepo to deploy an OP Stack testnet chain during this tutorial. - This is a non-production branch that lags behind the `develop` branch. - You should **NEVER** use the `develop` or `tutorials/chain` branches in production. - - - ```bash - git checkout tutorials/chain - ``` - - - The components in the `tutorials/chain` branch are outdated and may have compatibility issues with the latest L1 networks.\ - To ensure compatibility and stability, you will: - - 1. Download the latest releases of `op-node`, `op-batcher`, and `op-proposer` from the Optimism releases page - 2. Use these latest versions to override the outdated components in the `tutorials/chain` branch - 3. Maintain compatibility with current L1 network specifications - - - {

Download the latest Optimism releases

} - - 1. Visit the [Official Optimism releases page](https://github.com/ethereum-optimism/optimism/releases) - 2. Look for the latest stable release tagged as `vX.Y.Z` - 3. Download the following components for your operating system: - - * `op-node` - * `op-batcher` - * `op-proposer` - - {

Verify release integrity

} - - 1. Download the `checksums.txt` file from the release assets - 2. Verify file integrity using the appropriate command for your OS: - - ```bash - # On Linux - sha256sum -c checksums.txt - # On macOS - shasum -a 256 -c checksums.txt - # On Windows (PowerShell) - Get-FileHash | Format-List - ``` - - {

Download required binaries

} - - In the *Assets* section of the release, download these files for your operating system: - - * `op-node___.tar.gz` - * `op-batcher___.tar.gz` - * `op-proposer___.tar.gz` - - {

Extract binaries

} - - Using your system's archive tool: - - 1. Extract all `.tar.gz` files - 2. Override any outdated components in the `tutorials/chain` branch during extraction by moving these extracted files to a directory in your system `PATH`: - - * `op-node` - * `op-batcher` - * `op-proposer` - - {

Verify installation

} - - ```bash - op-node --version - op-batcher --version - op-proposer --version - ``` + {

Create and switch to tutorial branch

} + + ```bash + git checkout -b tutorial + ``` + + {

Create package.json

} + + Create a new file named `package.json` and add the following content: + + ```json + { + "name": "optimism", + "version": "1.0.0", + "author": "Optimism PBC", + "license": "MIT", + "private": true, + "engines": { + "node": ">=16", + "pnpm": ">=8" + }, + "scripts": { + "clean": "pnpm recursive run clean; rm -rf node_modules packages/*/node_modules && echo 'Finished cleaning. Run `pnpm install && pnpm build` from root of repo to rebuild the repo.'", + "bindings": "nx bindings @eth-optimism/contracts-bedrock", + "build": "npx nx run-many --target=build", + "test": "npx nx run-many --target=test", + "issues": "./ops/scripts/todo-checker.sh", + "install:ci": "pnpm install --ignore-scripts --frozen-lockfile && pnpm rebuild nx", + "install:ci:offline": "pnpm install --ignore-scripts --offline --frozen-lockfile && pnpm rebuild nx", + "lint": "npx nx run-many --target=lint", + "test:coverage": "npx nx run-many --target=test:coverage", + "lint:ts:check": "npx nx run-many --target=lint:ts:check", + "lint:check": "npx nx run-many --target=lint:check", + "lint:fix": "npx nx run-many --target=lint:fix", + "lint:specs:fix": "npx markdownlint-cli2-fix \"./specs/**/*.md\"", + "lint:specs:check": "npx markdownlint-cli2 \"./specs/**/*.md\"", + "lint:specs:toc": "npx doctoc '--title=**Table of Contents**' ./specs", + "preinstall": "npx only-allow pnpm", + "ready": "pnpm lint && pnpm test", + "prepare": "husky install", + "release": "npx nx run-many --target=build --skip-nx-cache && pnpm changeset publish", + "release:check": "changeset status --verbose --since=origin/main", + "release:publish": "pnpm install --frozen-lockfile && npx nx run-many --target=build && pnpm build && changeset publish", + "release:version": "changeset version && pnpm install --lockfile-only", + "install:foundry": "curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry", + "update:foundry": "bash ./ops/scripts/install-foundry.sh", + "install:abigen": "go install github.com/ethereum/go-ethereum/cmd/abigen@$(jq -r .abigen < versions.json)", + "print:abigen": "abigen --version | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' -e 's/ /./g' -e 's/^/v/'", + "check:abigen": "[[ $(pnpm -s print:abigen) = $(cat versions.json | jq -r '.abigen') ]] && echo '✓ abigen versions match' || (echo '✗ abigen version mismatch. Run `pnpm upgrade:abigen` to upgrade.' && exit 1)", + "upgrade:abigen": "jq '.abigen = $v' --arg v $(pnpm -s print:abigen) <<<$(cat versions.json) > versions.json", + "install:slither": "pip3 install slither-analyzer==$(jq -r .slither < versions.json)", + "print:slither": "slither --version", + "check:slither": "[[ $(pnpm -s print:slither) = $(jq -r .slither < versions.json) ]] && echo '✓ slither versions match' || (echo '✗ slither version mismatch. Run `pnpm upgrade:slither` to upgrade.' && exit 1)", + "upgrade:slither": "jq '.slither = $v' --arg v $(pnpm -s print:slither) <<<$(cat versions.json) > versions.json" + }, + "devDependencies": { + "@babel/eslint-parser": "^7.23.3", + "@changesets/changelog-github": "^0.4.8", + "@types/chai": "^4.3.11", + "@types/chai-as-promised": "^7.1.8", + "@types/mocha": "^10.0.6", + "@types/node": "^20.10.8", + "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/parser": "^6.17.0", + "chai": "^4.3.10", + "depcheck": "^1.4.7", + "doctoc": "^2.2.0", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-standard": "^16.0.3", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsdoc": "^35.1.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prefer-arrow": "^1.2.3", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-react": "^7.24.0", + "eslint-plugin-unicorn": "^49.0.0", + "husky": "^8.0.3", + "lint-staged": "15.2.0", + "markdownlint": "^0.33.0", + "markdownlint-cli2": "0.4.0", + "mocha": "^10.2.0", + "nx": "17.2.8", + "nyc": "^15.1.0", + "prettier": "^2.8.0", + "rimraf": "^5.0.5", + "ts-mocha": "^10.0.0", + "typescript": "^5.3.3", + "nx-cloud": "latest" + }, + "dependencies": { + "@changesets/cli": "^2.27.1" + } + } +``` {

Install dependencies

}