Files
mond/README.md
Wang Defa 66ec4df557 docs: 更新 README.md 构建说明
- 移除 Alpine Linux 支持说明
- 强调纯静态链接特性
- 详细说明 Docker 多架构构建流程
- 添加静态链接验证方法
- 更新构建环境要求
- 更新本地构建说明
2025-12-15 14:52:53 +08:00

245 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Mond
> Monero daemon 的定制版本
[![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)
## 🎯 主要特性
- 🏗️ **多架构支持** - 原生支持 AMD64 和 ARM64 架构
- 📦 **多种安装方式** - 提供 Debian 包和通用二进制包
- 🐧 **多发行版兼容** - 支持 Ubuntu 和 Debian
- 🔗 **纯静态链接** - 无需依赖,可在任意 Linux 系统运行
- 🔒 **隐私优先** - 基于 Monero 的隐私保护技术
- 🔄 **自动更新** - 通过 Debian 仓库轻松安装和更新
## 🚀 快速开始
### 方式一Debian/Ubuntu推荐
#### Debian 12 (Bookworm)
```bash
# 1. 下载并添加 GPG 密钥
sudo curl https://gitea.bcde.io/api/packages/wangdefa/debian/repository.key \
-o /etc/apt/keyrings/gitea-wangdefa.asc
# 2. 添加软件源
echo "deb [signed-by=/etc/apt/keyrings/gitea-wangdefa.asc] https://gitea.bcde.io/api/packages/wangdefa/debian bookworm main" | \
sudo tee -a /etc/apt/sources.list.d/wangdefa.list
# 3. 安装
sudo apt-get update
sudo apt-get install mond
```
#### Debian 13 (Trixie)
```bash
# 1. 下载并添加 GPG 密钥
sudo curl https://gitea.bcde.io/api/packages/wangdefa/debian/repository.key \
-o /etc/apt/keyrings/gitea-wangdefa.asc
# 2. 添加软件源
echo "deb [signed-by=/etc/apt/keyrings/gitea-wangdefa.asc] https://gitea.bcde.io/api/packages/wangdefa/debian trixie main" | \
sudo tee -a /etc/apt/sources.list.d/wangdefa.list
# 3. 安装
sudo apt-get update
sudo apt-get install mond
```
### 方式二:通用二进制包
```bash
# 1. 下载对应架构的包
wget https://gitea.bcde.io/releases/download/VERSION/mond-amd64-ubuntu-VERSION.tar.gz
# 2. 解压
tar -xzf mond-amd64-ubuntu-VERSION.tar.gz
# 3. 运行
./mond --help
```
## 📋 使用说明
### Debian/Ubuntu 系统服务
#### 启动服务
```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 # 二进制文件
/var/lib/mond/ # 区块链数据目录
/var/log/mond/ # 日志目录
```
#### 通用二进制包
```
./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 和官方 depends 系统构建,确保纯静态链接。
#### 构建多架构二进制文件
```bash
# 构建 amd64 和 arm64 架构
docker buildx build --platform linux/amd64,linux/arm64 \
-f docker/Dockerfile.ubuntu \
--output type=local,dest=./output .
```
#### 构建单一架构
```bash
# 仅构建 amd64
docker buildx build --platform linux/amd64 \
-f docker/Dockerfile.ubuntu \
--output type=local,dest=./output .
# 仅构建 arm64
docker buildx build --platform linux/arm64 \
-f docker/Dockerfile.ubuntu \
--output type=local,dest=./output .
```
#### 验证静态链接
```bash
# 检查二进制文件是否为纯静态链接
ldd output/linux_amd64/mond
# 预期输出: "not a dynamic executable"
file output/linux_amd64/mond
# 预期输出: "statically linked"
```
### 本地构建
如果不使用 Docker可以手动构建
```bash
# 1. 克隆并准备源代码
git clone https://github.com/monero-project/monero.git .source
cd .source
git checkout v0.18.3.4
git submodule update --init --force
# 2. 应用修改
../init.sh
# 3. 使用 depends 系统构建(推荐)
make -j$(nproc) depends target=x86_64-linux-gnu
# 二进制文件位于: build/x86_64-linux-gnu/release/bin/mond
# 或者简单构建(需要手动安装依赖)
mkdir -p build/release && cd build/release
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI_DEPS=OFF
make -j$(nproc) daemon
```
### 构建环境要求
- **操作系统**: Ubuntu 20.04(推荐)或更新版本
- **CPU**: 多核 CPU构建时间约 30-60 分钟)
- **内存**: 至少 4GB RAM
- **磁盘**: 至少 10GB 可用空间
- **Docker**: 如使用 Docker 构建,需安装 Docker 和 buildx
## 📝 许可证
本项目基于 BSD-3-Clause 许可证开源。
- 原始项目:[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 项目。