精简 README,对齐 xxxig/p2pool 等项目风格
Build and Release Mond / build-and-test (amd64) (push) Successful in 5s
Build and Release Mond / build-and-test (arm64) (push) Successful in 31s
Build and Release Mond / release (push) Has been skipped

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 15:00:49 +08:00
co-authored by Claude Opus 4.8
parent b44b118be7
commit 4b587550a1
+70 -184
View File
@@ -1,216 +1,102 @@
# Mond
> Monero daemon 的定制版本
Mond 是 [Monero](https://github.com/monero-project/monero) 守护进程 `monerod` 的定制换名构建——Monero 全节点,负责 P2P 同步区块链、提供 RPC。换名(`monero→mond``monerod→mond``MONERO_*→MOND_*`)由 [init.sh](init.sh) 在构建期对官方源码做 `sed` 改写完成,不维护源码分叉。
[![License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](LICENSE)
[![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)](.gitea/workflows/ci.yaml)
**本仓库只包含构建与打包基础设施**,不含 mond 源码:二进制在 CI 中从上游官方仓库 `github.com/monero-project/monero` 编译(init.sh 现场换名),再打包分发到 [gitea.bcde.io](https://gitea.bcde.io) 的 Generic / Debian 包仓库。
## 🎯 主要特性
## 产物
- 🏗️ **多架构支持** - 原生支持 AMD64 和 ARM64 架构
- 📦 **多种安装方式** - 提供 Debian 包和通用二进制包
- 🐧 **跨发行版** - musl 纯静态二进制,glibc/musl 任意发行版(Ubuntu/Debian/CentOS/Alpine)直接运行
- 🔗 **零依赖** - 所有库(boost/OpenSSL/ZMQ/sodium/unbound 及 libc)全部静态链入,`ldd` 显示 `statically linked`,无任何动态依赖
- 🔒 **隐私优先** - 基于 Monero 的隐私保护技术
- 🔄 **自动更新** - 通过 Debian 仓库轻松安装和更新
每次构建产出单个可执行文件(musl 纯静态,boost/OpenSSL/libzmq/libsodium/unbound/expat 及 libc 全部静态链入,无外部动态库依赖,任意 Linux 发行版可跑):
## 🚀 快速开始
| 二进制 | 作用 |
|---|---|
| `mond` | Monero 全节点守护进程:P2P 同步区块链、提供 RPC |
### Debian/Ubuntu(推荐)
支持架构 `amd64` / `arm64`musl 纯静态(static-pie),任意 Linux 发行版(Debian/Ubuntu/Alpine/CentOS 等)开箱即跑。
## 安装
### APTDebian / Ubuntu
```bash
# 下载 GPG 密钥
sudo curl https://gitea.bcde.io/api/packages/wangdefa/debian/repository.key -o /etc/apt/keyrings/gitea-wangdefa.asc
# 添加仓库
echo "deb [signed-by=/etc/apt/keyrings/gitea-wangdefa.asc] https://gitea.bcde.io/api/packages/wangdefa/debian stable main" | sudo tee -a /etc/apt/sources.list.d/wangdefa.list
# 更新并安装
sudo apt-get update
sudo apt-get install mond
echo "deb [signed-by=/etc/apt/keyrings/gitea-wangdefa.asc] https://gitea.bcde.io/api/packages/wangdefa/debian stable main" | sudo tee /etc/apt/sources.list.d/wangdefa.list
sudo apt-get update && sudo apt-get install mond
```
### 方式二:通用二进制包
安装布局:
| | 路径 |
|---|---|
| 二进制 | `/opt/mond/mond` |
| 默认配置 | `/opt/mond/params.conf`postinst 复制到 `/etc/mond/params.conf` |
| 数据 | `/var/lib/mond/data` |
| 日志 | `/var/log/mond/` |
| 服务 | `mond.service` |
> 安装后服务**不会自动启动**(首次全节点同步前需确认配置)。按需编辑 `/etc/mond/params.conf`,再启用:
>
> ```bash
> sudo systemctl enable --now mond
> ```
### tar.gz(通用:Alpine / Ubuntu / Debian
从 Generic Package Registry 下载对应架构的 tar.gz,解压即用(单二进制):
```bash
# 1. 下载对应架构的包(registry 路径与下载名版本号均不带 v 前缀)
wget https://gitea.bcde.io/api/packages/wangdefa/generic/mond/0.18.5.0/mond-amd64-linux-static-0.18.5.0.tar.gz
# 2. 解压
tar -xzf mond-amd64-linux-static-0.18.5.0.tar.gz
# 3. 运行
./mond --help
curl -fSL -o mond.tar.gz \
https://gitea.bcde.io/api/packages/wangdefa/generic/mond/0.18.5.0/mond-amd64-linux-static-0.18.5.0.tar.gz
tar -xzf mond.tar.gz
./mond --config-file params.conf # 配置模板见仓库 conf/params.example.conf
```
## 📋 使用说明
## 构建与发布
### Debian/Ubuntu 系统服务
CI 定义于 [.gitea/workflows/ci.yaml](.gitea/workflows/ci.yaml)
#### 启动服务
- **push 到 `main`/`develop`**:矩阵 `arch=[amd64,arm64]`,在原生 runner 上用 Dockermusl 纯静态)编译为 tar.gz 并打 `.deb`
- **打 tag**:产物上传到 Generic / Debian 包仓库并创建 Release。
musl 纯静态在 `alpine:3.23` 下手编 5 个静态库(OpenSSL/libsodium/libzmq/expat/unbound——Alpine 仓库只有 `.so`/缺 `.a`)并 patch monero CMakeLists(去 `-pie`、Linux `STATIC_FLAGS` 改真 `-static`),产出 static-pie 零依赖二进制。换名 + patch 逻辑见 [init.sh](init.sh)。
本地构建:
```bash
# 启用并启动服务
sudo systemctl enable mond.service
sudo systemctl start mond.service
# 查看状态
sudo systemctl status mond.service
# 查看日志
sudo journalctl -u mond -f
```
#### 停止服务
```bash
sudo systemctl stop mond.service
sudo systemctl disable mond.service
```
### 直接运行
```bash
# 基本运行
./mond
# 指定数据目录
./mond --data-dir=/path/to/data
# 指定日志文件
./mond --log-file=/path/to/log
# 后台运行
./mond --detach
```
## ⚙️ 配置说明
### 目录结构
#### Debian/Ubuntu 系统包
```
/opt/mond/mond # 二进制文件
/etc/mond/params.conf # 配置文件
/var/lib/mond/data/ # 区块链数据目录
/var/log/mond/ # 日志目录
```
### 修改配置
Debian/Ubuntu 系统包使用配置文件方式运行,修改配置非常简单:
```bash
# 1. 编辑配置文件
sudo nano /etc/mond/params.conf
# 2. 重启服务使配置生效
sudo systemctl restart mond.service
```
**优势**:配置文件在升级时不会被覆盖,您的自定义设置会被保留。
#### 通用二进制包
```
./mond # 二进制文件
```
### 常用命令行选项
```bash
--data-dir <path> # 指定数据目录
--log-file <path> # 指定日志文件路径
--log-level <level> # 日志级别 (0-4)
--detach # 后台运行
--rpc-bind-ip <ip> # RPC 绑定 IP (默认: 127.0.0.1)
--rpc-bind-port <port> # RPC 绑定端口 (默认: 18081)
--p2p-bind-ip <ip> # P2P 绑定 IP (默认: 0.0.0.0)
--p2p-bind-port <port> # P2P 绑定端口 (默认: 18080)
```
## 🔄 修改内容
本项目基于 [Monero](https://github.com/monero-project/monero) 进行以下修改:
1. **项目重命名**`monero``mond`
2. **二进制文件名**`monerod``mond`
3. **版本标识**`MONERO_*``MOND_*`
所有修改通过 [init.sh](init.sh) 在构建过程中自动应用。
## 🏗️ 构建说明
### Docker 构建(推荐)
本项目使用 Docker + Alpine/musl 构建:手动源码编译 5 个静态库(OpenSSL/libsodium/libzmq/expat/unbound)并 patch monero CMakeLists,产出 static-pie 纯静态二进制(零外部依赖、跨发行版)。
#### 构建多架构二进制文件
```bash
# 构建 amd64 和 arm64 架构
docker buildx build --platform linux/amd64,linux/arm64 \
-f docker/Dockerfile \
--output type=local,dest=./output .
```
#### 构建单一架构
```bash
# 仅构建 amd64
# 编译某架构二进制(输出到 ./output/linux_<arch>/mond
docker buildx build --platform linux/amd64 \
-f docker/Dockerfile \
--output type=local,dest=./output .
--build-arg MONERO_VERSION=v0.18.5.0 \
--output type=local,dest=./output \
-f docker/Dockerfile .
# 仅构建 arm64
docker buildx build --platform linux/arm64 \
-f docker/Dockerfile \
--output type=local,dest=./output .
```
#### 验证依赖
```bash
# 纯静态校验:应输出 "statically linked"(零外部依赖,可在 glibc/musl 任意发行版运行)
# 校验纯静态(应输出 "statically linked"
ldd output/linux_amd64/mond
# 预期: statically linked
# 用产物 tar.gz 打 .deb
./debian/build-deb.sh amd64 0.18.5.0 mond-amd64-linux-static-0.18.5.0.tar.gz
```
### 本地构建
## 版本号约定
纯静态构建需在 Alpine 下手编 5 个静态库(OpenSSL/libsodium/libzmq/expat/unbound)并 patch monero CMakeLists,步骤已固化在 [docker/Dockerfile](docker/Dockerfile)——**直接用上面的 Docker 构建即可**,无需手动复现。换名 + patch 逻辑见 [init.sh](init.sh)
- **上游源码 git tag** 带 `v`(如 `v0.18.5.0`),CI 用 `MONERO_VERSION=v${PACKAGE_VERSION}` 检出
- **包版本**tar.gz / deb / registry 路径)一律用数字(如 `0.18.5.0`),符合 Debian 版本规范。
### 构建环境要求
发版只需改 ci.yaml 的 `PACKAGE_VERSION`
- **构建镜像**: `alpine:3.23`Dockerfile 内置,无需本机安装)
- **CPU**: 多核 CPU`make daemon` 约 7 分钟/架构,5 库命中缓存后)
- **内存**: 至少 4GB RAM
- **磁盘**: 至少 10GB 可用空间
- **Docker**: 需安装 Docker 和 buildx
## 修改内容
## 📝 许可证
基于 [Monero](https://github.com/monero-project/monero)BSD-3-Clause),由 [init.sh](init.sh) 在构建期自动应用,不维护源码分叉:
本项目基于 BSD-3-Clause 许可证开源。
- 项目名 `monero``mond`
- 二进制 `monerod``mond`
- 版本宏 `MONERO_*``MOND_*`
- 原始项目:[Monero](https://github.com/monero-project/monero) (BSD-3-Clause)
- 修改内容:详见 [init.sh](init.sh)
## 目录结构
## 🙏 致谢
- [Monero Project](https://github.com/monero-project/monero) - 原始项目和核心技术
## ⚠️ 免责声明
本软件仅供学习和研究使用。使用本软件进行任何活动请遵守当地法律法规。作者不对使用本软件造成的任何损失或法律问题负责。
## 📞 支持
如有问题或建议,请通过以下方式联系:
- 提交 Issue
- 发送 Pull Request
---
**注意**:本项目是 Monero 的定制版本,不代表官方 Monero 项目。
```
.gitea/workflows/ CI 流水线
docker/ Dockerfile(musl 纯静态,从上游官方源码编译 + init.sh 换名)
debian/ .deb 打包:control 模板、维护脚本、systemd 服务
conf/ params.example.conf 默认配置模板
init.sh 构建期换名 + 静态 patch 脚本
```