bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 59쪽
ly.
Use a snapshot when:
* You are running an **archive node**, or otherwise need to trace the entire chain.
* You simply want to skip the initial sync entirely: a mature chain's data directory can run to hundreds of gigabytes (OP Mainnet is roughly 700 GB for a full node), and even execution-layer sync takes days from scratch.
<Note>
On **OP Mainnet**, syncing `op-reth` on a fresh data directory is another reason to use a snapshot: it satisfies the [pre-Bedrock state import requirement](/node-operators/op-reth/run/faq/sync-op-mainnet) in one step, even when execution-layer sync is enabled.
</Note>
## Before you begin
* **Disk space**: you temporarily need room for both the compressed archive and the extracted data directory, so plan for roughly twice the snapshot size during the restore, on fast (NVMe-class) storage.
* **Tools**: `curl` (or [aria2](https://aria2.github.io/), which can significantly speed up large downloads), `zstd`, and `tar`.
* **A stopped client**: never extract into a data directory an execution client is actively using.
## Restore the snapshot
<Steps>
<Step title="Pick a snapshot">
Pick a recent snapshot matching your network and client from your chain's snapshot provider. For OP Mainnet, browse the OP Labs managed [Data Directories website](https://datadirs.optimism.io/); the [Snapshots reference page](/op-mainnet/network-information/snapshots) lists the available sources, including third-party providers.
</Step>
<Step title="Download and verify it">
Download the archive and check its SHA256 against the value published on the index page:
```bash theme={null}
curl -fLO <snapshot-url>/<snapshot-file>.tar.zst
sha256sum <snapshot-file>.tar.zst # Linux
shasum -a 256 <snapshot-file>.tar.zst # macOS
```
Don't skip verification — a truncated multi-hundred-gigabyte download is easy to miss and produces a corrupt database.
</Step>
<Step title="Stop your node and clear the old datadir">
If the node has run before and you want to start clean from the snapshot, stop the execution client and remove (or move aside) the contents of its data directory.
</Step>
<Step title="Extract into the data directory">
Inspect the archive layout first, then extract it into your client's data directory:
```bash theme={null}
tar -tf <snapshot-file>.tar.zst | head -3
mkdir -p <datadir>
tar -I zstd -xvf <snapshot-file>.tar.zst -C <datadir> --strip-components=1
```
`--strip-components=1` removes the top-level wrapping directory inside the tarball. If the inspection shows files already at the archive root, omit it. Use the same path your client is configured with (the `--datadir` flag for `op-reth`).
</Step>
<Step title="Start the node and confirm it picked up the snapshot">
Start the execution client pointed at the restored data directory, then confirm the node reports the snapshot's block height — not `0` — as its latest block:
```bash theme={null}
curl -s -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
http://localhost:8545
```
The node then syncs from the snapshot's tip to the current head, which takes minutes to hours depending on the snapshot's age. Once caught up, you can delete the downloaded `.tar.zst` archive to reclaim disk space.
</Step>
</Steps>
## Next steps
* Running with Docker? The [node-from-docker tutorial](/node-operators/tutorials/node-from-docker#bootstrap-from-a-snapshot) shows this flow with a bind-mounted `op-reth` data directory.
* See the [Snapshots reference page](/op-mainnet/network-information/snapshots) for all OP Mainnet download links, including the legacy (pre-Bedrock) data directory for archive nodes.
* If you run into problems, check the [node troubleshooting guide](/node-operators/guides/troubleshooting) or reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions).
# Node Metrics and Monitoring
Source: https://docs.optimism.io/node-operators/guides/monitoring/metrics
Learn about the different metrics you can use to monitor the health of your node.
The Optimism `op-node` exposes a variety of metrics to help observe the health of the system and debug issues. Metrics are formatted for use with Prometheus and exposed via a metrics endpoint. The default metrics endpoint is `http://localhost:7300/metrics`.
To enable metrics, pass the `--metrics.enabled` flag to the `op-node`. You can customize the metrics port and address via the `--metrics.port` and `--metrics.addr` flags, respectively.
## Important metrics
To monitor the health of your node, you should monitor the following metrics:
* `op_node_default_refs_number`: This metric represents the `op-node`'s current L1/L2 reference block number for different sync types. If it stops increasing, it means that the node is not syncing. If it goes backwards, it means your node is reorging.
* `op_node_default_peer_count`: This metric represents how many peers the `op-node` is connected to. Without peers, the `op-node` cannot sync unsafe blocks and your node will lag behind the sequencer as it will fall back to syncing purely from L1.
* `op_node_default_rpc_client_request_duration_seconds`: This metric measures the latency of RPC requests initiated by the `op-node`. This metric is important when debugging sync performance, as it will reveal which specific RPC calls are slowing down sync. This metric exposes one timeseries per RPC method. The most important RPC methods to monitor are:
* `engine_forkChoiceUpdatedV1`, `engine_getPayloadV1`, and `engine_newPayloadV1`: These methods are used to execute blocks on `op-geth`. If these methods are slow, it means that sync time is bottlenecked by either `op-geth` itself or your connection to it.
* `eth_getBlockByHash`, `eth_getTransactionReceipt`, and `eth_getBlockByNumber`: These methods are used by the `op-node` to fetch transaction data from L1. If these methods are slow, it means that sync time is bottlenecked by your L1 RPC.
## Available metrics
A complete list of available metrics is below:
| METRIC | DESCRIPTION | LABELS | TYPE |
| - | - | - | - |
| op\_node\_default\_info | Pseudo-metric tracking version and config info | version | gauge |
| op\_node\_default\_up | 1 if the op node has finished starting up | | gauge |
| op\_node\_default\_rpc\_client\_requests\_total | Total RPC requests initiated by the opnode's RPC client | method | counter |
| op\_node\_default\_rpc\_client\_request\_duration\_seconds | Histogram of RPC client request durations | method | histogram |
| op\_node\_default\_rpc\_client\_responses\_total | Total RPC request responses received by the opnode's RPC client | method,error | counter |
| op\_node\_default\_l1\_source\_cache\_size | L1 Source cache size | type | gauge |
| op\_node\_default\_l1\_source\_cache\_get | L1 Source cache lookups, hitting or not | type,hit | counter |
| op\_node\_default\_l1\_source\_cache\_add | L1 Source cache additions, evicting previous values or not | type,evicted | counter |
| op\_node\_default\_l2\_source\_cache\_size | L2 Source cache size | type | gauge |
| op\_node\_default\_l2\_source\_cache\_get | L2 Source cache lookups, hitting or not | type,hit | counter |
| op\_node\_default\_l2\_source\_cache\_add | L2 Source cache additions, evicting previous values or not | type,evicted | counter |
| op\_node\_default\_derivation\_idle | 1 if the derivation pipeline is idle | | gauge |
| op\_node\_default\_pipeline\_resets\_total | Count of derivation pipeline resets events | | counter |
| op\_node\_default\_last\_pipeline\_resets\_unix | Timestamp of last derivation pipeline resets event | | gauge |
| op\_node\_default\_unsafe\_payloads\_total | Count of unsafe payloads events | | counter |
| op\_node\_default\_last\_unsafe\_payloads\_unix | Timestamp of last unsafe payloads event | | gauge |
| op\_node\_default\_derivation\_errors\_total | Count of derivation errors events | | counter |
| op\_node\_default\_last\_derivation\_errors\_unix | Timestamp of last derivation errors event | | gauge |
| op\_node\_default\_sequencing\_errors\_total | Count of sequencing errors events | | counter |
| op\_node\_default\_last\_sequencing\_errors\_unix | Timestamp of last sequencing errors event | | gauge |
| op\_node\_default\_publishing\_errors\_total | Count of p2p publishing errors events | | counter |
| op\_node\_default\_last\_publishing\_errors\_unix | Timestamp of last p2p publishing errors event | | gauge |
| op\_node\_default\_unsafe\_payloads\_buffer\_len | Number of buffered L2 unsafe payloads | | gauge |
| op\_node\_default\_unsafe\_payloads\_buffer\_mem\_size | Total estimated memory size of buffered L2 unsafe payloads | | gauge |
| op\_node\_default\_refs\_number | Gauge representing the different L1/L2 reference block numbers | layer,type | gauge |
| op\_node\_default\_refs\_time | Gauge representing the different L1/L2 reference block timestamps | layer,type | gauge |
| op\_node\_default\_refs\_hash | Gauge representing the different L1/L2 reference block hashes truncated to float values | layer,type | gauge |
| op\_node\_default\_refs\_seqnr | Gauge representing the different L2 reference sequence numbers | type | gauge |
| op\_node\_default\_refs\_latency | Gauge representing the different L1/L2 reference block timestamps minus current time, in seconds | layer,type | gauge |
| op\_node\_default\_l1\_reorg\_depth | Histogram of L1 Reorg Depths | | histogram |
| op\_node\_default\_transactions\_sequenced\_total | Count of total transactions sequenced | | gauge |
| op\_node\_default\_p2p\_peer\_count | Count of currently connected p2p peers | | gauge |
| op\_node\_default\_p2p\_stream\_count | Count of currently connected p2p streams | | gauge |
| op\_node\_default\_p2p\_gossip\_events\_total | Count of gossip events by type | type | counter |
| op\_node\_default\_p2p\_bandwidth\_bytes\_total | P2P bandwidth by direction | direction | gauge |
| op\_node\_default\_sequencer\_building\_diff\_seconds | Histogram of Sequencer building time, minus block time | | histogram |
| op\_node\_default\_sequencer\_building\_diff\_total | Number of sequencer block building jobs | | counter |
| op\_node\_default\_sequencer\_sealing\_seconds | Histogram of Sequencer block sealing time | | histogram |
| op\_node\_default\_sequencer\_sealing\_total | Number of sequencer block sealing jobs | | counter |
# Node Troubleshooting
Source: https://docs.optimism.io/node-operators/guides/troubleshooting
Learn solutions to common problems to troubleshoot your node.
This page lists common troubleshooting scenarios and solutions for node operators.
## 401 Unauthorized: Signature Invalid
If you see a log that looks like this in `op-node`:
```
WARN [12-13|15:53:20.263] Derivation process temporary error attempts=80 err="stage 0 failed resetting: temp: failed to find the L2 Heads to start from: failed to fetch current L2 forkchoice state: failed to find the finalized L2 block: failed to determine L2BlockRef of finalized, could not get payload: 401 Unauthorized: signature is invalid
```
It means that the `op-node` is unable to authenticate with `execution client`'s authenticated RPC using the JWT secret.
### Solution
1. Check that the JWT secret is correct in both services.
2. Check that `execution client`'s authenticated RPC is enabled, and that the URL is correct.
## Failed to Load P2P Config
If you see a log that looks like this in `op-node`:
```
CRIT [12-13|13:46:21.386] Application failed message="failed to load p2p config: failed to load p2p discovery options: failed to open discovery db: mkdir /p2p: permission denied"
```
It means that the `op-node` lacks write access to the P2P discovery or peerstore directories.
### Solution
1. Make sure that the `op-node` has write access to the P2P directory. By default, this is `/p2p`.
2. Set the P2P directory to somewhere the `op-node` can access via the `--p2p.discovery.path` and `--p2p.peerstore.path` parameters.
3. Set the discovery path to `memory` to disable persistence via the `--p2p.discovery.path` and `--p2p.peerstore.path` parameters.
## Wrong Chain
If you see a log that looks like this in `op-node`:
```
{"attempts":183,"err":"stage 0 failed resetting: temp: failed to find the L2 Heads to start from: wrong chain L1: genesis: 0x4104895a540d87127ff11eef0d51d8f63ce00a6fc211db751a45a4b3a61a9c83:8106656, got 0x12e2c18a3ac50f74d3dd3c0ed7cb751cc924c2985de3dfed44080e683954f1dd:8106656","lvl":"warn","msg":"Derivation process temporary error","t":"2022-12-13T23:31:37.855253213Z"}
```
It means that the `op-node` is pointing to the wrong chain.
### Solution
1. Verify that the `op-node`'s L1 URL is pointing to the correct L1 for the given network.
2. Verify that the `op-node`'s rollup config/`--network` parameter is set to the correct network.
3. Verify that the `op-node`'s L2 URL is pointing to the correct instance of `execution client`, and that `execution client` is properly initialized for the given network.
## Error: `eth_sendRawTransaction` Does Not Exist
If an RPC call to your execution client (`op-reth`, Nethermind, etc.) returns a response like:
```json theme={null}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method eth_sendRawTransaction does not exist/is not available"
}
}
```
This `-32601` JSON-RPC error means the sequencer endpoint you configured does not expose `eth_sendRawTransaction`. The request path looks like:
```
Client → eth_sendRawTransaction → execution client:8545
↓
EL forwards to sequencer (--rollup.sequencer URL)
↓
eth_sendRawTransaction → op-node:8547
↓
❌ ERROR: "method does not exist/is not available"
(op-node has no eth namespace!)
```
Because `op-node` only exposes rollup-specific RPC methods—there is no `eth_*` namespace—it cannot accept raw transaction submissions. When your execution client forwards the transaction to an `op-node` URL it immediately fails with `-32601`.
This situation almost always happens when op-reth's `--rollup.sequencer` (aliases `--rollup.sequencer-http`, `--rollup.sequencer-ws`) is misconfigured to point at your own `op-node` rather than the chain's actual sequencer.
### Solution
1. Confirm op-reth exposes the `eth` namespace on its HTTP API (the standard set is `--http.api=eth,net,web3,debug`). If `eth` is disabled, raw transactions will be rejected before they reach the sequencer.
2. Inspect the CLI flags and environment variables of every component that talks to the sequencer (`op-node`, `op-reth`, `op-batcher`, `op-proposer`, scripts). The `--rollup.sequencer` flag must point to the chain's public sequencer endpoint (for example, `https://mainnet-sequencer.optimism.io`), **not** to your own `op-node`.
3. For user-deployed L2s where you run the sequencer yourself, leave `--rollup.sequencer` unset so op-reth forwards locally and never falls back to an `op-node` endpoint.
4. Restart the affected services after correcting the flag so they pick up the new endpoint. The error should disappear as soon as they can reach the proper sequencer RPC.
## Unclean Shutdowns
An unclean shutdown occurs when the execution client stops without completing its normal shutdown procedure — for example, a `SIGKILL`, a power loss, or a container killed past its grace period. The impact depends on which database backend your EL uses.
To minimize risk, always shut down gracefully: `Ctrl-C` for foreground processes, `docker stop -t 300 <container>` for Docker, or `systemctl stop` for systemd (override the default 90s timeout if your EL has a large in-memory write to flush).
### For op-reth
op-reth uses MDBX, which is crash-safe by design. After an unclean shutdown the node typically restarts cleanly with no operator intervention required.
If startup fails after an unclean shutdown, options include:
* **Stage unwind** — roll back to the last consistent stage checkpoint:
```bash theme={null}
op-reth stage unwind to-block <BLOCK_NUMBER> --datadir=<path>
```
* **Full resync** — as a last resort, delete the datadir and resync from genesis or a [snapshot](https://datadirs.optimism.io/).
### For Nethermind
Unclean shutdowns in `Nethermind` can lead to database corruption. This typically happens when:
* The node experiences hardware failures (disk failures, memory errors, overheating)
* Power cuts cause abrupt shutdowns
* The process is terminated without proper cleanup
**Solutions**
1. **Lock File Issues**
If `Nethermind` complains about lock files after an unclean shutdown, run:
```bash theme={null}
find /path/to/nethermind_db -type f -name 'LOCK' -delete
```
2. **Block Checksum Mismatch**
If you encounter block checksum mismatch errors, you can enable direct I/O:
```bash theme={null}
--Db.UseDirectIoForFlushAndCompactions true
```
Note: This may impact performance.
3. **Complete Resync**
In cases of severe corruption, a full resync is recommended:
```bash theme={null}
sudo systemctl stop nethermind
sudo rm -rf /path/to/nethermind_db/mainnet
sudo systemctl start nethermind
```
# Kona Node CLI Reference
Source: https://docs.optimism.io/node-operators/kona-node/configuration
Reference for all kona-node CLI flags and environment variables, grouped by category, plus default ports and default runtime behavior.
This document lists all CLI flags for the `kona-node node` subcommand, grouped by category. All flags can be provided as command-line arguments or via environment variables.
<Note>
For more details on each flag, see the inline help (`kona-node node --help`) or the source code.
</Note>
## Default Ports
| Service | Default Port | Flag/Env |
| - | - | - |
| RPC HTTP | 9545 | `--port` / `KONA_NODE_RPC_PORT` |
| RPC WebSocket | 9545 | (same as HTTP, enabled with `--rpc.ws-enabled`) |
| P2P TCP | 9222 | `--p2p.listen.tcp` / `KONA_NODE_P2P_LISTEN_TCP_PORT` |
| P2P UDP | 9223 | `--p2p.listen.udp` / `KONA_NODE_P2P_LISTEN_UDP_PORT` |
`kona-node` does not run a supervisor RPC server: the binary has no `--supervisor.*`
flag group. Its only interop flag, `--interop.dependency-set`
(`KONA_NODE_INTEROP_DEPENDENCY_SET`), takes a path to a dependency-set JSON file
rather than a port.
`--conductor.rpc` (`KONA_NODE_CONDUCTOR_RPC`) is not a listening port either. It is
the RPC endpoint URL of an external conductor service that the node dials out to,
and it has no default value. Supplying it enables the conductor integration when the
node runs in sequencer mode (`--mode sequencer`); in validator mode it has no effect.
## Core Node Arguments
| Flag | Env | Description | Required | Default |
| - | - | - | - | - |
| `--mode <validator/sequencer>` | `KONA_NODE_MODE` | Mode of operation for the node | No | `validator` |
| `--l1-eth-rpc <URL>` | `KONA_NODE_L1_ETH_RPC` | URL of the L1 execution client RPC API | Yes | - |
| `--l1-trust-rpc <true/false>` | `KONA_NODE_L1_TRUST_RPC` | Whether to trust the L1 RPC without verification | No | `true` |
| `--l1-beacon <URL>` | `KONA_NODE_L1_BEACON` | URL of the L1 beacon API | Yes | - |
| `--l2-engine-rpc <URL>` | `KONA_NODE_L2_ENGINE_RPC` | URL of the engine API endpoint of an L2 execution client | Yes | - |
| `--l2-trust-rpc <true/false>` | `KONA_NODE_L2_TRUST_RPC` | Whether to trust the L2 RPC without verification | No | `true` |
| `--l2-engine-jwt-secret <PATH>` | `KONA_NODE_L2_ENGINE_AUTH` | Path to file containing the hex-encoded JWT secret for the execution client | No | - |
| `--l2-config-file <PATH>` | `KONA_NODE_ROLLUP_CONFIG` | Path to a custom L2 rollup configuration file | No | - |
| `--l1-runtime-config-reload-interval <SECONDS>` | `KONA_NODE_L1_RUNTIME_CONFIG_RELOAD_INTERVAL` | Poll interval for reloading runtime config | No | `600` |
## Global Arguments
| Flag | Env | Description | Required | Default |
| - | - | - | - | - |
| `--l2-chain-id <ID/NAME>` or `-c <ID/NAME>` | `KONA_NODE_L2_CHAIN_ID` | L2 chain ID (numeric) or chain name (string) | No | `10` (Optimism) |
### Chain ID Support
The `프로젝트로 돌아가기