Optimism 백서

Optimism

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 58쪽

tag/op-supernode%2Fv0.2.2-rc.8) release candidate and the procedure may evolve before the stable release. For background on what op-supernode is and why it exists, see the [supernode explainer](/op-stack/interop/supernode). </Info> This guide stands up a single op-supernode process from scratch: build the binary, wire each chain's execution client over the engine API, start the process, and verify that every chain in the dependency set is syncing. At the end, one op-supernode acts as the consensus layer for every chain it hosts, replacing a separate op-node per chain. This page covers getting to a running, verified process. For recommended production settings (beacon archiver fallbacks, execution-client retention, Light CL fleets, and HA pools), continue with the [supernode configuration guide](/node-operators/guides/configuration/supernode). Every flag used below is catalogued in the [op-supernode configuration reference](/node-operators/reference/op-supernode-config). ## Before you start You need: * **One execution client per chain.** Each chain in the dependency set needs its own execution client with the engine API (authrpc) enabled; one execution client cannot back two chains. See the [execution client configuration guide](/node-operators/guides/configuration/execution-clients) for client options, and the [run a node from source tutorial](/node-operators/tutorials/run-node-from-source) for a full execution-client walkthrough. * **L1 endpoints.** An L1 JSON-RPC endpoint with the `eth` namespace enabled and an L1 beacon-node HTTP endpoint, shared by every chain. A beacon archiver fallback is strongly recommended; see [configuring a blob archiver](/node-operators/guides/management/blobs#configuring-a-blob-archiver). * **The chain IDs of every chain the supernode will host.** For chains in op-node's built-in network registry (for example `op-sepolia`, `unichain-sepolia`), the network name is enough. For any other chain, you need a rollup configuration JSON file per chain. ## Build op-supernode The binary is built from the Optimism Monorepo. The build environment is managed through [mise](https://mise.jdx.dev/), which installs the toolchains needed to build the monorepo; see [`mise.toml`](https://github.com/ethereum-optimism/optimism/blob/develop/mise.toml) at the monorepo root. <Steps> <Step title="Clone the monorepo and check out the release tag"> ```bash theme={null} git clone https://github.com/ethereum-optimism/optimism.git cd optimism git checkout op-supernode/v0.2.2-rc.8 ``` </Step> <Step title="Build the binary"> ```bash theme={null} cd op-supernode just op-supernode ``` The binary is written to `op-supernode/bin/op-supernode`. </Step> <Step title="Confirm the build"> ```bash theme={null} ./bin/op-supernode --version ``` <Info> The flag set is generated dynamically from the `--chains` list, so to inspect the full help output for your chains, run `./bin/op-supernode --chains=<chainIDs> --help`. </Info> </Step> </Steps> ## Create the JWT secret and wire the engine API Each chain's virtual node authenticates to that chain's execution client over the engine API using a shared JWT secret. <Steps> <Step title="Generate the secret"> ```bash theme={null} openssl rand -hex 32 > jwt-secret.txt ``` </Step> <Step title="Start each execution client with the secret"> Start every chain's execution client with its authrpc listening and pointed at the same secret file; for op-reth, `--authrpc.jwtsecret=<path>`. Start the execution clients before the supernode; they simply won't receive blocks until the supernode connects. </Step> <Step title="Note the engine-API endpoint of each execution client"> You will pass each chain's engine-API endpoint (port `8551` by convention) to the supernode as `--vn.<chainID>.l2` in the next section. The supernode side of the secret is a single `--vn.all.l2.jwt-secret=<path>` flag when every execution client shares one secret; use the per-chain `--vn.<chainID>.l2.jwt-secret` form only when a client needs its own. </Step> </Steps> ## Start op-supernode Start the supernode with the list of chain IDs, the shared L1 endpoints, and each chain's network identity and engine-API endpoint. The example below hosts OP Sepolia (chain ID `11155420`) and Unichain Sepolia (chain ID `1301`) with op-reth execution clients. Fill in the placeholders, and add or remove the per-chain `--vn.<chainID>.*` groups to match your dependency set. ```bash theme={null} ./bin/op-supernode \ --chains=11155420,1301 \ --data-dir=/var/lib/op-supernode \ --l1=<your-l1-eth-rpc> \ --l1.beacon=<your-l1-beacon-rpc> \ --l1.beacon-fallbacks=<your-l1-beacon-archiver-rpc> \ --vn.all.l2.jwt-secret=./jwt-secret.txt \ --vn.11155420.network=op-sepolia \ --vn.11155420.l2=http://op-sepolia-el:8551 \ --vn.11155420.l2.enginekind=reth \ --vn.1301.network=unichain-sepolia \ --vn.1301.l2=http://unichain-sepolia-el:8551 \ --vn.1301.l2.enginekind=reth \ --metrics.enabled=true ``` A few notes on the flags: * For a chain that is not in op-node's built-in network registry, replace `--vn.<chainID>.network` with `--vn.<chainID>.rollup.config=<path-to-rollup-config.json>`. * The `--vn.<chainID>.l2.enginekind=reth` lines tell the supernode the execution client is op-reth; the default is `geth`, so drop them if you run op-geth. * P2P is enabled by default, with each virtual node's listen port chosen dynamically to avoid collisions. Set `--disable-p2p=true` when other nodes in your topology handle unsafe-head gossip; see [pair op-supernode with a Light CL fleet](/node-operators/guides/configuration/supernode#pair-op-supernode-with-a-light-cl-fleet). * The JSON-RPC server listens on `0.0.0.0:8545` by default (`--rpc.addr` / `--rpc.port`). Like the op-node RPC, it is not meant to be exposed to the public internet. * Every flag has an environment-variable equivalent (`OP_SUPERNODE_*`). The [configuration guide's example configuration](/node-operators/guides/configuration/supernode#example-configuration) shows the same kind of setup in environment-variable form, and the [configuration reference](/node-operators/reference/op-supernode-config) lists the exact name for every flag. ## Verify the supernode is working <Steps> <Step title="Watch the logs"> The heartbeat activity logs a `heartbeat` message every 10 seconds as a basic sign that the process is alive and its activities are running. </Step> <Step title="Check liveness over RPC"> The `heartbeat_check` method at the RPC root returns a random hex value as a sign of life: ```bash theme={null} curl -X POST -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","method":"heartbeat_check","params":[],"id":1}' \ http://localhost:8545/ ``` </Step> <Step title="Check aggregate sync status"> The `supernode_syncStatus` method at the RPC root returns the per-chain op-node sync status for every hosted chain, plus dependency-set-wide fields: the chain IDs, the highest fully derived and verified L1 block, and the safe, local-safe, and finalized L2 timestamps across the set. ```bash theme={null} curl -X POST -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","method":"supernode_syncStatus","params":[],"id":1}' \ http://localhost:8545/ ``` Confirm that every chain ID you configured appears in the response and that the reported heads advance between calls. </Step> <Step title="Check an individual chain"> Each chain's full op-node RPC surface is mounted under a `/<chainID>/` path prefix on the same server, so any [op-node JSON-RPC method](/node-operators/reference/op-node-json-rpc#optimism_syncstatus) works per chain: ```bash theme={null} curl -X POST -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","method":"optimism_syncStatus","params":[],"id":1}' \ http://localhost:8545/11155420/ ``` A chain's endpoint becomes available once its chain container has started; requests to a chain ID that is not configured return `404 Not Found`. </Step> <Step title="Check metrics"> With `--metrics.enabled=true`, every chain's metrics are fanned into a single Prometheus endpoint at `/metrics` on the metrics port (default `7300`), labeled per chain: ```bash theme={null} curl http://localhost:7300/metrics ``` </Step> </Steps> ## Next steps * Harden the deployment with the [supernode configuration guide](/node-operators/guides/configuration/supernode): beacon archiver fallbacks, execution-client retention for backfill, Light CL fleets, and HA pools behind a consensus-aware proxyd. * Look up any flag in the [op-supernode configuration reference](/node-operators/reference/op-supernode-config). * Read the [supernode explainer](/op-stack/interop/supernode) for what op-supernode is and why it exists. * Read the [interop prep notice](/notices/interop-prep) for the node-operator action checklist for the OP Sepolia and Unichain Sepolia activation. # Running an archive node Source: https://docs.optimism.io/node-operators/guides/management/archive-node Learn how to configure and run an archive node. This guide shows you how to configure your node to run as an archive node. Archive nodes store the complete history of the blockchain, including all historical states. ## Overview Archive nodes maintain the entire state history of the blockchain, allowing you to query any historical state at any block height. This is useful for: * Block explorers that need to provide historical data * Analytics and data analysis applications * Services that need to query historical state * Debugging and auditing purposes Archive nodes use execution-layer sync but configure the execution client to retain all historical state data instead of pruning it. <Info> Historical proofs are a lighter-weight alternative to a full archive node when you only need cryptographic state proofs (`eth_getProof`) at historical blocks — the typical case is withdrawal proving and fault proof workloads. If you need historical execution (`eth_call`, `debug_trace*`) or arbitrary historical state queries, you still need a full archive node. See the [historical proofs config](/node-operators/reference/op-reth-historical-proof-config). </Info> ## Requirements * **OP Mainnet**: Requires the [bedrock datadir](/node-operators/guides/management/snapshots) * **Other OP Stack networks**: No datadir required * **Storage**: Archive nodes require significantly more disk space than regular nodes (several terabytes for OP Mainnet) * **Sync time**: Archive sync with execution-layer mode is faster than full block-by-block execution ## Configuration Each section below shows the full set of flags needed on both `op-node` and your chosen execution client to run as an archive node. The `op-node` flag `--syncmode=execution-layer` is required in all cases and is not the default — it must be explicitly configured. ### op-reth op-reth retains complete state when run without pruning flags, so the standard op-node + op-reth configuration already produces an archive node. Set on `op-node`: ```shell theme={null} --syncmode=execution-layer ``` Do not pass any `--prune.*` flags to op-reth for a complete archive node. If you don't need complete history and want to reclaim disk, see [Pruning op-reth](#pruning-op-reth) below. ### Nethermind Set on `op-node`: ```shell theme={null} --syncmode=execution-layer ``` Enable archive mode on Nethermind using the archive network configuration: ```shell theme={null} --config op-mainnet_archive ``` <Info> Replace `op-mainnet_archive` with the appropriate archive configuration for your network (e.g., `op-sepolia_archive` for OP Sepolia). </Info> ### op-geth <Warning> **op-geth has reached end-of-support (2026-05-31) and does not support the now-active Karst hardfork, so op-geth nodes can no longer follow the canonical chain.** Migrate to op-reth, the primary supported execution client. See the [op-geth deprecation notice](/notices/archive/op-geth-deprecation) for the full migration plan. </Warning> Set on `op-node`: ```shell theme={null} --syncmode=execution-layer ``` Set on `op-geth`: ```shell theme={null} --syncmode=full --gcmode=archive ``` <Info> Both flags are not the default settings and must be explicitly configured. The `--syncmode=full` flag ensures every block is executed, and `--gcmode=archive` disables state pruning. </Info> ## Pruning op-reth If you don't need a complete archive node, you can prune op-reth to reclaim disk. The recommended approach prunes state and receipts while keeping every block body. ### Recommended: prune state and receipts, keep block bodies Prune the state and receipt segments and leave block bodies fully intact. Set the same depth on each: ```shell theme={null} --prune.minimum-distance=<depth> --prune.receipts.distance=<depth> --prune.account-history.distance=<depth> --prune.storage-history.distance=<depth> ``` Recommended `<depth>` (in blocks), matching production: * **`22000`** for sequencer-side nodes — covers the 12h sequencing window (≈ 21,600 blocks at a 2s block time). * **`1296000`** (\~30 days at 2s) for nodes that need more history. ### Pruning block bodies (unsupported) op-node's safe derivation reads the L1-info deposit transaction — the first transaction of every block — from the block body at the head placed [`--syncmode.offset-el-safe`](/node-operators/reference/op-node-config#syncmode-offset-el-safe) behind the tip, and possibly further if restoring a safedb. If that body has been pruned, EL sync fails with `l2 block is missing L1 info deposit tx`. Body pruning is therefore **not supported, and we advise against it** — you run it at your own risk, with no guarantees. It can be made to work if you know what you're doing, subject to one hard requirement: the retained body window must always cover the `--syncmode.offset-el-safe` range. Concretely, set [`--prune.bodies.distance`](/node-operators/op-reth/cli/op-reth/node) (in blocks) comfortably **greater than** the offset converted to blocks (the default `12h` ≈ 21,600 at a 2s block time), with margin for the block-time and offset you actually run. And if you restore a safedb, you also have to take the maximum distance to its head into account. op-reth rejects `--minimal` at startup: it prunes bodies to a fixed 10,064-block window, which is smaller than the default offset and cannot be widened independently. <Warning> Body pruning is unsupported. If you enable it anyway, `--prune.bodies.distance` must always exceed `--syncmode.offset-el-safe` (in blocks), and additionally the distance to a restoring safedb's head, or execution-layer sync fails with `l2 block is missing L1 info deposit tx`. Prefer pruning only the state and receipt segments above. </Warning> ## How archive sync works With execution-layer sync mode enabled: 1. **Initial sync**: The node downloads block headers and data through the P2P network 2. **Block execution**: The node executes every block in the chain to build the complete state history 3. **State retention**: Unlike regular nodes, archive nodes never prune historical state data 4. **Faster than legacy**: While still executing all blocks, this is faster than the legacy consensus-layer sync because block data is retrieved via P2P instead of being derived from L1 ## Storage considerations Archive nodes require substantial storage: * **OP Mainnet**: Several terabytes and growing * **Other networks**: Varies by network age and activity * **Growth rate**: Storage requirements increase continuously as new blocks are added * **Recommendation**: Use fast SSD storage for optimal performance ## Next steps * See the [sync modes reference](/node-operators/reference/consensus-layer-sync) for non-archive node sync configuration * See the [Consensus Client Configuration](/node-operators/guides/configuration/consensus-clients) and [Execution Client Configuration](/node-operators/guides/configuration/execution-clients) guides for additional explanation or customization * See the [Snapshots guide](/node-operators/guides/management/snapshots) for information about downloading the bedrock datadir * If you experience difficulty at any stage of this process, please reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions) # Fetch blob data for your node Source: https://docs.optimism.io/node-operators/guides/management/blobs Configure op-node to fetch L1 batcher blob data, including blobs older than the beacon retention window. OP Stack rollups post batch data to L1 as [EIP-4844 blobs](https://eips.ethereum.org/EIPS/eip-4844). To retrieve this data, `op-node` requires access to an L1 beacon endpoint. Run your own beacon node ([Lighthouse](https://lighthouse-book.sigmaprime.io/run_a_node.html), Lodestar, Nimbus, Prysm, or Teku) or use a third-party service like [QuickNode](https://www.quicknode.com/docs/ethereum/eth-v1-beacon-genesis). Pass the beacon endpoint to op-node: ```shell theme={null} --l1.beacon value ($OP_NODE_L1_BEACON) HTTP endpoint Address of L1 Beacon-node. ``` ## Configuring a blob archiver Standard beacon nodes prune blobs after 18 days. If your node is synced within the last 18 days and stays online, the default beacon endpoint is sufficient. You need a blob archiver if either of these is true: * You're syncing a new node from a snapshot or genesis older than 18 days * Your node has been offline for more than 18 days Pass one or more fallback endpoints to op-node: ```shell theme={null} --l1.beacon-fallbacks value ($OP_NODE_L1_BEACON_FALLBACKS) Addresses of L1 Beacon-API compatible HTTP fallback endpoints. Used to fetch blob sidecars not available at the l1.beacon (e.g. expired blobs). ``` <Info> `--l1.beacon-fallbacks` was previously called `--l1.beacon-archiver`. The old name still works as an alias, and so does the legacy env var `$OP_NODE_L1_BEACON_ARCHIVER`. </Info> Choose one of these options for the archiver endpoint: * **Option 1 — Run a beacon node with blob pruning disabled.** For Lighthouse, set `--prune-blobs=false` and point `--l1.beacon-fallbacks` at it. * **Option 2 — Run a dedicated blob archiver service** such as [base-org/blob-archiver](https://github.com/base-org/blob-archiver), and point `--l1.beacon-fallbacks` at its API endpoint. Lighter weight than running a full no-prune beacon node. * **Option 3 — Use a third-party blob-archiver service.** Useful if you don't want to operate any beacon infrastructure. # Restore a Node From a Snapshot Source: https://docs.optimism.io/node-operators/guides/management/restore-from-snapshot Download, verify, and extract a snapshot into your node's data directory to skip the initial sync. This guide walks you through bootstrapping an OP Stack execution client from a pre-synced snapshot: download it, verify the checksum, extract it into your data directory, and start the node from the snapshot's tip instead of replaying the chain from genesis. For **what** snapshots are available for OP Mainnet and their download links, see the [Snapshots reference page](/op-mainnet/network-information/snapshots). ## When to use a snapshot <Warning> **op-geth has reached end-of-support (2026-05-31) and does not support the now-active Karst hardfork, so op-geth nodes can no longer follow the canonical chain.** Migrate to op-reth, the primary supported execution client. See the [op-geth deprecation notice](/notices/archive/op-geth-deprecation) for the full migration plan. </Warning> This guide assumes an `op-reth` node. You don't always need one. With [execution-layer sync](/node-operators/reference/consensus-layer-sync) — `--syncmode=execution-layer` and `--l2.enginekind=reth` on `op-node` — `op-reth` retrieves blocks over the P2P network instead of deriving each one, which makes the initial sync much faster and, on most OP Stack chains, needs no snapshot at all. [Nethermind](https://docs.nethermind.io/get-started/running-node/l2-networks#op-stack) downloads what it needs automatical
프로젝트로 돌아가기