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

# 常规运维

## 版本信息

查看 Monad 二进制文件的版本与构建信息:

```bash theme={null}
monad-node --version
# Example output: monad-node {"commit":"c0cdcaae8eb527e44d72c4638c1f1335025a5132","tag":"v0.12.2-rc","branch":"","modified":true}
```

## CLI 帮助

查看任一 Monad 二进制文件的可用命令行参数:

```bash theme={null}
monad-rpc --help
monad --help
monad-bft --help
```

<Warning>
  不应随意修改 CLI 参数,因为某些配置可能会导致意外行为或崩溃。
</Warning>

## 服务管理

检查 Monad 服务的状态:

```bash theme={null}
# Check all services at once
systemctl status monad-bft monad-execution monad-rpc --no-pager -l

# Check individual service status
systemctl status monad-bft
systemctl status monad-execution
systemctl status monad-rpc

# View logs for a specific service
journalctl -u monad-bft -f
journalctl -u monad-execution -f
journalctl -u monad-rpc -f
```

## 监控区块高度

当状态同步完成后,RPC 服务将开始监听端口 `8080`。

通过 RPC 检查当前区块高度:

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

## 查看 MonadDB 磁盘使用情况

请注意,MonadDB(TrieDB)在达到 80% 容量时会自动进行压缩以保持最佳 SSD 性能。要检查 MonadDB 磁盘使用情况和保留的区块历史:

```bash theme={null}
monad-mpt --storage /dev/triedb
```

示例输出:

```
MPT database on storages:
          Capacity           Used      %  Path
           3.49 Tb       24.30 Gb  0.68%  "/dev/nvme1n1p1"
MPT database internal lists:
     Fast: 94 chunks with capacity 23.50 Gb used 23.40 Gb
     Slow: 3 chunks with capacity 768.00 Mb used 658.72 Mb
     Free: 14207 chunks with capacity 3.47 Tb used 0.00 bytes
MPT database has 599928 history, earliest is 36784905 latest is 37384832.
     It has been configured to retain no more than 33554432.
     Latest proposed is (37384832, 88a5550ba067c2f21cef6b6e8953fbf700fe300905952e5621335fe2bd58729c).
     Latest voted is (37384831, 56074c2429909c2966bfe8df55810ec3b8f4f4f599b407ff89ec92b090656ab1).
     Latest finalized is 37384830, latest verified is 37384827, auto expire version is 36784905
```

## 使用 `ledger-tail` 获取共识信息

`monad-ledger-tail` 通过直接解析账本产物来暴露共识信息,并以 JSON 格式流式输出数据。

启动服务:

```bash theme={null}
systemctl start monad-ledger-tail

# View output
journalctl -fu monad-ledger-tail
```

示例输出:

```json theme={null}
// the real output is all on one line, but we've prettified this for legibility:
{
  "timestamp": "2025-11-23T03:09:09.534974Z",
  "level": "INFO",
  "fields": {
    "message": "proposed_block",
    "round": "53449032",
    "parent_round": "53449031",
    "epoch": "1024",
    "seq_num": "51203516",
    "num_tx": "3",
    "author": "036daee7750e29e46eb64d86ad1cc7b235d7f1ad9597941a3a77cdd641cead4528",
    "block_ts_ms": "1763867349470",
    "now_ts_ms": "1763867349534",
    "author_address": ""
  },
  "target": "ledger_tail"
}
```

## 使用 `monad-status` 查看节点状态

安装 `monad-status`:

```
curl -sSL https://bucket.monadinfra.com/scripts/monad-status.sh -o /usr/local/bin/monad-status
chmod +x /usr/local/bin/monad-status
```

运行 `monad-status` 获取节点状态。

这应打印类似输出:

```yaml theme={null}
### Monad Node Status

hostname: monad-node
date: Wed Nov 26 10:48:26 PM CET 2025
uptime: 0d 00h 41m 49s
version: 0.12.2
config:
  network: mainnet
  chain: monad_mainnet
  chainId: 143
  secpPublicKey: 03831b36b50261011d82f94d58f8aa0edfe058359e2c365c37cce678436b9eb371
  blsPublicKey: b9c1905e11e8395a789bece454ec24bed98b96cf9dc04c02c9512fb94900d3e0355383e542c44a0eb1be4d2780a1fb2f
  nodeSignature: 4f6e3e47af0e8ff3614e1eb53f9015ef4fc8593e60c13d52c2b458d05385b5f94cff8776ceb8b9401c3647148637d599622353d0631864a23b07f6d7fb55e84f00
  selfAddress: 65.109.145.172:8000
  recordSeqNum: 0
services:
  monad-bft: running
  monad-execution: running
  monad-rpc: running
  otelcol: running
  monad-cruft:
    activated: true
    previous: 48min ago
    next: 11min
peers:
  peersNumber: 1146
consensus:
  status: in-sync
  mode: live
  epoch: 764
  round: 38259075
  blockNumber: 38200041
  blockNumberFromExternal: 38200040
  blockDifference: 0
statesync:
  percentage: 100.0000%
  progress: 38193694
  target: 38193694
rpc:
  status: active
  clientVersion: Monad/0.12.2
  netVersion: 143
  blockNumber: 38200041
```

## 导出密钥备份

如果您遵循了[全节点安装](/zh/node-ops/full-node-installation#generate-keystores)指南,密钥的备份文件已自动创建于:

* `/opt/monad/backup/secp-backup`
* `/opt/monad/backup/bls-backup`

如果这些文件缺失,或者您需要重新导出密钥,请使用以下命令重新创建它们。任何现存的备份文件在被覆盖前都会以时间戳后缀保留。

```bash theme={null}
source /home/monad/.env

[ -f /opt/monad/backup/secp-backup ] && mv /opt/monad/backup/secp-backup "/opt/monad/backup/secp-backup.$(date +%Y%m%d%H%M%S).bak"
[ -f /opt/monad/backup/bls-backup ] && mv /opt/monad/backup/bls-backup "/opt/monad/backup/bls-backup.$(date +%Y%m%d%H%M%S).bak"

monad-keystore recover \
  --password "$KEYSTORE_PASSWORD" \
  --keystore-path /home/monad/monad-bft/config/id-secp \
  --key-type secp > /opt/monad/backup/secp-backup

monad-keystore recover \
  --password "$KEYSTORE_PASSWORD" \
  --keystore-path /home/monad/monad-bft/config/id-bls \
  --key-type bls > /opt/monad/backup/bls-backup
```

<Warning title="外部备份">
  这些文件包含您节点的私钥 — 它们定义了您的节点身份。任何能够访问它们的人都可以接管您节点的身份。

  **请务必将这些备份文件存储在节点之外的外部位置(例如密码管理器或密钥库)。在硬件故障或系统丢失时,您需要它们来恢复全节点或验证者身份:**

  * `/opt/monad/backup/secp-backup`
  * `/opt/monad/backup/bls-backup`

  对于验证者而言,这一点尤为重要:丢失密钥意味着您无法迁移验证者,并且使用新身份重新注册需要手动迁移所有委托。
</Warning>

## 从备份中导入密钥

若要从备份中恢复您的节点身份,请从每个备份文件中提取 IKM secret,并使用 `monad-keystore import` 进行导入:

```bash theme={null}
source /home/monad/.env

[ -f /home/monad/monad-bft/config/id-secp ] && mv /home/monad/monad-bft/config/id-secp "/home/monad/monad-bft/config/id-secp.$(date +%Y%m%d%H%M%S).bak"
[ -f /home/monad/monad-bft/config/id-bls ] && mv /home/monad/monad-bft/config/id-bls "/home/monad/monad-bft/config/id-bls.$(date +%Y%m%d%H%M%S).bak"

SECP_IKM=$(grep -E "Keystore secret:|Keep your IKM secure:" /opt/monad/backup/secp-backup | awk '{print $NF}')
BLS_IKM=$(grep -E "Keystore secret:|Keep your IKM secure:" /opt/monad/backup/bls-backup | awk '{print $NF}')

monad-keystore import \
  --ikm "$SECP_IKM" \
  --password "$KEYSTORE_PASSWORD" \
  --keystore-path /home/monad/monad-bft/config/id-secp \
  --key-type secp

monad-keystore import \
  --ikm "$BLS_IKM" \
  --password "$KEYSTORE_PASSWORD" \
  --keystore-path /home/monad/monad-bft/config/id-bls \
  --key-type bls
```

## 保持更新

若要及时了解新版本发布:

* 加入 [Monad Node Announcements](https://t.me/MonadNodeAnnouncements) telegram 群组,或
* 加入 [Monad Developer Discord](https://discord.gg/monaddev),并关注 `#mainnet-fullnode-announcements` 频道
