> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
> Use this file to discover all available pages before exploring further.

# op-node JSON-RPC API

> rollup 전용 기능을 포함한 op-node RPC 메서드의 전체 레퍼런스입니다.

`op-node`는 L1 beacon node와 유사하게 합의 계층(Consensus Layer)으로서 rollup 전용 기능을 구현합니다. rollup 상태 조회, 피어 관리, sequencer 작업 제어를 위한 RPC 메서드를 제공합니다.

> [!NOTE]
>
> L2 gas 가격에는 `rollup_gasPrices` 대신 [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)를 사용하십시오.
> L1 gas 가격은 [`GasPriceOracle`의 `l1BaseFee` 함수](https://explorer.optimism.io/address/0x420000000000000000000000000000000000000F#readProxyContract#F11)를 호출하여 확인할 수 있습니다.
> 트랜잭션 비용을 추정하려면 [SDK를 사용](https://docs.optimism.io/ko/app-developers/tutorials/transactions/sdk-estimate-costs.md)할 수 있습니다.

## RPC 요청 보내기

다음 예시는 [`curl`](https://curl.se/)과 [`cast`](https://book.getfoundry.sh/cast/)로 요청을 보내는 방법을 보여 줍니다.

> [!NOTE]
>
> 팁: 이 명령의 출력을 [`jq`](https://jqlang.github.io/jq/)로 파이프하면 보기 좋게 포맷된 JSON 응답을 얻을 수 있습니다.
>
> `$ cast rpc optimism_syncStatus --rpc-url http://localhost:9545 | jq`

## optimism 네임스페이스

체인 상태와 구성을 조회하기 위한 Optimism 전용 rollup 메서드입니다.

### optimism\_outputAtBlock

특정 블록의 output root를 가져옵니다. 이 메서드는 [사양 문서](https://specs.optimism.io/protocol/rollup-node.html?utm_source=op-docs\&utm_medium=docs#output-method-api)에 설명되어 있습니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data  \
>   '{"jsonrpc":"2.0","method":"optimism_outputAtBlock","params":["<hex_block_number>"],"id":1}' \
>   http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc optimism_outputAtBlock <hex_block_number> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
   "jsonrpc":"2.0",
   "id":1,
   "result":[
      "0x0000000000000000000000000000000000000000000000000000000000000000",
      "0xabe711e34c1387c8c56d0def8ce77e454d6a0bfd26cef2396626202238442421"
   ]
}
```

### optimism\_syncStatus

rollup node의 동기화 상태를 가져옵니다. 이 메서드는 L1 및 L2 블록 처리 상태에 대한 상세 정보를 제공합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"optimism_syncStatus","params":[],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc optimism_syncStatus --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "current_l1": {
    "hash": "0xff3b3253058411b727ac662f4c9ae1698918179e02ecebd304beb1a1ae8fc4fd",
    "number": 4427350,
    "parentHash": "0xb26586390c3f04678706dde13abfb5c6e6bb545e59c22774e651db224b16cd48",
    "timestamp": 1696478784
  },
  "current_l1_finalized": {
    "hash": "0x7157f91b8ae21ef869c604e5b268e392de5aa69a9f44466b9b0f838d56426541",
    "number": 4706784,
    "parentHash": "0x1ac2612a500b9facd650950b8755d97cf2470818da2d88552dea7cd563e86a17",
    "timestamp": 1700160084
  },
  "head_l1": {
    "hash": "0x6110a8e6ed4c4aaab20477a3eac81bf99e505bf6370cd4d2e3c6d34aa5f4059a",
    "number": 4706863,
    "parentHash": "0xee8a9cba5d93481f11145c24890fd8f536384f3c3c043f40006650538fbdcb56",
    "timestamp": 1700161272
  },
  "safe_l1": {
    "hash": "0x8407c9968ce278ab435eeaced18ba8f2f94670ad9d3bdd170560932cf46e2804",
    "number": 4706811,
    "parentHash": "0x6593cccab3e772776418ff691f6e4e75597af18505373522480fdd97219c06ef",
    "timestamp": 1700160480
  },
  "finalized_l1": {
    "hash": "0x7157f91b8ae21ef869c604e5b268e392de5aa69a9f44466b9b0f838d56426541",
    "number": 4706784,
    "parentHash": "0x1ac2612a500b9facd650950b8755d97cf2470818da2d88552dea7cd563e86a17",
    "timestamp": 1700160084
  },
  "unsafe_l2": {
    "hash": "0x9a3b2edab72150de252d45cabe2f1ac57d48ddd52bb891831ffed00e89408fe4",
    "number": 2338094,
    "parentHash": "0x935b94ec0bac0e63c67a870b1a97d79e3fa84dda86d31996516cb2f940753f53",
    "timestamp": 1696478728,
    "l1origin": {
      "hash": "0x38731e0a6eeb40091f0c4a00650e911c57d054aaeb5b158f55cd5705fa6a3ebf",
      "number": 4427339
    },
    "sequenceNumber": 3
  },
  "safe_l2": {
    "hash": "0x9a3b2edab72150de252d45cabe2f1ac57d48ddd52bb891831ffed00e89408fe4",
    "number": 2338094,
    "parentHash": "0x935b94ec0bac0e63c67a870b1a97d79e3fa84dda86d31996516cb2f940753f53",
    "timestamp": 1696478728,
    "l1origin": {
      "hash": "0x38731e0a6eeb40091f0c4a00650e911c57d054aaeb5b158f55cd5705fa6a3ebf",
      "number": 4427339
    },
    "sequenceNumber": 3
  },
  "finalized_l2": {
    "hash": "0x285b03afb46faad747be1ca7ab6ef50ef0ff1fe04e4eeabafc54f129d180fad2",
    "number": 2337942,
    "parentHash": "0x7e7f36cba1fd1ccdcdaa81577a1732776a01c0108ab5f98986cf997724eb48ac",
    "timestamp": 1696478424,
    "l1origin": {
      "hash": "0x983309dadf7e0ab8447f3050f2a85b179e9acde1cd884f883fb331908c356412",
      "number": 4427314
    },
    "sequenceNumber": 7
  },
  "pending_safe_l2": {
    "hash": "0x9a3b2edab72150de252d45cabe2f1ac57d48ddd52bb891831ffed00e89408fe4",
    "number": 2338094,
    "parentHash": "0x935b94ec0bac0e63c67a870b1a97d79e3fa84dda86d31996516cb2f940753f53",
    "timestamp": 1696478728,
    "l1origin": {
      "hash": "0x38731e0a6eeb40091f0c4a00650e911c57d054aaeb5b158f55cd5705fa6a3ebf",
      "number": 4427339
    },
    "sequenceNumber": 3
  },
  "queued_unsafe_l2": {
    "hash": "0x3af253f5b993f58fffdd5e594b3f53f5b7b254cdc18f4bdb13ea7331149942db",
    "number": 4054795,
    "parentHash": "0x284b7dc92bac97be8ec3b2cf548e75208eb288704de381f2557938ecdf86539d",
    "timestamp": 1699912130,
    "l1origin": {
      "hash": "0x1490a63c372090a0331e05e63ec6a7a6e84835f91776306531f28b4217394d76",
      "number": 4688196
    },
    "sequenceNumber": 2
  },
  "engine_sync_target": {
    "hash": "0x9a3b2edab72150de252d45cabe2f1ac57d48ddd52bb891831ffed00e89408fe4",
    "number": 2338094,
    "parentHash": "0x935b94ec0bac0e63c67a870b1a97d79e3fa84dda86d31996516cb2f940753f53",
    "timestamp": 1696478728,
    "l1origin": {
      "hash": "0x38731e0a6eeb40091f0c4a00650e911c57d054aaeb5b158f55cd5705fa6a3ebf",
      "number": 4427339
    },
    "sequenceNumber": 3
  }
}
```

### optimism\_rollupConfig

rollup 구성 파라미터를 가져옵니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"optimism_rollupConfig","params":[],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc optimism_rollupConfig --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "genesis": {
    "l1": {
      "hash": "0x48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b",
      "number": 4071408
    },
    "l2": {
      "hash": "0x102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d",
      "number": 0
    },
    "l2_time": 1691802540,
    "system_config": {
      "batcherAddr": "0x8f23bb38f531600e5d8fddaaec41f13fab46e98c",
      "overhead": "0x00000000000000000000000000000000000000000000000000000000000000bc",
      "scalar": "0x00000000000000000000000000000000000000000000000000000000000a6fe0",
      "gasLimit": 30000000
    }
  },
  "block_time": 2,
  "max_sequencer_drift": 600,
  "seq_window_size": 3600,
  "channel_timeout": 300,
  "l1_chain_id": 11155111,
  "l2_chain_id": 11155420,
  "regolith_time": 0,
  "canyon_time": 1699981200,
  "batch_inbox_address": "0xff00000000000000000000000000000011155420",
  "deposit_contract_address": "0x16fc5058f25648194471939df75cf27a2fdc48bc",
  "l1_system_config_address": "0x034edd2a225f7f429a63e0f1d2084b9e0a93b538"
}
```

### optimism\_version

op-node의 소프트웨어 버전을 가져옵니다.

> [!NOTE]
>
> 현재 소스에서 빌드하면 올바른 버전이 표시되지 않지만, 공식 docker 이미지에서는 올바른 버전이 표시됩니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"optimism_version","params":[],"id":1}' \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc optimism_version --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
   "jsonrpc":"2.0",
   "id":1,
   "result":"v0.0.0-"
}
```

## opp2p 네임스페이스

`opp2p` 네임스페이스는 P2P(peer-to-peer) 네트워킹 상호작용을 처리하며, 피어 연결, 탐색(discovery), 네트워크 정책을 관리할 수 있게 해 줍니다.

### opp2p\_self

피어 ID, 주소, 네트워크 구성을 포함한 내 node의 피어 정보를 반환합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_self","params":[],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_self --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "peerID": "16Uiu2HAm2y6DXp6THWHCyquczNUh8gVAm4spo6hjP3Ns1dGRiAdE",
    "nodeID": "75a52a90fe5f972171fefce2399ca5a73191c654e7c7ddfdd71edf4fca6697f0",
    "userAgent": "",
    "protocolVersion": "",
    "ENR": "enr:-J-4QFOtI_hDBa_kilrQcg4iTJt9VMAuDLCbgAAKMa--WfxoPml1xDYxypUG7IsWga83FOlvr78LG3oH8CfzRzUmsDyGAYvKqIZ2gmlkgnY0gmlwhGxAaceHb3BzdGFja4Xc76gFAIlzZWNwMjU2azGhAnAON-FvpiWY2iG_LXJDYosknGyikaajPDd1cQARsVnBg3RjcIIkBoN1ZHCC0Vs",
    "addresses": [
      "/ip4/127.0.0.1/tcp/9222/p2p/16Uiu2HAm2y6DXp6THWHCyquczNUh8gVAm4spo6hjP3Ns1dGRiAdE",
      "/ip4/192.168.1.71/tcp/9222/p2p/16Uiu2HAm2y6DXp6THWHCyquczNUh8gVAm4spo6hjP3Ns1dGRiAdE",
      "/ip4/108.64.105.199/tcp/9222/p2p/16Uiu2HAm2y6DXp6THWHCyquczNUh8gVAm4spo6hjP3Ns1dGRiAdE"
    ],
    "protocols": null,
    "connectedness": 0,
    "direction": 0,
    "protected": false,
    "chainID": 0,
    "latency": 0,
    "gossipBlocks": true,
    "scores": {
      "gossip": {
        "total": 0,
        "blocks": {
          "timeInMesh": 0,
          "firstMessageDeliveries": 0,
          "meshMessageDeliveries": 0,
          "invalidMessageDeliveries": 0
        },
        "IPColocationFactor": 0,
        "behavioralPenalty": 0
      },
      "reqResp": {
        "validResponses": 0,
        "errorResponses": 0,
        "rejectedPayloads": 0
      }
    }
  }
}
```

### opp2p\_peers

내 node의 피어 목록을 상세한 연결 정보와 함께 반환합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_peers","params":[true],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_peers true --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "totalConnected": 20,
    "peers": {
      "16Uiu2HAkvNYscHu4V1uj6fVWkwrAMCRsqXDSq4mUbhpGq4LttYsC": {
        "peerID": "16Uiu2HAkvNYscHu4V1uj6fVWkwrAMCRsqXDSq4mUbhpGq4LttYsC",
        "nodeID": "d693c5b58424016c0c38ec5539c272c754cb6b8007b322e0ecf16a4ee13f96fb",
        "userAgent": "optimism",
        "protocolVersion": "",
        "ENR": "",
        "addresses": [
          "/ip4/20.249.62.215/tcp/9222/p2p/16Uiu2HAkvNYscHu4V1uj6fVWkwrAMCRsqXDSq4mUbhpGq4LttYsC"
        ],
        "protocols": [
          "/ipfs/ping/1.0.0",
          "/meshsub/1.0.0",
          "/meshsub/1.1.0",
          "/floodsub/1.0.0",
          "/ipfs/id/1.0.0",
          "/ipfs/id/push/1.0.0"
        ],
        "connectedness": 1,
        "direction": 1,
        "protected": false,
        "chainID": 0,
        "latency": 0,
        "gossipBlocks": true,
        "scores": {
          "gossip": {
            "total": -5.04,
            "blocks": {
              "timeInMesh": 0,
              "firstMessageDeliveries": 0,
              "meshMessageDeliveries": 0,
              "invalidMessageDeliveries": 0
            },
            "IPColocationFactor": 0,
            "behavioralPenalty": 0
          },
          "reqResp": {
            "validResponses": 0,
            "errorResponses": 0,
            "rejectedPayloads": 0
          }
        }
      }
    },
    "bannedPeers": [],
    "bannedIPS": [],
    "bannedSubnets": []
  }
}
```

### opp2p\_peerStats

피어 연결에 대한 집계 통계를 반환합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_peerStats","params":[],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_peerStats --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "connected": 20,
    "table": 94,
    "blocksTopic": 20,
    "blocksTopicV2": 18,
    "banned": 0,
    "known": 71
  }
}
```

### opp2p\_discoveryTable

탐색된 피어의 node 레코드(ENR)가 담긴 피어 탐색 테이블을 반환합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_discoveryTable","params":[],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_discoveryTable --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
  "enr:-J24QGC_SzoGG4EqyvO_082paQOwhvECeWGT-kaenrHdE2_iLTLeGmH-IOVpqEjC0L-yWmkI-c7598VaCjHQRNWn1CyGAYsqDgrFgmlkgnY0gmlwhNgp3WeHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQPiq20PNZYzyvpEifcGVrOXHfM94JeWSgDL07I2hSl0d4N0Y3CCJAaDdWRwgiQG",
  "enr:-J24QKvt2ThBM8-FPeHfAmpoaVLdfVD2cw1cRpNuwmvH_bQtQ1dqrrZw9FqiMbXbFRQf9IvjrlKSFLodbsRALIFATICGAYuQClJigmlkgnY0gmlwhKI3ZuaHb3BzdGFja4O6BACJc2VjcDI1NmsxoQLQRz2CH95qQd6vmF5saV-WOoTZobNfSt-FUdVa7R35nYN0Y3CCIyuDdWRwgiMr"
  ]
}
```

### opp2p\_blockPeer

피어 ID로 피어를 차단하여 이후 연결을 막습니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_blockPeer","params":["<peerID>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_blockPeer <peerID> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### opp2p\_unblockPeer

이전에 차단한 피어의 차단을 해제합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_unblockPeer","params":["<peerID>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_unblockPeer <peerID> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### opp2p\_listBlockedPeers

차단된 피어 ID 목록을 반환합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_listBlockedPeers","params":[],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_listBlockedPeers --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    "16Uiu2HAmV3PueiaHj7Rg2bs3mrRUo2RVhjXRMpH67k9iZquDGQ8v"
  ]
}
```

### opp2p\_blockAddr

특정 IP 주소로부터의 연결을 차단합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_blockAddr","params":["<ip-address>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_blockAddr <ip-address> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### opp2p\_unblockAddr

이전에 차단한 IP 주소의 차단을 해제합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_unblockAddr","params":["<ip-address>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_unblockAddr <ip-address> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### opp2p\_listBlockedAddrs

차단된 IP 주소 목록을 반환합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_listBlockedAddrs","params":[],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_listBlockedAddrs --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    "2607:f8b0:4002:c0c::65"
  ]
}
```

### opp2p\_blockSubnet

특정 서브넷(CIDR 표기)으로부터의 연결을 차단합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_blockSubnet","params":["<subnet>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_blockSubnet <subnet> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### opp2p\_unblockSubnet

이전에 차단한 서브넷의 차단을 해제합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_unblockSubnet","params":["<subnet>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_unblockSubnet <subnet> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### opp2p\_listBlockedSubnets

차단된 서브넷 목록을 반환합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_listBlockedSubnets","params":[],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_listBlockedSubnets --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": []
}
```

### opp2p\_protectPeer

피어가 연결 풀에서 정리(prune)되지 않도록 보호합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_protectPeer","params":["<peerID>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_protectPeer <peerID> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### opp2p\_unprotectPeer

피어의 보호를 해제하여 필요한 경우 정리(prune)될 수 있도록 합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_unprotectPeer","params":["<peerID>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_unprotectPeer <peerID> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### opp2p\_connectPeer

multiaddress를 사용하여 피어와의 연결을 시작합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_connectPeer","params":["<peer multiaddr>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_connectPeer <peer multiaddr> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### opp2p\_disconnectPeer

특정 피어와의 연결을 끊습니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"opp2p_disconnectPeer","params":["<peerID>"],"id":1}'  \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc opp2p_disconnectPeer <peerID> --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

## admin 네임스페이스

sequencer 작업과 derivation pipeline을 제어하기 위한 관리용 메서드입니다.

### admin\_resetDerivationPipeline

derivation pipeline을 재설정하여 L1 데이터로부터 L2 블록을 다시 도출(derive)하도록 강제합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"admin_resetDerivationPipeline","params":[],"id":1}' \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc admin_resetDerivationPipeline --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### admin\_startSequencer

이전에 중지된 sequencer를 시작합니다. 이를 통해 node가 새 블록 생성을 시작할 수 있습니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"admin_startSequencer","params":[],"id":1}' \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc admin_startSequencer --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### admin\_stopSequencer

sequencer를 중지하여 새 블록을 생성하지 못하게 합니다. node는 다른 sequencer로부터 계속 동기화합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"admin_stopSequencer","params":[],"id":1}' \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc admin_stopSequencer --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### admin\_sequencerActive

sequencer가 현재 활성 상태이며 블록을 생성하고 있는지 여부를 반환합니다.

> [tab] curl
>
> ```sh theme={null}
> curl -X POST -H "Content-Type: application/json" --data \
>     '{"jsonrpc":"2.0","method":"admin_sequencerActive","params":[],"id":1}' \
>     http://localhost:9545
> ```

> [tab] cast
>
> ```sh theme={null}
> cast rpc admin_sequencerActive --rpc-url http://localhost:9545
> ```

성공 시 출력 예시:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": true
}
```
