From dbafe4bc9fd096f557e4418d866c23ea18f0b4c2 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 27 Mar 2025 03:58:42 +0100 Subject: [PATCH 1/3] Fixed local devnet tutorial --- pages/app-developers/building-apps.mdx | 2 +- .../tutorials/chain-dev-net.mdx | 49 ++-- pages/stack/dev-net.mdx | 240 ------------------ public/_redirects | 3 +- 4 files changed, 35 insertions(+), 259 deletions(-) delete mode 100644 pages/stack/dev-net.mdx diff --git a/pages/app-developers/building-apps.mdx b/pages/app-developers/building-apps.mdx index 3d176bc3a..d1411f58e 100644 --- a/pages/app-developers/building-apps.mdx +++ b/pages/app-developers/building-apps.mdx @@ -61,7 +61,7 @@ Not only is it faster, but such EVMs often have extra features, such as the [abi ### Debug before deploying -After you are done with that development, debug your decentralized application using either a [development network](/stack/dev-net) or a [Sepolia test network](/superchain/networks). +After you are done with that development, debug your decentralized application using either a [development network](/chain-operators/tutorials/chain-dev-net) or a [Sepolia test network](/superchain/networks). This lets you debug parts that are OP Stack chains specific such as calls to bridges to transfer ETH or tokens between layers. Only when you have a version that works well on a test network should you deploy to the production network, where every transaction has a cost. diff --git a/pages/operators/chain-operators/tutorials/chain-dev-net.mdx b/pages/operators/chain-operators/tutorials/chain-dev-net.mdx index 9d75d3513..69a0fa891 100644 --- a/pages/operators/chain-operators/tutorials/chain-dev-net.mdx +++ b/pages/operators/chain-operators/tutorials/chain-dev-net.mdx @@ -144,9 +144,6 @@ af4abdbbe939 op-el-1-op-geth-op-node-rollup-1 engine-rpc: 8551 aa69f73e96c1 vc-1-geth-lighthouse metrics: 8080/tcp -> http://127.0.0.1:33642 RUNNING ``` -Also take note of the last log line above this message, which contains the address of the standard bridge. You'll -need this address to deposit funds on your L2. - This might look complicated, but it's just a list of the services that were started up by Kurtosis. For each service, you can see: @@ -164,30 +161,48 @@ your wallet to any other EVM chain. You can find your node's RPC URL by running Your enclave name is outputted at the end of the `kurtosis run` command above. The RPC url is the `rpc` port name in any of the execution client services identified by `op-el`. -### Depositing funds onto your network +### Using pre-funded accounts on L2 + + + Important: The setup script automatically pre-funds accounts on the L2 chain directly. You don't need to bridge funds from L1 to L2 to get started. + -Your network was configured to pre-fund development addresses using the `test test test test test test test test test test test junk` -mnemonic. To get ETH onto your L2, you import one of the private keys from that mnemonic into your favorite wallet or use +Your network is configured to pre-fund development addresses on L2 using the `test test test test test test test test test test test junk` +mnemonic. You can import one of the private keys from that mnemonic into your favorite wallet or use a CLI tool like `cast`. For the purposes of this tutorial, we'll use `cast` and assume you want to use the first address generated by that mnemonic. -To move ETH onto your L2, run the following command. Make sure to replace the values in angle brackets with real values: +First, check your L2 balance to confirm you have funds: ```bash -cast send --mnemonic 'test test test test test test test test test test test junk' --mnemonic-path "m/44'/60'/0'/0/0" \ - --to "" --amount "eth" --rpc-url "http://127.0.0.1:" +# Find your L2 node's RPC port +# Look for a service starting with "op-el" (like op-el-1-op-geth-op-node-rollup-1) and note its RPC port +# For example: rpc: 8545/tcp -> http://127.0.0.1:33643 + +# Check your balance on L2 +export ADDRESS="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" # First address from the test mnemonic +export L2_RPC_URL="http://127.0.0.1:" # Replace with your actual L2 RPC port +cast balance "$ADDRESS" --rpc-url "$L2_RPC_URL" ``` -Wait \~30 seconds, then check your balance on L2 by running the following command: +You should see that this account already has ETH on L2. + +### Interacting with your L2 + +Now that you've confirmed you have funds on L2, you can start using them to interact with your rollup: ```bash -export ETH_RPC_URL="http://127.0.0.1:" -export ADDRESS="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" -cast balance "$ADDRESS" +# Example: Sending a transaction on L2 +cast send --mnemonic 'test test test test test test test test test test test junk' \ + \ + --value 0.01ether --rpc-url "$L2_RPC_URL" + +# Example: Deploying a contract on L2 (if you have Foundry installed) +# forge create --rpc-url "$L2_RPC_URL" \ +# --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ +# ``` -Your balance should match the amount you sent. - ## See Your Rollup in Action You can interact with your Rollup the same way you'd interact with any other EVM chain. @@ -196,5 +211,5 @@ Send some transactions, deploy some contracts, and see what happens! ## Next Steps * Check out the [protocol specs](https://specs.optimism.io/) for more detail about the rollup protocol. -* If you run into any problems, please visit the [Chain Operators Troubleshooting Guide](/operators/chain-operators/management/troubleshooting) - or [file an issue](https://github.com/ethereum-optimism/optimism/issues) for help. +* If you run into any problems, please visit the [chain operators troubleshooting guide](/operators/chain-operators/management/troubleshooting) +* If you run into any problems, please [file an issue](https://github.com/ethereum-optimism/optimism/issues) or join the [Optimism Discord](https://discord.optimism.io/) for help. \ No newline at end of file diff --git a/pages/stack/dev-net.mdx b/pages/stack/dev-net.mdx deleted file mode 100644 index 0fe3e4f2d..000000000 --- a/pages/stack/dev-net.mdx +++ /dev/null @@ -1,240 +0,0 @@ ---- -title: Running a local development environment -description: This tutorial walks you through spinning up an OP Stack devnet chain. -lang: en-US -content_type: guide -topic: running-a-local-development-environment -personas: - - protocol-developer - - chain-operator - - app-developer -categories: - - testnet - - protocol - - local-development-environment - - chain-deployment - - kurtosis - - docker -is_imported_content: 'false' ---- - -import {Callout, Steps} from 'nextra/components' -import {WipCallout} from '@/components/WipCallout' - -# Running a local development environment - - - This guide is currently under active development. If you run into any issues, please open an issue on - [Github](https://github.com/ethereum-optimism/optimism). - - -This tutorial is **designed for developers** who want to learn about the OP Stack by spinning up a local OP Stack devnet. -You'll perform the full deployment process, and **you'll end up with your very own OP Stack devnet**. - -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](/operators/chain-operators/deploy/overview). - -You can use this devnet 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. - - -## Installing Dependencies - -| Dependency | Version | Version Check Command | -| ------------------------------------------------- | -------- | --------------------- | -| [docker](https://docs.docker.com/engine/install/) | `^27` | `docker --version` | -| [kurtosis](https://docs.kurtosis.com/install/) | `^1.3.0` | `kurtosis version` | -| [cast](https://book.getfoundry.sh/cast/) | `^1.0.0` | `cast --version` | - -### Notes on Specific Dependencies - -#### `docker` - -We recommend using the latest version of Docker on Linux, or [OrbStack](https://orbstack.dev/) (a drop-in replacement -for Docker Desktop) on OSX. - -#### `kurtosis` - -Kurtosis is a tool for packaging and deploying containerized services. It's used in this tutorial to automatically deploy -your devnet in an isolated environment. - -## Configure your network - -Now that you've installed all the necessary dependencies, you can start configuring your network. The Kurtosis package -accepts a YAML file which configures how many network participants there are, what kind of software they're running, and -the network's topology. An example YAML file is below: - -```yaml -optimism_package: - chains: # you can define multiple L2s, which will be deployed against the same L1 as a single Superchain - - participants: # each participant is a node in the network. here we've defined two, one running op-geth and one running op-reth - - el_type: op-geth # this node will be the sequencer since it's first in the list - - el_type: op-reth - network_params: - name: rollup-1 # can be anything as long as it is unique - network_id: 12345 # can be anything as long as it is unique -ethereum_package: - - participants: - - el_type: geth - cl_type: teku -``` - -## Start your network - -Now that you've configured your network, you can start it up using the Kurtosis CLI. Run the command below: - -```bash -kurtosis run github.com/ethpandaops/optimism-package \ - --args-file https://raw.githubusercontent.com/ethpandaops/optimism-package/main/network_params.yaml \ - --enclave op-devnet -``` - -This command will start up your network and deploy the OP Stack based on the ethpandaops configuration. The command will -produce a lot of output and will take about five minutes to complete. Once it's done, you'll see a message that looks like -the one below: - -``` -INFO[2025-02-25T02:10:37Z] ===================================================== -INFO[2025-02-25T02:10:37Z] || Created enclave: op-devnet || -INFO[2025-02-25T02:10:37Z] ===================================================== -Name: op-devnet -UUID: eb959a72177b -Status: RUNNING -Creation Time: Tue, 25 Feb 2025 02:07:56 UTC -Flags: - -========================================= Files Artifacts ========================================= -UUID Name -14b79c110784 1-teku-geth-0-63 -80829197fe1c dashboards-0 -80e45cc0080f divine-butterfly -ddae8880a93f el_cl_genesis_data -271d9f5d46ec final-genesis-timestamp -df11dac8789a genesis-el-cl-env-file -ca839becbe40 genesis_validators_root -40da51373335 grafana-config -cb782c178dfd jwt_file -0fcd752154b6 keymanager_file -e724c1671e85 op-deployer-configs -e880f062cd24 op-deployer-fund-script -bb31dbb7e788 op_jwt_file -d8d4758b14c8 prometheus-config -3eafd3a35757 prysm-password -0fb6d6f67d26 validator-ranges - -========================================== User Services ========================================== -UUID Name Ports Status -976820378d51 cl-1-teku-geth http: 4000/tcp -> http://127.0.0.1:32802 RUNNING - metrics: 8008/tcp -> http://127.0.0.1:32803 - tcp-discovery: 9000/tcp -> 127.0.0.1:32804 - udp-discovery: 9000/udp -> 127.0.0.1:32775 -12ee5b7e5a18 el-1-geth-teku engine-rpc: 8551/tcp -> 127.0.0.1:32799 RUNNING - metrics: 9001/tcp -> http://127.0.0.1:32800 - rpc: 8545/tcp -> 127.0.0.1:32797 - tcp-discovery: 30303/tcp -> 127.0.0.1:32801 - udp-discovery: 30303/udp -> 127.0.0.1:32774 - ws: 8546/tcp -> 127.0.0.1:32798 -e3e534981b75 grafana http: 3000/tcp -> http://127.0.0.1:32821 RUNNING -aa9a19bf1413 op-batcher-rollup-1 http: 8548/tcp -> http://127.0.0.1:32815 RUNNING - metrics: 9001/tcp -> 127.0.0.1:32816 -d63d3aeaa06b op-challenger-rollup-1 metrics: 9001/tcp -> 127.0.0.1:32819 RUNNING -632c061ac1b7 op-cl-1-op-node-op-geth-rollup-1 http: 8547/tcp -> http://127.0.0.1:32812 RUNNING - metrics: 9001/tcp -> 127.0.0.1:32813 - tcp-discovery: 9003/tcp -> 127.0.0.1:32814 - udp-discovery: 9003/udp -> 127.0.0.1:32777 -0e0d1e6c2269 op-el-1-op-geth-op-node-rollup-1 engine-rpc: 8551/tcp RUNNING - metrics: 9001/tcp - rpc: 8545/tcp - tcp-discovery: 30303/tcp - udp-discovery: 30303/udp - ws: 8546/tcp -544b3f952009 op-proposer-rollup-1 http: 8560/tcp -> http://127.0.0.1:32817 RUNNING - metrics: 9001/tcp -> 127.0.0.1:32818 -5b8cc317a573 prometheus http: 9090/tcp -> http://127.0.0.1:32820 RUNNING -61ba4bff3ab8 validator-key-generation-cl-validator-keystore RUNNING -``` - -Also take note of the last log line above this message, which contains the address of the standard bridge. You'll -need this address to deposit funds on your L2. - -This might look complicated, but it's just a list of the services that were started up by Kurtosis. For each service, you -can see: - -* The enclave name, which identifies the services you just deployed within Kurtosis. The enclave is an isolated environment - that runs your devnet. -* The service's name, which you can use with the Kurtosis CLI to view its logs and interact with it. -* The service's ports and addresses, which you can use to connect to the service. - -At this point your chain is up and running. Let's move on to the next section to learn how to interact with it. - -## Interact with your network - -You now have a fully functioning OP Stack Rollup. You can connect your wallet to this chain the same way you'd connect -your wallet to any other EVM chain. You can find your node's RPC URL by running `kurtosis enclave inspect op-devnet`. -The RPC url is the `rpc` port name in any of the execution client services identified by `op-el`. - -### Depositing funds onto your network - -Your network was configured to pre-fund development addresses, you can find the full list of available pre-fund accounts from -[here](https://github.com/ethpandaops/ethereum-package/blob/main/src/prelaunch_data_generator/genesis_constants/genesis_constants.star). -To get ETH onto your L2, you import one of the private keys from that list into your favorite wallet or use a CLI tool like `cast`. -For the purposes of this tutorial, we'll use `cast` and assume you want to use the first address [0x8943545177806ED17B9F23F0a21ee5948eCaa776](https://github.com/ethpandaops/ethereum-package/blob/v4.0.0/src/prelaunch_data_generator/genesis_constants/genesis_constants.star#L10-L14). - -To move ETH onto your L2, run the following command. Make sure to replace the values in angle brackets with real values: - -```bash -cast send "" --private-key bcdf20249abf0ed6d944c0288fad489e33f66b3960d9e6229c1cd214ed3bbe31 \ - --value "ether" --rpc-url "http://127.0.0.1:" -``` - -The output should look like below: - - -``` -blockHash 0xf6c18d85ba89b4b1e6060ddf744d8d9084dbb3720e2a2a854627a1b1b7a294ba -blockNumber 388 -contractAddress -cumulativeGasUsed 21000 -effectiveGasPrice 1000000007 -from 0x8943545177806ED17B9F23F0a21ee5948eCaa776 -gasUsed 21000 -logs [] -logsBloom 0x000000000000000000000000000000000... # truncated -root -status 1 (success) -transactionHash 0x268f98f883efe9c8f9ecc7542a9c8af51869118cfce06e775683f5b4aec2681d -transactionIndex 0 -type 2 -blobGasPrice -blobGasUsed -authorizationList -to -``` - - -Wait \~30 seconds, then check your balance on L2 by running the following command: - -```bash -export ETH_RPC_URL="http://127.0.0.1:" -export ADDRESS="0x8943545177806ED17B9F23F0a21ee5948eCaa776" -cast balance "$ADDRESS" -``` - -Your balance should match the amount you sent. - -## See Your Rollup in Action - -You can interact with your Rollup the same way you'd interact with any other EVM chain. -Send some transactions, deploy some contracts, and see what happens! - -## Next Steps - -* Check out the [protocol specs](https://specs.optimism.io/) for more detail about the rollup protocol. -* If you run into any problems, please visit the [Chain Operators Troubleshooting Guide](/operators/chain-operators/management/troubleshooting) - or [file an issue](https://github.com/ethereum-optimism/optimism/issues) for help. diff --git a/public/_redirects b/public/_redirects index 1282ed6e0..bfd9a31b8 100644 --- a/public/_redirects +++ b/public/_redirects @@ -78,7 +78,8 @@ /builders/node-operators/network-upgrades/* /operators/node-operators/network-upgrades /builders/node-operators/* /operators/node-operators/:splat /operators/node-operators/tutorials/mainnet /operators/node-operators/tutorials/run-node-from-source -/operators/node-operators/tutorials/testnet /operators/node-operators/tutorials/run-node-from-source +/operators/node-operators/tutorials/testnet /operators/node-operators/tutorials/run-node-from-source +/stack/dev-net /chain-operators/tutorials/chain-dev-net # ---------------------------------------------------------------------------- # Stack Documentation Migration From c803045847c71fc628a17304c2121153fce7247c Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 27 Mar 2025 04:05:58 +0100 Subject: [PATCH 2/3] updated path --- pages/app-developers/building-apps.mdx | 2 +- pages/operators/chain-operators/tutorials/chain-dev-net.mdx | 2 +- words.txt | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pages/app-developers/building-apps.mdx b/pages/app-developers/building-apps.mdx index d1411f58e..568de13d0 100644 --- a/pages/app-developers/building-apps.mdx +++ b/pages/app-developers/building-apps.mdx @@ -61,7 +61,7 @@ Not only is it faster, but such EVMs often have extra features, such as the [abi ### Debug before deploying -After you are done with that development, debug your decentralized application using either a [development network](/chain-operators/tutorials/chain-dev-net) or a [Sepolia test network](/superchain/networks). +After you are done with that development, debug your decentralized application using either a [development network](/operators/chain-operators/tutorials/chain-dev-net) or a [Sepolia test network](/superchain/networks). This lets you debug parts that are OP Stack chains specific such as calls to bridges to transfer ETH or tokens between layers. Only when you have a version that works well on a test network should you deploy to the production network, where every transaction has a cost. diff --git a/pages/operators/chain-operators/tutorials/chain-dev-net.mdx b/pages/operators/chain-operators/tutorials/chain-dev-net.mdx index 69a0fa891..b0efe955b 100644 --- a/pages/operators/chain-operators/tutorials/chain-dev-net.mdx +++ b/pages/operators/chain-operators/tutorials/chain-dev-net.mdx @@ -212,4 +212,4 @@ Send some transactions, deploy some contracts, and see what happens! * Check out the [protocol specs](https://specs.optimism.io/) for more detail about the rollup protocol. * If you run into any problems, please visit the [chain operators troubleshooting guide](/operators/chain-operators/management/troubleshooting) -* If you run into any problems, please [file an issue](https://github.com/ethereum-optimism/optimism/issues) or join the [Optimism Discord](https://discord.optimism.io/) for help. \ No newline at end of file +* If you run into any problems, please [file an issue](https://github.com/ethereum-optimism/optimism/issues) or join the [Optimism Discord](https://discord.optimism.io/) for help. diff --git a/words.txt b/words.txt index f4ad72386..33db5dc56 100644 --- a/words.txt +++ b/words.txt @@ -115,7 +115,6 @@ ETHERBASE etherbase Ethernity Ethernow -ethpandaops ETHSTATS ethstats EVMTIMEOUT @@ -264,7 +263,6 @@ offchain opchaina opchainb OPCM -opcm Openfort oplabs opnode's From fd62d0666ec4b6df53255d157dd9053e05fef75a Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 27 Mar 2025 05:24:53 +0100 Subject: [PATCH 3/3] added callout for kurtosis web --- .../operators/chain-operators/tutorials/chain-dev-net.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pages/operators/chain-operators/tutorials/chain-dev-net.mdx b/pages/operators/chain-operators/tutorials/chain-dev-net.mdx index b0efe955b..ea6f01cf9 100644 --- a/pages/operators/chain-operators/tutorials/chain-dev-net.mdx +++ b/pages/operators/chain-operators/tutorials/chain-dev-net.mdx @@ -154,6 +154,14 @@ can see: At this point your chain is up and running. Let's move on to the next section to learn how to interact with it. + + You can also use the Kurtosis Web UI to monitor and interact with your services by running: + ```bash + kurtosis web + ``` + This will open a browser window with a dashboard showing all your running enclaves and services. + + ## Interact with your network You now have a fully functioning OP Stack Rollup. You can connect your wallet to this chain the same way you'd connect