### Install mise and required tools Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/create-l2-rollup-example/README.md Use mise to manage tool versions automatically. Navigate to the example directory and run `mise install` to set up all necessary tools. ```bash curl https://mise.jdx.dev/install.sh | bash cd docs/create-l2-rollup-example mise install ``` -------------------------------- ### Run op-node with Quickstart Example Source: https://github.com/ethereum-optimism/optimism/blob/develop/op-node/README.md This command demonstrates how to run the op-node with essential configurations for a pre-configured network like op-sepolia. It includes settings for L1 RPC, L1 beacon API, L2 engine API, P2P listening ports, and RPC port, along with sync mode. ```bash just op-node # Network selection: # - Join any of the pre-configured networks with the `--network` flag. # - Alternatively, join a custom network with the `--rollup.config` flag. # # Essential Connections: # - L1 ethereum RPC, to fetch blocks, receipts, finality # - L1 beacon API, to fetch blobs # - L2 engine API, to apply new blocks to # - P2P TCP port, to expose publicly, to retrieve and relay the latest L2 blocks # - P2P UDP port, to expose publicly, to discover other nodes to peer with # - RPC port, to serve RPC of the op-node # # Other: # - Sync mode: how to interact with the execution-engine, # such that it enters the preferred form of syncing: # - consensus-layer (block by block sync) # - execution-layer (e.g. snap-sync) # # Tip: every CLI flag has an env-var equivalent (run `op-node --help` for more information) ./bin/op-node \ --network=op-sepolia \ --l1=ws://localhost:8546 \ --l1.beacon=http://localhost:4000 \ --l2=ws://localhost:9001 \ --p2p.listen.tcp=9222 \ --p2p.listen.udp=9222 \ --rpc.port=7000 \ --syncmode=execution-layer # If running inside docker, make sure to mount the below persistent data as (host) volume, # it may be lost on restart otherwise: # - P2P private key: auto-generated when missing, used to maintain a stable peer identity. # - Peerstore DB: remember peer records to connect with, used to not wait for peer discovery. # - Discovery DB: maintain DHT data, to avoid repeating some discovery work after restarting. --p2p.priv.path=opnode_p2p_priv.txt \ --p2p.peerstore.path=opnode_peerstore_db \ --p2p.discovery.path=opnode_discovery_db \ --p2p.priv.path=opnode_p2p_priv.txt ``` -------------------------------- ### Clone and Navigate to Project Directory Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/create-l2-rollup.mdx Clone the Optimism repository and navigate to the example directory for the automated setup. ```bash git clone https://github.com/ethereum-optimism/optimism.git cd optimism/docs/public-docs/create-l2-rollup-example ``` -------------------------------- ### Example Supersim Startup Logs Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/reference/tools/supersim/vanilla.mdx These logs show the available accounts, private keys, and orchestrator configuration for the L1 and L2 chains when `supersim` starts in vanilla mode. ```text Available Accounts ----------------------- (0): 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 (1): 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 (2): 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC (3): 0x90F79bf6EB2c4f870365E785982E1f101E93b906 (4): 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65 (5): 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc (6): 0x976EA74026E726554dB657fA54763abd0C3a0aa9 (7): 0x14dC79964da2C08b23698B3D3cc7Ca32193d9955 (8): 0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f (9): 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 Private Keys ----------------------- (0): 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 (1): 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d (2): 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a (3): 0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6 (4): 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a (5): 0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba (6): 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e (7): 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356 (8): 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 (9): 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 Orchestrator Config: L1: Name: L1 Chain ID: 900 RPC: http://127.0.0.1:8545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-900 L2: Name: OPChainA Chain ID: 901 RPC: http://127.0.0.1:9545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-901 Name: OPChainB Chain ID: 902 RPC: http://127.0.0.1:9546 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-902 ``` -------------------------------- ### Run Automated Setup Commands Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/create-l2-rollup.mdx Execute these commands to initialize, deploy contracts, generate configurations, and start all necessary services for the testnet. ```bash make init # Download op-deployer make setup # Deploy contracts and generate configs make up # Start all services make test-l1 # Verify L1 connectivity make test-l2 # Verify L2 functionality ``` -------------------------------- ### Proposer Initialization Log Example Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/op-proposer-setup.mdx Shows typical initialization log messages observed when the proposer service starts up. ```text lvl=info msg="Initializing L2Output Submitter" lvl=info msg="Connected to DisputeGameFactory" ``` -------------------------------- ### Install and Run op-reth Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/rust/index.mdx Install op-reth using cargo and start the execution client with the base chain. ```bash cargo install op-reth op-reth node --chain base ``` -------------------------------- ### Install Development Tools Source: https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/README.md Trust the Mise configuration and install the necessary tools for local development. Navigate to the contracts-bedrock directory and run the install command. ```bash mise trust mise.toml mise install cd packages/contracts-bedrock just install ``` -------------------------------- ### Install Optimism Solidity Libraries Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/tutorials/interoperability/message-passing.mdx Navigate to the 'lib' directory, install the Optimism contracts, and update remappings.txt. ```sh cd lib npm install @eth-optimism/contracts-bedrock cd .. echo @eth-optimism/=lib/node_modules/@eth-optimism/ >> remappings.txt ``` -------------------------------- ### Install Actions SDK with bun Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/quickstarts/actions.mdx Use this command to install the Actions SDK using bun. ```bash bun add @eth-optimism/actions-sdk ``` -------------------------------- ### Install Actions SDK with deno Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/quickstarts/actions.mdx Use this command to install the Actions SDK using deno. ```bash deno add @eth-optimism/actions-sdk ``` -------------------------------- ### Example Output Root Source: https://github.com/ethereum-optimism/optimism/blob/develop/op-chain-ops/cmd/check-output-root/README.md This is an example of the output root format generated by the tool. ```text 0xfefc68b1c0aa7f6e744a8c74084142cf3daa8692179fd5b9ff46c6eacdffe9aa ``` -------------------------------- ### Install and Run a Kona Node Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/rust/index.mdx Install the kona-node using cargo and start it with the base chain and port 8545. ```bash cargo install kona-node kona-node --chain base --port 8545 ``` -------------------------------- ### Quickstart op-proposer Configuration Source: https://github.com/ethereum-optimism/optimism/blob/develop/op-proposer/README.md Run the op-proposer service with essential RPC and contract addresses. Customize game factory and type as needed. ```bash go run ./op-proposer/cmd \ --l1-eth-rpc http://l1:8545 \ --rollup-rpc http://op-node:8545 \ --game-factory-address=changeme \ --game-type=changeme ``` -------------------------------- ### Start Supersim Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/tutorials/bridging/bridge-crosschain-eth.mdx Starts the Supersim local blockchain simulator with automatic relay enabled. Ensure Supersim is installed and executable. ```sh ./supersim --interop.autorelay ``` -------------------------------- ### Start Rollup-Boost and Call Health Endpoint Source: https://github.com/ethereum-optimism/optimism/blob/develop/rust/rollup-boost/RELEASE.md Starts the rollup-boost service using an example .env configuration and then calls its health endpoint. ```bash # Start rollup-boost with the example .env config cargo run --bin rollup-boost -- # Call the health endpoint curl localhost:8081/healthz ``` -------------------------------- ### Initialize Node Project and Install Dependencies Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/tutorials/interoperability/manual-relay.mdx Sets up a new Node.js project for manual relaying and installs necessary development dependencies like viem and @eth-optimism/viem. ```sh mkdir -p manual-relay/offchain cd manual-relay/offchain npm init -y npm install --save-dev viem @eth-optimism/viem mkdir src ``` -------------------------------- ### Example .env configuration Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/create-l2-rollup-example/README.md Configure L1 network details, your private key for deployment, and optionally P2P advertise IP and a custom L2 Chain ID. Ensure the private key is not committed to version control. ```bash # L1 Configuration (Sepolia testnet) # Option 1: Public endpoint (no API key required) L1_RPC_URL="https://ethereum-sepolia-rpc.publicnode.com" L1_BEACON_URL="https://ethereum-sepolia-beacon-api.publicnode.com" # Option 2: Private endpoint (requires API key) # L1_RPC_URL="https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY" # L1_BEACON_URL="https://ethereum-sepolia-beacon-api.publicnode.com" # Private key for deployment and operations # IMPORTANT: Never commit this to version control PRIVATE_KEY="YOUR_PRIVATE_KEY_WITHOUT_0x_PREFIX" # Optional: Public IP for P2P networking (defaults to 127.0.0.1 for local testing) P2P_ADVERTISE_IP="127.0.0.1" # Optional: Custom L2 Chain ID (default: 16584) L2_CHAIN_ID="16584" ``` -------------------------------- ### Example op-supernode Configuration Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/node-operators/guides/configuration/supernode.mdx A minimum viable configuration for an op-supernode acting as a verifier across multiple chains. This example uses environment variables for setup. ```yaml OP_SUPERNODE_CHAINS: "11155420,1301" # OP Sepolia + Unichain Sepolia OP_SUPERNODE_DATA_DIR: /var/lib/op-supernode # default is ./datadir # Shared L1 access OP_SUPERNODE_L1_ETH_RPC: OP_SUPERNODE_L1_BEACON: OP_SUPERNODE_L1_BEACON_FALLBACKS: # Shared JWT secret for every virtual node's engine connection OP_SUPERNODE_VN_ALL_L2_ENGINE_AUTH: /etc/op/jwt-secret.txt # Per-chain: chain identity and engine RPC OP_SUPERNODE_VN_11155420_NETWORK: op-sepolia OP_SUPERNODE_VN_11155420_L2_ENGINE_RPC: OP_SUPERNODE_VN_1301_NETWORK: unichain-sepolia OP_SUPERNODE_VN_1301_L2_ENGINE_RPC: # Top-level JSON-RPC server (per-chain namespaces under //) OP_SUPERNODE_RPC_ADDR: 0.0.0.0 OP_SUPERNODE_RPC_PORT: "8545" # Observability OP_SUPERNODE_LOG_LEVEL: info OP_SUPERNODE_METRICS_ENABLED: "true" OP_SUPERNODE_METRICS_ADDR: 0.0.0.0 OP_SUPERNODE_METRICS_PORT: "7300" ``` -------------------------------- ### Build OP Deployer from Source Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tools/op-deployer/installation.mdx Install OP Deployer from source by cloning the repository, navigating to the directory, building the binary, and copying it to your PATH. Requires Go, just, and git. ```shell git clone git@github.com:ethereum-optimism/optimism.git # you can skip this if you already have the repo cd optimism/op-deployer just build cp ./bin/op-deployer /usr/local/bin/op-deployer # or any other directory in your $PATH ``` -------------------------------- ### Create OP-Challenger Startup Script Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/guides/configuration/op-challenger-config-guide.mdx This script initializes the OP-Challenger with various configuration parameters sourced from a .env file. Ensure all necessary environment variables are set before execution. ```bash #!/bin/bash source .env # Path to the challenger binary ../optimism/op-challenger/bin/op-challenger \ --trace-type permissioned,cannon-kona \ --l1-eth-rpc=$L1_RPC_URL \ --l2-eth-rpc=$L2_RPC_URL \ --l1-beacon=$L1_BEACON \ --rollup-rpc=$ROLLUP_RPC_URL \ --game-factory-address $GAME_FACTORY_ADDRESS \ --datadir=$DATADIR \ --cannon-bin=$CANNON_BIN \ --cannon-kona-rollup-config=$CANNON_ROLLUP_CONFIG \ --cannon-kona-l2-genesis=$CANNON_L2_GENESIS \ --cannon-kona-server=$CANNON_KONA_SERVER \ --cannon-kona-prestate=$CANNON_KONA_PRESTATE \ --mnemonic "$MNEMONIC" \ --hd-path "$HD_PATH" ``` -------------------------------- ### Quick Start Commands for L2 Rollup Setup Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/code-setup.mdx Use these bash commands to copy and configure environment variables, then initialize, deploy, and start the L2 Rollup services. ```bash # Copy and configure environment cp .example.env .env # Edit .env with your values # Run the automated setup make init # Download tools make setup # Deploy and configure make up # Start services ``` -------------------------------- ### Initialize Database with Custom Configuration File Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/rust/op-reth/cli/op-reth/init.mdx Initializes the database using a specified configuration file. ```bash op-reth init --config /path/to/config.toml ``` -------------------------------- ### Run Rollup Boost with Regular Sequencer Setup Source: https://github.com/ethereum-optimism/optimism/blob/develop/rust/rollup-boost/docs/running-rollup-boost.md Use this command to start the rollup-boost binary, specifying the L2 RPC endpoint and the builder RPC endpoint. Ensure these URLs are correctly configured for your setup. ```bash cargo run --bin rollup-boost -- --l2-url http://localhost:8551 --builder-url http://localhost:8546 ``` -------------------------------- ### Build op-faucet from Source Source: https://github.com/ethereum-optimism/optimism/blob/develop/op-faucet/README.md Build the op-faucet binary from source using the provided 'just' command. The help command shows available options. ```bash # from op-faucet dir: just op-faucet ./bin/op-faucet --help ``` -------------------------------- ### Deploy and start OP Stack services Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/create-l2-rollup-example/README.md Use make commands to initialize op-deployer, deploy contracts, configure services, and start all components. Verify the deployment status and service health afterwards. ```bash make init make setup make up make status make test-l1 make test-l2 ``` -------------------------------- ### Clone Reth Repository Source: https://github.com/ethereum-optimism/optimism/blob/develop/rust/op-reth/README.md Clone the Reth repository to get started with the project. This is the first step for building and testing. ```sh git clone https://github.com/paradigmxyz/reth cd reth ``` -------------------------------- ### Initialize Database from Genesis File Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/rust/op-reth/cli/op-reth.mdx Sets up the node's database using a provided genesis file. This is typically done once at the beginning of a new node setup. ```bash init ``` -------------------------------- ### Start OP Stack Devnet with Rollup Boost using Kurtosis Source: https://github.com/ethereum-optimism/optimism/blob/develop/rust/rollup-boost/book/src/operators/local.md This command starts a local development network including the sequencer, builder, Rollup Boost, L1 devnet, and other essential components. Requires 'just' and 'kurtosis-cli' to be installed. ```bash just devnet-up ``` -------------------------------- ### Run All Acceptance Tests (Quick Start) Source: https://github.com/ethereum-optimism/optimism/blob/develop/op-acceptance-tests/README.md Navigate to the `op-acceptance-tests` directory and run `just` to execute all acceptance tests. ```bash cd op-acceptance-tests just ``` -------------------------------- ### Set up directory structure and copy files Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/op-geth-setup.mdx Create a 'scripts' directory and copy the genesis.json and rollup.json files from the deployer's configuration into the current sequencer directory. ```bash mkdir scripts cp ../deployer/.deployer/genesis.json . cp ../deployer/.deployer/rollup.json . ``` -------------------------------- ### Start Rollup Boost Devnet Source: https://github.com/ethereum-optimism/optimism/blob/develop/rust/rollup-boost/README.md Initiates the Rollup Boost development network using the 'just' and 'kurtosis-cli' tools. Ensure these prerequisites are installed before running. ```bash just kurtosis-devnet-up ``` -------------------------------- ### Set up Proposer Environment Variables Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/op-proposer-setup.mdx Create a .env file and populate it with your actual configuration values for L1 and L2 RPC URLs, contract addresses, private key, and proposer-specific settings. Ensure all placeholder values are replaced. ```bash # Create .env file with your actual values # L1 Configuration - Replace with your actual RPC URL L1_RPC_URL=https://sepolia.infura.io/v3/YOUR_ACTUAL_INFURA_KEY # L2 Configuration - Should match your sequencer setup L2_RPC_URL=http://localhost:8545 ROLLUP_RPC_URL=http://localhost:8547 # Contract addresses - Extract from your op-deployer output GAME_FACTORY_ADDRESS=YOUR_ACTUAL_GAME_FACTORY_ADDRESS # Private key - Replace with your actual private key PRIVATE_KEY=YOUR_ACTUAL_PRIVATE_KEY # Proposer configuration PROPOSAL_INTERVAL=3600s GAME_TYPE=0 POLL_INTERVAL=20s # RPC configuration PROPOSER_RPC_PORT=8560 ``` -------------------------------- ### Start rollup-boost with Flashblocks Source: https://github.com/ethereum-optimism/optimism/blob/develop/rust/rollup-boost/docs/flashblocks.md Launches the rollup-boost service with Flashblocks enabled using default configuration. Ensure JWT tokens and URLs match your setup. ```bash cargo run --bin rollup-boost -- \ --l2-url http://localhost:5555 \ --builder-url http://localhost:4445 \ --l2-jwt-token 688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a \ --builder-jwt-token 688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a \ --rpc-port 4444 \ --flashblocks \ --log-level info ``` -------------------------------- ### Example Tutorial Step Style Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/STYLE_GUIDE.md Illustrates the recommended parallel style for tutorial steps, using imperative verbs. ```text * Step 1: **Create** Your Site * Step 2: **Choose** Your Framework * Step 3: **Visit** the Dev Environment ``` -------------------------------- ### Get Transaction by Hash using curl Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/node-operators/reference/op-geth-json-rpc.mdx Use this method to retrieve detailed information about a transaction using its hash. This example demonstrates the request using curl. ```sh curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],"id":1}' http://localhost:8545 ``` -------------------------------- ### Get Latest Block Number using curl Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/node-operators/reference/op-geth-json-rpc.mdx Use this method to retrieve the number of the most recent block on the chain. This example demonstrates the request using curl. ```sh curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:8545 ``` -------------------------------- ### Op-Challenger Configuration Example Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/guides/configuration/op-challenger-config-guide.mdx Example command-line arguments for configuring op-challenger, including the Cannon server, prestate file, and game factory address. Ensure the correct version of kona-client is used. ```bash --cannon-kona-server ./kona \ # version of kona-client deployed on chain # if you use the wrong one, you will lose the game # if you deploy your own contracts, you specify the hash, the root of the json file # OP Mainnet uses tagged versions of kona-client # build with: just reproducible-prestate-kona # challenger verifies that onchain --cannon-kona-prestate ./prestate.json \ # load the game factory address from system config or superchain registry # point the game factory address at the dispute game factory proxy --game-factory-address ``` -------------------------------- ### Execute OP-Challenger Startup Script Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/guides/configuration/op-challenger-config-guide.mdx These commands navigate to the challenger-node directory, make the startup script executable, and then run it to start the OP-Challenger process. This is the standard procedure for launching the challenger. ```bash # Make sure you're in the challenger-node directory cd challenger-node # Make script executable chmod +x scripts/start-challenger.sh # Start challenger ./scripts/start-challenger.sh ``` -------------------------------- ### Get Account Balance using curl Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/node-operators/reference/op-geth-json-rpc.mdx Use this method to retrieve the balance of a specific account. This example shows how to query the balance for a given address using curl. ```sh curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","latest"],"id":1}' http://localhost:8545 ``` -------------------------------- ### Make Script Executable and Start Challenger Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/op-challenger-setup.mdx These commands prepare the startup script for execution and then launch the OP-Challenger. Ensure you are in the correct directory before running. ```bash # Make sure you're in the rollup/challenger directory cd rollup/challenger # Make script executable chmod +x scripts/start-challenger.sh # Start challenger ./scripts/start-challenger.sh ``` -------------------------------- ### Get Transaction by Hash using cast Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/node-operators/reference/op-geth-json-rpc.mdx Use this method to retrieve detailed information about a transaction using its hash. This example demonstrates the request using the cast CLI tool. ```sh cast tx 0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b --rpc-url http://localhost:8545 ``` -------------------------------- ### Get Latest Block Number using cast Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/node-operators/reference/op-geth-json-rpc.mdx Use this method to retrieve the number of the most recent block on the chain. This example demonstrates the request using the cast CLI tool. ```sh cast block-number --rpc-url http://localhost:8545 ``` -------------------------------- ### Build and Install op-deployer from Source Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/op-deployer-setup.mdx Steps to clone the optimism monorepo, navigate to the op-deployer directory, build the binary using 'just', and copy it to your system's PATH. Includes installation verification. ```bash git clone https://github.com/ethereum-optimism/optimism.git # you can skip this if you already have the repo cd optimism/op-deployer just build cp ./bin/op-deployer /usr/local/bin/op-deployer # or any other directory in your $PATH # Verify installation op-deployer --version ``` -------------------------------- ### Configure L1 RPC URL for Testing Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/op-deployer-setup.mdx Example configurations for setting the L1_RPC_URL environment variable, showing how to use Sepolia testnet with Infura or Alchemy, and a local network setup. ```bash # Examples: # Sepolia (recommended for testing) L1_RPC_URL=https://sepolia.infura.io/v3/YOUR-PROJECT-ID # or https://eth-sepolia.g.alchemy.com/v2/YOUR-API-KEY # Local network L1_RPC_URL=http://localhost:8545 ``` -------------------------------- ### Example op-proposer Configuration Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/guides/configuration/proposer.mdx This is an example configuration for the op-proposer, showing various environment variables and their typical values. Ensure you replace placeholder values with your actual RPC URLs and addresses. ```shell OP_PROPOSER_L1_ETH_RPC: YOUR_L1_RPC_URL_HERE OP_PROPOSER_ROLLUP_RPC: YOUR_CHAINS_RPC_URL_HERE OP_PROPOSER_GAME_FACTORY_ADDRESS: YOUR_CHAINS_GAME_FACTORY_ADDRESS_HERE OP_PROPOSER_PROPOSAL_INTERVAL: 5h OP_PROPOSER_WAIT_NODE_SYNC: true OP_PROPOSER_ALLOW_NON_FINALIZED: "false" OP_PROPOSER_POLL_INTERVAL: "20s" OP_PROPOSER_NUM_CONFIRMATIONS: "1" OP_PROPOSER_SAFE_ABORT_NONCE_TOO_LOW_COUNT: "3" OP_PROPOSER_RESUBMISSION_TIMEOUT: "30s" OP_PROPOSER_METRICS_ENABLED: "true" OP_PROPOSER_METRICS_ADDR: 0.0.0.0 OP_PROPOSER_METRICS_PORT: 7300 ``` -------------------------------- ### Configure Privy Embedded Wallet for Actions Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/quickstarts/actions.mdx Fetch a Privy embedded wallet and convert it to an Actions wallet for on-chain operations. Ensure Privy is set up according to their installation guide. ```typescript import { actions } from './config' import { useWallets } from '@privy-io/react-auth' // PRIVY: Fetch wallet const { wallets } = useWallets() const embeddedWallet = wallets.find( (wallet) => wallet.walletClientType === 'privy', ) // ACTIONS: Let wallet make onchain Actions const wallet = await actions.wallet.toActionsWallet({ connectedWallet: embeddedWallet, }) ``` -------------------------------- ### Submit a Signed Transaction Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/node-operators/reference/op-reth-json-rpc.mdx Submits a signed transaction to the network. The example payload is intentionally invalid to demonstrate the error shape. Use a valid signed transaction to get a transaction hash. ```sh curl -X POST -H "Content-Type: application/json" --data \ '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],"id":1}' \ http://localhost:8545 ``` -------------------------------- ### Get Account Balance using cast Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/node-operators/reference/op-geth-json-rpc.mdx Use this method to retrieve the balance of a specific account. This example shows how to query the balance for a given address using the cast CLI tool. ```sh cast balance 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb --rpc-url http://localhost:8545 ``` -------------------------------- ### Configure Privy Smart Wallet Signer Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/quickstarts/actions.mdx Create a signer for a Privy smart wallet. This allows the smart wallet to perform actions. Ensure Privy is set up according to their installation guide. ```typescript import { actions } from './config' import { useWallets } from '@privy-io/react-auth' // PRIVY: Fetch wallet const { wallets } = useWallets() const embeddedWallet = wallets.find( (wallet) => wallet.walletClientType === 'privy', ) // ACTIONS: Create signer from hosted wallet const signer = await actions.wallet.createSigner({ connectedWallet: embeddedWallet, }) // ACTIONS: Create smart wallet const { wallet } = await actions.wallet.createSmartWallet({ signer: signer }) ``` -------------------------------- ### Make Script Executable and Start Proposer Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/create-l2-rollup/op-proposer-setup.mdx These commands make the proposer startup script executable and then run it to start the proposer service. ```bash # Make the script executable chmod +x scripts/start-proposer.sh # Start the proposer ./scripts/start-proposer.sh ``` -------------------------------- ### Get Super Root at Timestamp Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tutorials/upgrade-chain-to-super-roots.mdx Use `cast` and `jq` to retrieve the current finalized timestamp from the supernode and then query the super root at that timestamp. This is essential for generating the starting anchor super root. ```bash # .finalized_timestamp is a JSON number (decimal unix seconds). TS=$(cast rpc supernode_syncStatus --rpc-url $SUPERNODE_RPC | jq -r '.finalized_timestamp') # superroot_atTimestamp expects a hex-encoded JSON string (hexutil.Uint64); cast 2h handles the conversion. cast rpc superroot_atTimestamp "$(cast 2h $TS)" --rpc-url $SUPERNODE_RPC | jq -r '.data.super_root' echo "timestamp=$TS" ``` -------------------------------- ### Start the Proposer Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/guides/management/operations.mdx Start the `op-proposer` service with specified configuration parameters. Ensure you replace placeholders like the L2 Output Oracle address and private key with your actual values. ```shell ./bin/op-proposer \ --poll-interval=12s \ --rpc.port=8560 \ --rollup-rpc=http://localhost:8547 \ --l2oo-address=0xYourL2OutputOracleAddress \ --private-key=$PROPOSER_PRIVATE_KEY \ --l1-eth-rpc=$L1_RPC_URL ``` -------------------------------- ### Display op-reth init Help Information Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/rust/op-reth/cli/op-reth/init.mdx Use this command to display the help information for the op-reth init command, showing available options and their descriptions. ```bash $ op-reth init --help ``` -------------------------------- ### Setup for Manual Relay Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/tutorials/interoperability/manual-relay.mdx This script installs smart contracts and prepares a shell script for manual message relaying between chains. It also outputs environment variables for contract addresses and private keys. ```sh #! /bin/sh # full shell script preserved here... # (Greeter.sol, GreetingSender.sol, sendAndRelay.sh setup) # ... ``` ```sh GREETER_A_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3 GREETER_B_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3 PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 ``` -------------------------------- ### Example Supersim Fork Mode Startup Logs Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/app-developers/reference/tools/supersim/fork.mdx These logs show the available accounts, private keys, and orchestrator configuration for L1 and L2 chains when Supersim starts in fork mode. Note the RPC endpoints and log paths for each chain. ```text Available Accounts ----------------------- (0): 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --- truncated for brevity --- Private Keys ----------------------- (0): 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --- truncated for brevity --- Orchestrator Config: L1: Name: mainnet Chain ID: 1 RPC: http://127.0.0.1:8545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-1-1521250718 L2: Name: op Chain ID: 10 RPC: http://127.0.0.1:9545 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-10 Name: base Chain ID: 8453 RPC: http://127.0.0.1:9546 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-8453 Name: zora Chain ID: 7777777 RPC: http://127.0.0.1:9547 LogPath: /var/folders/0w/ethers-phoenix/T/anvil-chain-7777777 ``` -------------------------------- ### Example `intent.toml` Configuration Source: https://github.com/ethereum-optimism/optimism/blob/develop/docs/public-docs/chain-operators/tools/op-deployer/usage/init.mdx This is an example of the `intent.toml` file generated by `op-deployer init`. Ensure all zero-value addresses are updated with appropriate values for your chain, especially for production environments using multisigs and HSMs. ```toml configType = "standard" l1ChainID = 11155420 fundDevAccounts = false useInterop = false l1ContractsLocator = "tag://op-contracts/v1.8.0-rc.4" l2ContractsLocator = "tag://op-contracts/v1.7.0-beta.1+l2-contracts" [superchainRoles] proxyAdminOwner = "0xeAAA3fd0358F476c86C26AE77B7b89a069730570" guardian = "0xeAAA3fd0358F476c86C26AE77B7b89a069730570" [[chains]] id = "0x0000000000000000000000000000000000000000000000000000000000002390" baseFeeVaultRecipient = "0x0000000000000000000000000000000000000000" l1FeeVaultRecipient = "0x0000000000000000000000000000000000000000" sequencerFeeVaultRecipient = "0x0000000000000000000000000000000000000000" operatorFeeVaultRecipient = "0x0000000000000000000000000000000000000000" eip1559DenominatorCanyon = 250 eip1559Denominator = 50 eip1559Elasticity = 6 [chains.roles] l1ProxyAdminOwner = "0x0000000000000000000000000000000000000000" l2ProxyAdminOwner = "0x0000000000000000000000000000000000000000" systemConfigOwner = "0x0000000000000000000000000000000000000000" unsafeBlockSigner = "0x0000000000000000000000000000000000000000" batcher = "0x0000000000000000000000000000000000000000" proposer = "0x0000000000000000000000000000000000000000" challenger = "0x0000000000000000000000000000000000000000" ``` -------------------------------- ### Install cargo-release Source: https://github.com/ethereum-optimism/optimism/blob/develop/rust/kona/RELEASES.md Installs the cargo-release tool using the cargo install command. Ensure you have cargo installed first. ```bash $ cargo install cargo-release ```