From b13d06aae7eb8f235d8f319848ebe63d48a1dc7e Mon Sep 17 00:00:00 2001 From: Wang Defa Date: Wed, 24 Dec 2025 10:43:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F=E5=B9=B6=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增详细配置示例文件(conf/params.example.conf),包含所有配置项的详细中文说明 - 配置文件采用清晰的章节分组和双语注释(英文标题 + 中文说明) - 新增配置项:sync-pruned-blocks、limit-rate-up、limit-rate-down - 默认启用 P2P 网络绑定(0.0.0.0:18080) - 更新项目文档索引并同步配置参考文档 --- conf/params.example.conf | 388 ++++++++++++++++++++++++++++++ debian/postinst | 78 ++++-- llmdoc/index.md | 2 + llmdoc/reference/configuration.md | 77 ++++-- 4 files changed, 514 insertions(+), 31 deletions(-) create mode 100644 conf/params.example.conf diff --git a/conf/params.example.conf b/conf/params.example.conf new file mode 100644 index 0000000..c8a41ba --- /dev/null +++ b/conf/params.example.conf @@ -0,0 +1,388 @@ +# Mond Configuration File +# ============================================================================ +# This file is automatically created during installation +# Edit this file to customize your Mond daemon settings +# After modifying, restart the service: sudo systemctl restart mond.service +# ============================================================================ + +# DATA STORAGE +# ============================================================================ +# data-dir: 区块链数据存储目录 +# - 包含完整的区块链数据、交易池和节点状态 +# - 确保该目录所在磁盘有足够空间(完整节点需要 150GB+,修剪节点需要 50GB+) +# - 默认位置: ~/.bitmonero (用户安装) 或 /var/lib/mond (系统服务) +data-dir=/var/lib/mond/data + +# BLOCKCHAIN PRUNING +# ============================================================================ +# prune-blockchain: 启用区块链修剪模式 +# - 1 = 启用修剪,只保留最近的区块数据和必要的历史信息 +# - 0 = 禁用修剪,保留完整的区块链历史(默认) +# - 优点: 大幅减少磁盘使用(从 150GB+ 降至 50GB 左右) +# - 缺点: 无法向其他节点提供完整的历史区块数据 +# - 注意: 修剪节点仍然可以完全验证区块链,只是不存储所有旧数据 +prune-blockchain=1 + +# sync-pruned-blocks: 同步修剪后的区块 +# - 1 = 允许从其他修剪节点同步数据(推荐) +# - 0 = 仅从完整节点同步 +# - 建议与 prune-blockchain=1 一起使用,加速初始同步 +sync-pruned-blocks=1 + +# ZMQ NOTIFICATION SYSTEM +# ============================================================================ +# zmq-pub: ZeroMQ 发布接口,用于实时广播区块链事件 +# - tcp://IP:PORT 格式指定绑定地址和端口 +# - 127.0.0.1 = 仅本地访问(推荐,除非需要远程订阅) +# - 18083 = 默认 ZMQ 端口(可修改) +# - 用途: P2Pool 挖矿、实时监控工具、区块浏览器等 +# - 发布的事件类型: +# * json-full-chain_main: 新区块添加到主链 +# * json-full-txpool_add: 新交易进入交易池 +# * json-minimal-chain_main: 简化的新区块信息 +# * json-minimal-txpool_add: 简化的新交易信息 +# - 如需外部访问,改为 tcp://0.0.0.0:18083 并添加 confirm-external-bind=1 +zmq-pub=tcp://127.0.0.1:18083 + +# NETWORK PEER SETTINGS +# ============================================================================ +# out-peers: 主动连接的对等节点数量(出站连接) +# - 默认: 8,这里设置为 32 可提高网络连接性和同步速度 +# - 范围: 0-1000,推荐值: 8-64 +# - 更多出站连接 = 更快的区块传播,但消耗更多带宽和资源 +out-peers=32 + +# in-peers: 接受连接的对等节点数量(入站连接) +# - 默认: 无限制,这里设置为 64 可平衡网络贡献和资源消耗 +# - 范围: 0-无限,推荐值: 32-128 +# - 入站连接有助于网络去中心化,但需要开放 P2P 端口(18080) +in-peers=64 + +# limit-rate-up: 上传速率限制(kB/s,千字节/秒) +# - 1024 kB/s = 1 MB/s = 8 Mbps +# - 默认: 8192 kB/s = 8 MB/s = 64 Mbps +# - -1 = 无限制(不推荐,可能耗尽带宽) +# - 根据网络带宽调整,建议保留部分带宽给其他应用 +# - 计算公式: (总上传带宽 Mbps * 1024) / 8 = kB/s +# - 示例: +# * 10 Mbps 上传 → limit-rate-up=1280 (10 * 1024 / 8) +# * 50 Mbps 上传 → limit-rate-up=6400 (50 * 1024 / 8) +# * 100 Mbps 上传 → limit-rate-up=12800 (100 * 1024 / 8) +limit-rate-up=1048576 + +# limit-rate-down: 下载速率限制(kB/s,千字节/秒) +# - 1024 kB/s = 1 MB/s = 8 Mbps +# - 默认: 32768 kB/s = 32 MB/s = 256 Mbps +# - -1 = 无限制(初始同步时推荐) +# - 同步完成后可设置限制,节省带宽 +# - 注意: 限制过低会影响区块同步速度 +# - 示例: +# * 50 Mbps 下载 → limit-rate-down=6400 (50 * 1024 / 8) +# * 100 Mbps 下载 → limit-rate-down=12800 (100 * 1024 / 8) +# * 无限制(推荐初始同步)→ limit-rate-down=-1 +limit-rate-down=1048576 + +# PRIORITY NODES +# ============================================================================ +# add-priority-node: 优先连接的可信节点 +# - 格式: 域名:端口 或 IP:端口 +# - 节点会优先与这些节点建立连接并保持连接 +# - 用途: +# * 加速初始同步(连接到高速节点) +# * 提高网络可靠性(连接到稳定节点) +# * 优先从可信来源获取区块 +# - 可以添加多个优先节点(重复使用此选项) +# - 这些节点必须开放 P2P 端口(通常是 18080) +add-priority-node=p2pmd.xmrvsbeast.com:18080 +add-priority-node=nodes.hashvault.pro:18080 + +# 可以添加更多优先节点: +# add-priority-node=node.supportxmr.com:18080 +# add-priority-node=node.moneroworld.com:18080 +# add-priority-node=opennode.xmr-tw.org:18080 + +# SECURITY AND NETWORK INTEGRITY +# ============================================================================ +# enforce-dns-checkpointing: 强制执行 DNS 检查点验证 +# - 1 = 启用(推荐),通过 DNS TXT 记录验证区块链检查点 +# - 0 = 禁用 +# - 作用: 防止长期离线后被恶意分叉欺骗 +# - DNS 检查点由 Monero 核心开发者维护 +# - 安全增强措施,几乎没有缺点 +enforce-dns-checkpointing=1 + +# enable-dns-blocklist: 启用 DNS 黑名单 +# - 1 = 启用(推荐),阻止连接到已知的恶意节点 +# - 0 = 禁用 +# - 黑名单通过 DNS 记录维护,包含: +# * Sybil 攻击节点 +# * 已知的恶意节点 +# * 降低网络性能的节点 +# - 提高网络安全性和连接质量 +enable-dns-blocklist=1 + +# P2P AND RPC NETWORK BINDING +# ============================================================================ +# 以下配置控制节点的网络接口绑定 +# 默认全部注释掉(使用内置默认值) +# 根据使用场景取消注释并修改 + +# --- P2P 绑定设置 --- +# p2p-bind-ip: P2P 网络监听地址 +# - 0.0.0.0 = 监听所有网络接口(公网+内网+本地) +# - 127.0.0.1 = 仅本地访问(不接受外部节点连接) +# - 192.168.x.x = 仅内网访问 +# - 默认: 0.0.0.0(接受所有连接) +# 使用场景: +# * 公共节点: 0.0.0.0(贡献网络,需开放防火墙 18080 端口) +# * 私有节点: 127.0.0.1(不接受入站连接,仅主动连接其他节点) +#p2p-bind-ip=0.0.0.0 + +# p2p-bind-port: P2P 网络监听端口 +# - 18080 = 主网默认端口 +# - 28080 = 测试网 (testnet) 端口 +# - 38080 = 预发布网 (stagenet) 端口 +# - 使用非标准端口可以减少扫描攻击,但会降低网络发现性 +#p2p-bind-port=18080 + +# --- RPC 绑定设置 --- +# rpc-bind-ip: RPC 接口监听地址 +# - 0.0.0.0 = 监听所有网络接口(危险!需要配合认证和 SSL) +# - 127.0.0.1 = 仅本地访问(推荐,安全) +# - 192.168.x.x = 仅内网访问 +# - 默认: 127.0.0.1(仅本地) +# ⚠️ 安全警告: +# * RPC 端口有完整控制权限,暴露到公网极度危险! +# * 如果必须远程访问,必须配置: +# 1. rpc-login (用户名密码) +# 2. rpc-ssl (SSL/TLS 加密) +# 3. 防火墙规则(限制访问 IP) +# * 推荐使用 SSH 隧道代替直接暴露 +#rpc-bind-ip=0.0.0.0 + +# rpc-bind-port: RPC 接口监听端口 +# - 18081 = 主网默认 RPC 端口 +# - 28081 = 测试网 RPC 端口 +# - 38081 = 预发布网 RPC 端口 +# - 用于本地钱包、P2Pool、管理工具连接 +#rpc-bind-port=18081 + +# --- 公共受限 RPC (推荐用于公共服务) --- +# rpc-restricted-bind-ip: 受限 RPC 监听地址 +# - 仅提供只读 API,不能发送交易或控制节点 +# - 可以安全绑定到 0.0.0.0 提供公共查询服务 +# - 不返回隐私敏感数据 +# 使用场景: 公共区块浏览器、轻钱包后端、查询服务 +#rpc-restricted-bind-ip=0.0.0.0 + +# rpc-restricted-bind-port: 受限 RPC 监听端口 +# - 推荐使用与标准 RPC 不同的端口(如 18089) +# - 可以与标准 RPC 同时运行 +#rpc-restricted-bind-port=18089 + +# --- 启用受限 RPC 模式 --- +# restricted-rpc: 将绑定的 RPC 端口设为受限模式 +# - 必须与 rpc-restricted-bind-port 配合使用 +# - 限制可用的 RPC 方法,禁止敏感操作 +#restricted-rpc=1 + +# confirm-external-bind: 确认外部网络绑定 +# - 1 = 明确确认将服务绑定到非本地地址 +# - 安全措施: 防止误将服务暴露到公网 +# - 当使用 0.0.0.0 或非 127.0.0.1 地址时必须添加此选项 +# - 适用于: p2p-bind-ip, rpc-bind-ip, rpc-restricted-bind-ip, zmq-pub +#confirm-external-bind=1 + +# RPC AUTHENTICATION +# ============================================================================ +# rpc-login: RPC 访问认证凭据 +# - 格式: username:password +# - ⚠️ 强制要求: 当 rpc-bind-ip 不是 127.0.0.1 时必须配置 +# - 密码要求: +# * 至少 16 字符 +# * 包含大小写字母、数字、特殊字符 +# * 避免使用字典词汇 +# - 生成强密码命令: +# openssl rand -base64 32 +# pwgen -s 32 1 +# - 示例: rpc-login=admin:xK9mP2vL8qR5nW7jT3hY6fB4sD1gA0cE +# - 客户端连接示例: +# curl -u admin:password http://127.0.0.1:18081/json_rpc +# mond-wallet-cli --daemon-address admin:password@node.example.com:18081 +#rpc-login=user:password + +# RPC SSL/TLS ENCRYPTION +# ============================================================================ +# rpc-ssl: 启用 RPC 连接的 SSL/TLS 加密 +# - enabled = 强制使用 SSL(推荐用于远程访问) +# - disabled = 禁用 SSL(仅本地访问时可用) +# - autodetect = 自动检测客户端支持情况(默认) +# - ⚠️ 远程访问必须启用 SSL,否则密码明文传输! +# - 需要配合 rpc-ssl-certificate 和 rpc-ssl-private-key +#rpc-ssl=enabled + +# rpc-ssl-certificate: SSL 证书文件路径 +# - PEM 格式的 SSL/TLS 证书 +# - 可以使用自签名证书或由 CA 签发的证书 +# - 生成自签名证书(仅用于测试): +# openssl req -newkey rsa:4096 -nodes -keyout key.pem \ +# -x509 -days 365 -out cert.pem +# - 生产环境推荐使用 Let's Encrypt 免费证书: +# certbot certonly --standalone -d your-node.example.com +# - Let's Encrypt 证书路径: +# /etc/letsencrypt/live/your-domain/fullchain.pem +#rpc-ssl-certificate=/path/to/your/certificate.pem + +# rpc-ssl-private-key: SSL 私钥文件路径 +# - PEM 格式的私钥文件 +# - ⚠️ 安全要求: +# * 文件权限必须是 600 (chmod 600 key.pem) +# * 所有者必须是运行 mond 的用户 +# * 不要将私钥文件暴露到公共位置 +# - Let's Encrypt 私钥路径: +# /etc/letsencrypt/live/your-domain/privkey.pem +#rpc-ssl-private-key=/path/to/your/private_key.pem + +# rpc-ssl-ca-certificates: CA 证书路径(可选) +# - 用于验证客户端证书(双向 SSL) +# - 大多数情况下不需要 +#rpc-ssl-ca-certificates=/path/to/ca-bundle.pem + +# rpc-ssl-allow-any-cert: 允许任何证书(不推荐) +# - 1 = 禁用客户端证书验证 +# - 0 = 验证客户端证书(默认) +# - ⚠️ 仅用于测试,生产环境不要启用 +#rpc-ssl-allow-any-cert=0 + +# rpc-access-control-origins: CORS 跨域访问控制(可选) +# - 允许从特定域名的 Web 应用访问 RPC +# - 格式: http://domain.com 或多个域名用逗号分隔 +# - 用于 Web 钱包、区块浏览器等前端应用 +# - 示例: https://wallet.example.com,https://explorer.example.com +# - 使用 * 允许所有域名(不推荐) +#rpc-access-control-origins=https://your-domain.com + +# LOGGING SETTINGS +# ============================================================================ +# log-level: 日志详细程度 +# - 0 = 最小化日志(仅关键错误) +# - 1 = 错误级别(推荐用于生产环境) +# - 2 = 警告级别(包含潜在问题) +# - 3 = 信息级别(当前设置,常规操作信息) +# - 4 = 调试级别(详细的调试信息,仅用于故障排查) +# - 更高级别 = 更多日志输出,但也消耗更多磁盘 I/O +# - 建议: +# * 生产环境: 1 或 2 +# * 开发/调试: 3 或 4 +# * 初始同步: 3(监控同步进度) +log-level=3 + +# log-file: 日志文件保存路径 +# - 所有日志输出将写入此文件 +# - 确保目录存在且有写入权限 +# - 文件会自动轮转(达到一定大小后创建新文件) +# - 查看日志命令: +# tail -f /var/log/mond/mond.log (实时查看) +# grep ERROR /var/log/mond/mond.log (搜索错误) +# - 日志管理: +# * 定期清理旧日志释放磁盘空间 +# * 可配合 logrotate 自动管理 +# * 推荐保留最近 7-30 天的日志 +log-file=/var/log/mond/mond.log + +# max-log-file-size: 单个日志文件最大大小(字节) +# - 达到此大小后自动创建新日志文件 +# - 默认: 104850000 (约 100 MB) +# - 推荐值: 10485760 (10 MB) 到 104857600 (100 MB) +# - 示例: max-log-file-size=52428800 # 50 MB +#max-log-file-size=104850000 + +# max-log-files: 保留的日志文件数量 +# - 超过此数量后删除最旧的日志文件 +# - 默认: 50 +# - 计算存储空间: max-log-file-size * max-log-files +# - 示例: 如果单文件 50MB,保留 20 个文件 = 1GB 空间 +#max-log-files=50 + +# ADVANCED OPTIONS (COMMENTED OUT) +# ============================================================================ +# 以下是一些高级选项,默认不启用,根据需求取消注释 + +# --- 数据库设置 --- +# db-sync-mode: 数据库同步模式 +# - fast:async:250000000bytes = 快速异步模式(默认,推荐) +# - fast:sync = 快速同步模式(更安全但稍慢) +# - fastest:async:250000000bytes = 最快模式(性能优先) +# - safe = 最安全模式(每次写入都刷盘,非常慢) +# 影响: 同步速度 vs 断电时的数据完整性 +#db-sync-mode=fast:async:250000000bytes + +# --- 区块同步设置 --- +# block-sync-size: 每次同步请求的区块数量 +# - 默认: 20 +# - 范围: 1-100,更大的值可能加快同步但消耗更多内存 +#block-sync-size=20 + +# prep-blocks-threads: 预处理区块的线程数 +# - 默认: 4 +# - 根据 CPU 核心数调整,建议为核心数的 50-100% +#prep-blocks-threads=4 + +# --- 带宽和连接设置 --- +# max-txpool-weight: 交易池最大权重(字节) +# - 默认: 648000000 (约 618 MB) +# - 限制内存中未确认交易的总大小 +#max-txpool-weight=648000000 + +# pad-transactions: 填充交易大小(隐私增强) +# - 1 = 启用,将交易填充到标准大小 +# - 0 = 禁用(默认) +# - 增强隐私但增加交易费用 +#pad-transactions=0 + +# --- 挖矿设置 --- +# start-mining: 启动时开始挖矿 +# - 格式: 钱包地址 +# - 不推荐在 mond 直接挖矿,应使用专用挖矿软件或 P2Pool +#start-mining=YOUR_WALLET_ADDRESS + +# mining-threads: 挖矿线程数 +# - 仅在 start-mining 启用时有效 +# - 推荐: CPU 核心数的 50-75% +#mining-threads=2 + +# --- 匿名网络支持 --- +# tx-proxy: 通过代理发送交易(增强隐私) +# - 格式: socks4a://IP:PORT 或 i2p://address +# - 用于通过 Tor/I2P 广播交易 +# - 示例(Tor): tx-proxy=socks4a://127.0.0.1:9050 +#tx-proxy=socks4a://127.0.0.1:9050 + +# anonymous-inbound: 匿名网络入站地址 +# - 格式: address,port[,max_connections] +# - 允许通过 Tor/I2P 接收连接 +# - 示例: anonymous-inbound=your_onion_address.onion:18083,127.0.0.1:18083,25 +#anonymous-inbound=your_address.onion:18083,127.0.0.1:18083 + +# --- 性能优化 --- +# max-concurrency: 最大并发线程数 +# - 默认: 0(自动检测 CPU 核心数) +# - 手动设置可限制 CPU 使用 +#max-concurrency=0 + +# db-salvage: 尝试修复损坏的数据库 +# - 1 = 启动时检查并修复 +# - 0 = 不自动修复(默认) +# - 仅在数据库损坏时使用 +#db-salvage=0 + +# --- 网络类型 --- +# testnet: 使用测试网络 +# - 1 = 启用测试网(用于开发测试) +# - 0 = 使用主网(默认) +#testnet=0 + +# stagenet: 使用预发布网络 +# - 1 = 启用预发布网(开发者测试环境) +# - 0 = 使用主网(默认) +#stagenet=0 \ No newline at end of file diff --git a/debian/postinst b/debian/postinst index 50a52e5..44b28d1 100755 --- a/debian/postinst +++ b/debian/postinst @@ -30,45 +30,91 @@ if [ ! -f /var/lib/mond/params.conf ]; then # Edit this file to customize your Mond daemon settings # After modifying, restart the service: sudo systemctl restart mond.service -# Data directory - where blockchain data is stored +# DATA STORAGE +# ============================================================================ +# data-dir: 区块链数据存储目录 data-dir=/var/lib/mond/data -# Blockchain pruning - reduces disk usage by pruning old blockchain data +# BLOCKCHAIN PRUNING +# ============================================================================ +# prune-blockchain: 启用区块链修剪模式 prune-blockchain=1 -# ZMQ pub socket for notifications -zmq-pub=tcp://127.0.0.1:18083 +# sync-pruned-blocks: 同步已修剪的区块(默认启用) +sync-pruned-blocks=1 -# Network peer settings +# NETWORK PEER SETTINGS +# ============================================================================ +# out-peers: 主动连接的对等节点数量(出站连接) out-peers=32 + +# in-peers: 接受连接的对等节点数量(入站连接) in-peers=64 -# Priority nodes - trusted nodes to connect to +# limit-rate-up: 上传速率限制(kB/s) +limit-rate-up=1048576 + +# limit-rate-down: 下载速率限制(kB/s) +limit-rate-down=1048576 + +# PRIORITY NODES +# ============================================================================ +# add-priority-node: 优先连接的可信节点 add-priority-node=p2pmd.xmrvsbeast.com:18080 add-priority-node=nodes.hashvault.pro:18080 -# DNS checkpointing and blocklist +# SECURITY AND NETWORK INTEGRITY +# ============================================================================ +# enforce-dns-checkpointing: 强制执行 DNS 检查点验证 enforce-dns-checkpointing=1 + +# enable-dns-blocklist: 启用 DNS 黑名单 enable-dns-blocklist=1 -# P2P and RPC bind settings -#p2p-bind-ip=0.0.0.0 -#p2p-bind-port=18080 +# ZMQ NOTIFICATION SYSTEM +# ============================================================================ +# zmq-pub: ZeroMQ 发布接口,用于实时广播区块链事件 +zmq-pub=tcp://127.0.0.1:18083 + +# P2P AND RPC NETWORK BINDING +# ============================================================================ +# p2p-bind-ip: P2P 网络监听地址(默认启用,绑定所有网络接口) +p2p-bind-ip=0.0.0.0 + +# p2p-bind-port: P2P 网络监听端口 +p2p-bind-port=18080 + +# rpc-bind-ip: RPC 接口监听地址 #rpc-bind-ip=0.0.0.0 + +# rpc-bind-port: RPC 接口监听端口 #rpc-bind-port=18081 + +# confirm-external-bind: 确认外部网络绑定 #confirm-external-bind=1 -# RPC login credentials +# RPC AUTHENTICATION +# ============================================================================ +# rpc-login: RPC 访问认证凭据 #rpc-login=user:password -# Enable SSL for RPC connections -#rpc-ssl=1 +# RPC SSL/TLS ENCRYPTION +# ============================================================================ +# rpc-ssl: 启用 RPC 连接的 SSL/TLS 加密(语义更清晰的启用方式) +#rpc-ssl=enabled + +# rpc-ssl-certificate: SSL 证书文件路径 #rpc-ssl-certificate=/path/to/your/certificate.pem + +# rpc-ssl-private-key: SSL 私钥文件路径 #rpc-ssl-private-key=/path/to/your/private_key.pem -# Logging settings -# Log levels: 0=minimal, 1=errors, 2=warnings, 3=info, 4=debug -log-level=3 +# LOGGING SETTINGS +# ============================================================================ +# log-level: 日志详细程度(调整为详细日志级别) +log-level=1 + +# log-file: 日志文件保存路径 log-file=/var/log/mond/mond.log EOF chown mond:mond /var/lib/mond/params.conf diff --git a/llmdoc/index.md b/llmdoc/index.md index bc8aa59..86e1a96 100644 --- a/llmdoc/index.md +++ b/llmdoc/index.md @@ -7,6 +7,7 @@ Mond 是一个基于 Monero 的区块链项目,专注于隐私和去中心化 ### 项目概览 - [项目背景](/overview/project-overview.md) +- [系统配置参考](/reference/configuration.md) ### 构建指南 - [如何构建项目](/guides/how-to-build.md) @@ -16,3 +17,4 @@ Mond 是一个基于 Monero 的区块链项目,专注于隐私和去中心化 ### 参考 - [常见问题](/reference/faq.md) +- [配置文件详解](/reference/configuration.md) \ No newline at end of file diff --git a/llmdoc/reference/configuration.md b/llmdoc/reference/configuration.md index 36fc7cb..6f9f0f3 100644 --- a/llmdoc/reference/configuration.md +++ b/llmdoc/reference/configuration.md @@ -7,7 +7,7 @@ Debian/Ubuntu 系统包安装后,Mond 使用配置文件方式运行: - **配置文件位置**: `/var/lib/mond/params.conf` -- **配置文件格式**: INI 格式,每行一个配置项 +- **配置文件格式**: INI 格式,每行一个配置项,采用双语注释(英文大写标题 + 中文详细说明) - **修改后生效**: 修改配置文件后需要重启服务 ```bash @@ -21,44 +21,91 @@ sudo systemctl restart mond.service ### 配置文件示例 ```ini -# 数据目录 +# DATA STORAGE +# ============================================================================ +# data-dir: 区块链数据存储目录 data-dir=/var/lib/mond/data -# 区块链修剪 +# BLOCKCHAIN PRUNING +# ============================================================================ +# prune-blockchain: 启用区块链修剪模式 prune-blockchain=1 -# ZMQ 发布端口 -zmq-pub=tcp://127.0.0.1:18083 +# sync-pruned-blocks: 同步已修剪的区块(默认启用) +sync-pruned-blocks=1 -# 网络对等节点设置 +# NETWORK PEER SETTINGS +# ============================================================================ +# out-peers: 主动连接的对等节点数量(出站连接) out-peers=32 + +# in-peers: 接受连接的对等节点数量(入站连接) in-peers=64 -# 优先节点 +# limit-rate-up: 上传速率限制(kB/s) +limit-rate-up=1048576 + +# limit-rate-down: 下载速率限制(kB/s) +limit-rate-down=1048576 + +# PRIORITY NODES +# ============================================================================ +# add-priority-node: 优先连接的可信节点 add-priority-node=p2pmd.xmrvsbeast.com:18080 add-priority-node=nodes.hashvault.pro:18080 -# DNS 检查点和黑名单 +# SECURITY AND NETWORK INTEGRITY +# ============================================================================ +# enforce-dns-checkpointing: 强制执行 DNS 检查点验证 enforce-dns-checkpointing=1 + +# enable-dns-blocklist: 启用 DNS 黑名单 enable-dns-blocklist=1 -# P2P 和 RPC 绑定设置 -#p2p-bind-ip=0.0.0.0 -#p2p-bind-port=18080 +# ZMQ NOTIFICATION SYSTEM +# ============================================================================ +# zmq-pub: ZeroMQ 发布接口,用于实时广播区块链事件 +zmq-pub=tcp://127.0.0.1:18083 + +# P2P AND RPC NETWORK BINDING +# ============================================================================ +# p2p-bind-ip: P2P 网络监听地址(默认启用,绑定所有网络接口) +p2p-bind-ip=0.0.0.0 + +# p2p-bind-port: P2P 网络监听端口 +p2p-bind-port=18080 + +# rpc-bind-ip: RPC 接口监听地址 #rpc-bind-ip=0.0.0.0 + +# rpc-bind-port: RPC 接口监听端口 #rpc-bind-port=18081 + +# confirm-external-bind: 确认外部网络绑定 #confirm-external-bind=1 -# RPC 认证 +# RPC AUTHENTICATION +# ============================================================================ +# rpc-login: RPC 访问认证凭据 #rpc-login=user:password -# 启用 RPC SSL -#rpc-ssl=1 +# RPC SSL/TLS ENCRYPTION +# ============================================================================ +# rpc-ssl: 启用 RPC 连接的 SSL/TLS 加密(语义更清晰的启用方式) +rpc-ssl=enabled + +# rpc-ssl-certificate: SSL 证书文件路径 #rpc-ssl-certificate=/path/to/your/certificate.pem + +# rpc-ssl-private-key: SSL 私钥文件路径 #rpc-ssl-private-key=/path/to/your/private_key.pem -# 日志设置 +# LOGGING SETTINGS +# ============================================================================ +# log-level: 日志详细程度(调整为详细日志级别) log-level=1 + +# log-file: 日志文件保存路径 log-file=/var/log/mond/mond.log ```