7 Commits
Author SHA1 Message Date
wangdefaandClaude Opus 4.8 b44b118be7 改用 musl 全静态构建,零依赖跨发行版
Build and Release Mond / release (push) Successful in 19s
Build and Release Mond / build-and-test (amd64) (push) Successful in 4m11s
Build and Release Mond / build-and-test (arm64) (push) Successful in 9m19s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 12:03:43 +08:00
wangdefaandClaude Opus 4.8 5430297ff9 fix: 版本变量改 PACKAGE_VERSION、CI 触发 tags['*']、修正静态措辞
Build and Release Mond / build-and-test (amd64) (push) Successful in 1s
Build and Release Mond / build-and-test (arm64) (push) Successful in 35s
Build and Release Mond / release (push) Successful in 16s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 22:30:53 +08:00
wangdefaandClaude Opus 4.8 317973e94d feat: 对齐 xxxig/proxy 打包规范并迁移配置至 /etc/mond
Build and Release Mond / build-and-test (amd64) (push) Successful in 11m47s
Build and Release Mond / build-and-test (arm64) (push) Successful in 18m24s
Build and Release Mond / release (push) Has been skipped
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 22:00:48 +08:00
wangdefa 2862374985 feat: 更新 Monero 版本至 v0.18.4.6,并调整相关文档和脚本
Build and Release Mond / build-and-test (arm64) (push) Successful in -17s
Build and Release Mond / build-and-test (amd64) (push) Successful in -1m16s
Build and Release Mond / release (push) Successful in -1m6s
2026-03-14 16:42:07 +08:00
wangdefa 1faa92266e fix: 修复 apt 升级后服务需要手动重新启用的问题
Build and Release Mond / build-and-test (arm64) (push) Successful in -17s
Build and Release Mond / build-and-test (amd64) (push) Successful in -19s
Build and Release Mond / release (push) Has been skipped
- 修改 prerm 脚本,升级时只停止服务不禁用
- 修改 postinst 脚本,升级后自动重启已启用的服务
- 首次安装仍保持手动启用服务的行为
2026-01-21 12:40:29 +08:00
wangdefa 2d47652a06 feat: 更新 .gitignore 文件,添加 macOS 系统文件排除项
Build and Release Mond / build-and-test (arm64) (push) Successful in -18s
Build and Release Mond / build-and-test (amd64) (push) Successful in -18s
Build and Release Mond / release (push) Successful in -3s
2026-01-21 12:01:31 +08:00
wangdefa b70d968390 feat: 删除过时的文档文件,精简项目文档结构 2026-01-21 11:59:29 +08:00
26 changed files with 262 additions and 937 deletions
+44 -18
View File
@@ -4,12 +4,12 @@ name: Build and Release Mond
on:
push:
branches: [main, master, develop]
tags: ['v*']
tags: ['*']
env:
DOCKER_BUILDKIT: "1"
PRODUCT_NAME: "mond"
MONERO_VERSION: "v0.18.4.5"
PACKAGE_VERSION: "0.18.5.0"
BUILDX_NO_DEFAULT_ATTESTATIONS: "1"
jobs:
@@ -35,11 +35,7 @@ jobs:
- name: Build binaries
run: |
PLATFORM="linux/${{ matrix.arch }}"
echo "🏗️ Building ${PLATFORM} on native ${{ matrix.arch }} runner"
echo "📦 Using Ubuntu 20.04 with depends system"
echo "📦 Monero Version: ${MONERO_VERSION}"
echo "🔗 Static linking enabled"
MONERO_VERSION="v${PACKAGE_VERSION}" # 上游 Monero git tag 带 v 前缀,需补回
# 设置 BuildKit 优化参数
export BUILDKIT_PROGRESS=plain
@@ -48,13 +44,13 @@ jobs:
--platform ${PLATFORM} \
--build-arg MONERO_VERSION=${MONERO_VERSION} \
--output type=local,dest=./output \
-f docker/Dockerfile.ubuntu .
-f docker/Dockerfile .
- name: Package and test
run: |
DIR="./output/linux_${{ matrix.arch }}"
VERSION=${MONERO_VERSION#v} # 移除前导 v
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-ubuntu-${VERSION}.tar.gz"
VERSION=${PACKAGE_VERSION}
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-linux-static-${VERSION}.tar.gz"
tar -czf "${TARGZ}" -C "$DIR" .
@@ -64,6 +60,12 @@ jobs:
# 快速验证
mkdir -p test && tar -xzf "${TARGZ}" -C test
test/mond --version 2>/dev/null || echo "⚠️ 跳过版本检查"
# 依赖校验:musl fully-staticldd 应为 "statically linked"(零外部依赖,glibc/musl 均可直接运行)
if ldd test/mond 2>&1 | grep -qE 'statically linked|not a dynamic executable'; then
echo "✅ fully-static(无任何动态依赖,跨发行版)"
else
echo "⚠️ 非纯静态,仍有动态依赖:"; ldd test/mond
fi
rm -rf test
- name: Build Debian package
@@ -71,12 +73,12 @@ jobs:
# 安装 dpkg-deb(如果需要)
sudo apt-get update && sudo apt-get install -y dpkg-dev
DIR="./output/linux_${{ matrix.arch }}"
VERSION=${MONERO_VERSION#v} # 移除前导 v
VERSION=${PACKAGE_VERSION}
TARGZ="${PRODUCT_NAME}-${{ matrix.arch }}-linux-static-${VERSION}.tar.gz"
echo "📦 Building Debian package for ${{ matrix.arch }}..."
chmod +x debian/build-deb.sh
./debian/build-deb.sh ${{ matrix.arch }} ${VERSION} "${DIR}"
./debian/build-deb.sh ${{ matrix.arch }} ${VERSION} "${TARGZ}"
ls -lh *.deb
@@ -110,12 +112,13 @@ jobs:
REGISTRY=$(echo "${{ gitea.server_url }}" | sed 's|https\?://||')
OWNER="${{ gitea.repository_owner }}"
REPO_NAME=$(echo "${{ gitea.repository }}" | cut -d'/' -f2)
VERSION="${TAG#v}" # 包版本:去掉 git tag 的 v 前缀(registry 路径/下载名/Release 标题统一用)
echo "📦 上传包到 Generic Package Registry..."
echo " Registry: ${REGISTRY}"
echo " Owner: ${OWNER}"
echo " Package: ${PRODUCT_NAME}"
echo " Version: ${TAG}"
echo " Version: ${VERSION}"
# 上传所有 tar.gz 包到 Generic Package Registry
for file in *.tar.gz; do
@@ -124,7 +127,7 @@ jobs:
curl -fsSL -X PUT \
-H "Authorization: token ${TOKEN}" \
--upload-file "$file" \
"https://${REGISTRY}/api/packages/${OWNER}/generic/${PRODUCT_NAME}/${TAG}/$file" || {
"https://${REGISTRY}/api/packages/${OWNER}/generic/${PRODUCT_NAME}/${VERSION}/$file" || {
echo "❌ 上传失败: $file"
exit 1
}
@@ -147,12 +150,35 @@ jobs:
}
done
# 生成 Release JSON payload
# 生成 Release 描述
echo ""
echo "📝 生成 Release..."
export REGISTRY OWNER TAG
RELEASE_DATA=$(python3 -c 'import json,glob,os;r=os.environ["REGISTRY"];o=os.environ["OWNER"];p=os.environ["PRODUCT_NAME"];t=os.environ["TAG"];b=["## Release "+t,"","Mond 是 Monero 守护进程 (monerod) 的定制版本。","","### ✨ 主要特性","","- 🔗 **纯静态链接** - 无需依赖,可在任意 Linux 系统运行","- 🏗️ **多架构支持** - 原生支持 AMD64 和 ARM64","- 📦 **官方构建系统** - 使用 Monero 官方 depends 系统构建,确保可靠性","","### 📥 下载方式","","#### 方式一:直接下载(推荐)","","点击下方 **Assets** 区域的文件名直接下载。","","**可用安装包:**",""]+[f"- [`{f}`](https://{r}/api/packages/{o}/generic/{p}/{t}/{f})" for f in sorted(glob.glob("*.tar.gz"))]+["","#### 方式二:通用软件包仓库","","通过命令行下载:",""]+[f"```bash\nwget https://{r}/api/packages/{o}/generic/{p}/{t}/{f}\n```" for f in sorted(glob.glob("*.tar.gz"))[:1]]+["","#### 方式三:Debian 软件源","","```bash","# 下载 GPG 密钥",f"sudo curl https://{r}/api/packages/{o}/debian/repository.key -o /etc/apt/keyrings/gitea-{o}.asc","","# 添加软件源",f"echo \"deb [signed-by=/etc/apt/keyrings/gitea-{o}.asc] https://{r}/api/packages/{o}/debian stable main\" | sudo tee -a /etc/apt/sources.list.d/{o}.list","","# 更新并安装","sudo apt-get update","sudo apt-get install mond","```"];print(json.dumps({"tag_name":t,"name":f"Release {t}","body":"\n".join(b),"draft":False,"prerelease":False}))')
# 拼接 tar.gz 下载链接
ASSETS=$(for f in *.tar.gz; do
[ -f "$f" ] || continue
echo "- [\`$f\`](https://${REGISTRY}/api/packages/${OWNER}/generic/${PRODUCT_NAME}/${VERSION}/$f)"
done)
BODY=$(cat <<EOF
## Release ${VERSION}
### 📥 Debian/Ubuntu 安装
\`\`\`bash
sudo curl https://${REGISTRY}/api/packages/${OWNER}/debian/repository.key -o /etc/apt/keyrings/gitea-${OWNER}.asc
echo "deb [signed-by=/etc/apt/keyrings/gitea-${OWNER}.asc] https://${REGISTRY}/api/packages/${OWNER}/debian stable main" | sudo tee /etc/apt/sources.list.d/${OWNER}.list
sudo apt-get update && sudo apt-get install ${PRODUCT_NAME}
\`\`\`
### 📦 tar.gz 下载
${ASSETS}
EOF
)
RELEASE_DATA=$(jq -n --arg tag "$TAG" --arg ver "$VERSION" --arg body "$BODY" \
'{tag_name: $tag, name: "Release \($ver)", body: $body, draft: false, prerelease: false}')
# 创建 Release
echo ""
+10 -1
View File
@@ -1,7 +1,16 @@
# macOS system files
.DS_Store
# Claude Code
.mcp.json
.claude/
llmdoc/
example/
.source/
.source/
# 构建产物
*.deb
*.tar.gz
output/
packages/
+59
View File
@@ -0,0 +1,59 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## 仓库性质
本仓库**只包含构建与打包基础设施**,不含 mond 源码。源码在编译时从外部仓库克隆(见 [docker/Dockerfile](docker/Dockerfile)):
- 源码仓库:`github.com/monero-project/monero.git`**Monero 官方仓库**,非换名仓库)
- 发布仓库:Gitea `gitea.bcde.io``wangdefa/mond` 的 Generic / Debian 包仓库
mond 是 Monero 守护进程 `monerod` 的定制换名构建。换名通过 [init.sh](init.sh) 在编译期对源码做 `sed` 改写完成:`project(monero)→project(mond)`、二进制 `OUTPUT_NAME monerod→mond``MONERO_VERSION_*` 宏 → `MOND_VERSION_*`、用户可见字符串 `Monero→Mond`。**改动版本宏或显示字符串相关逻辑时,改 init.sh 而非源码**(源码每次构建都重新克隆)。init.sh 末尾还含 musl 纯静态所需的 CMakeLists patch(见下「为何 patch」)。
> **与同目录 `gitea-xxxig` / `gitea-xxxig-proxy` 的关键差异**:那两个项目源码来自 `wangdefaa`(双 a)换名仓库;mond 直接克隆 Monero 官方仓库,靠 init.sh 现场改名。三者共享同一套 CI / build-deb / debian 打包骨架,且均为 **musl fully-static** 构建;mond 的版本号格式为四段 `0.18.5.0`。
## 整体架构:单二进制
编译产出单个可执行文件 `mond`:Monero 全节点守护进程,负责 P2P 同步区块链、提供 RPC。配置来自 [conf/params.example.conf](conf/params.example.conf)。
## 构建与发布流程(CI
[.gitea/workflows/ci.yaml](.gitea/workflows/ci.yaml) 是 Gitea Actions 流水线:
1. **build-and-test**(矩阵 `arch=[amd64,arm64]`,跑在对应架构原生 runner):用 `docker buildx` 按 [docker/Dockerfile](docker/Dockerfile) 原生编译 → 打成 tar.gz → 解包冒烟测试(`mond --version` + `ldd` 纯静态校验)→ 调 `debian/build-deb.sh` 打 .deb → 上传 artifact。
2. **release**(仅 tag 触发):下载 artifact,上传 tar.gz 到 Generic Package Registry、上传 .deb 到 Debian Registrystable/main),并用 `jq` 生成描述创建 Gitea Release。
关键点:
- **musl fully-staticAlpine 构建,勿改回 glibc**[docker/Dockerfile](docker/Dockerfile) 在 `alpine:3.23` 下手动源码编译 5 个静态库(OpenSSL 3.0.16 / libsodium / libzmq / expat / unbound——Alpine 仓库只有 `.so`/缺 `.a`,须 `--disable-shared` 自编),编出 **static-pie 纯静态**二进制:`ldd` = `statically linked`、零外部依赖,**glibc/musl 任意发行版直接运行**(实测 musl 产物在 Debian 13 上正常运行)。`make daemon` 约 7 分钟/架构(5 库命中 Docker 层缓存后),远快于原 glibc depends 系统的 3060 分钟。
- **为何用 musl 而非 glibc 全静态**glibc 的 `getaddrinfo` 依赖运行时 `dlopen` NSS 模块,`-static` 全静态后无法加载 → DNS 解析失败(`DNS error: resource busy or locked`);musl 的 `getaddrinfo` 自带实现,全静态也能正常解析。与 `gitea-xxxig`/`gitea-xxxig-proxy` 一致。曾用的 glibc(ubuntu) depends 构建线已删除。
- **为何 patch monero 源码([init.sh](init.sh) 末尾,勿删)**:monero 官方明确「不支持 fully static」——`CMakeLists.txt``STATIC=ON` 在 Linux 只加 `-static-libgcc -static-libstdc++`(非真 `-static`),且强制追加 `-pie` 安全加固,会让链接结果带 musl interpreter、退化成动态。故 init.sh 用 `sed` 去掉 `-pie`、把 Linux 的 `STATIC_FLAGS` 改成真 `-static`。Alpine gcc 默认 PIE`-static` 自动产出 static-pie(零外部依赖)。
- **版本号约定**:包版本硬编码在 ci.yaml 的 `PACKAGE_VERSION: "0.18.5.0"`(**纯数字、无 v**,符合 Debian 版本规范)。**关键分界**:上游 Monero git tag 带 `v`,故 build job 用 `MONERO_VERSION=v${PACKAGE_VERSION}` 补回 v 传给 Dockerfile `git clone --branch`tar.gz / deb / registry 路径 / Release 标题等包版本一律直接用 `${PACKAGE_VERSION}`release job 用 `VERSION="${TAG#v}"` 归一(tag 带不带 v 都兼容)。CI 触发条件为 `tags: ['*']`,发版改 `PACKAGE_VERSION` 并打对应 tag(纯数字,如 `0.18.5.0`)。
- **依赖精简**5 个静态库 + libstdc++/libgcc 全部静态链入(真 `-static`),故 [debian/control.template](debian/control.template) **无 `Depends` 字段**(纯静态,连 libc6 都不需要)。
- 架构映射:Dockerfile 内 `arm64→ARCH=armv8-a / BUILD_TAG=linux-armv8``amd64→ARCH=x86-64 / BUILD_TAG=linux-x64`(传给 monero cmake);OpenSSL target `aarch64→linux-aarch64``x86_64→linux-x86_64`
- tar.gz 下载 URL 形如 `https://gitea.bcde.io/api/packages/wangdefa/generic/mond/{version}/mond-{arch}-linux-static-{version}.tar.gz`version 为纯数字)。
## 本地常用命令
```bash
# 本地编译某架构的二进制(输出到 ./output/linux_<arch>/mond
docker buildx build --platform linux/amd64 \
--build-arg MONERO_VERSION=v0.18.5.0 \
--output type=local,dest=./output \
-f docker/Dockerfile .
# 用已有 tar.gz 打 .deb 包(注意第三个参数是 tar.gz,不是目录)
./debian/build-deb.sh amd64 0.18.5.0 mond-amd64-linux-static-0.18.5.0.tar.gz
# 改 shell 脚本后做静态检查(需自行安装 shellcheck)
shellcheck debian/*.sh
```
无单元测试;CI 中唯一的冒烟测试是解包后跑 `mond --version`(musl 纯静态二进制可在 glibc 的 CI runner 直接运行),并用 `ldd` 校验为 `statically linked`(纯静态、无任何动态依赖)。
## Debian 包布局与服务
- 二进制装到 `/opt/mond/mond`systemd 服务文件 [debian/mond.service](debian/mond.service),维护脚本 `debian/{postinst,prerm,postrm}`
- **配置流转(单一数据源)**`conf/params.example.conf` 是唯一配置源 → build-deb.sh 复制进包内 `/opt/mond/params.conf` → postinst 首次安装时 `cp``/etc/mond/params.conf`(**升级不覆盖**用户已有配置;旧版本位于 `/var/lib/mond/params.conf` 时 postinst 会自动迁移到 `/etc/mond/`)。service 的 `ExecStart``--config-file=/etc/mond/params.conf`。**改默认配置改 conf/params.example.conf 一处即可**(不要再在 postinst 内联)。
- 数据目录 `/var/lib/mond/data`、日志目录 `/var/log/mond`,均归 `mond` 系统用户。
- postinst 创建 `mond` 系统用户/组。**服务不自动启用/启动**(首次同步需用户确认配置),升级时若服务原为 enabled 则重启以加载新二进制。.deb 安装后手动 `systemctl enable --now mond`
+18 -41
View File
@@ -9,8 +9,8 @@
- 🏗️ **多架构支持** - 原生支持 AMD64 和 ARM64 架构
- 📦 **多种安装方式** - 提供 Debian 包和通用二进制包
- 🐧 **发行版兼容** - 支持 UbuntuDebian
- 🔗 **纯静态链接** - 无需依赖,可在任意 Linux 系统运行
- 🐧 **发行版** - musl 纯静态二进制,glibc/musl 任意发行版(Ubuntu/Debian/CentOS/Alpine)直接运行
- 🔗 **零依赖** - 所有库(boost/OpenSSL/ZMQ/sodium/unbound 及 libc)全部静态链入,`ldd` 显示 `statically linked`,无任何动态依赖
- 🔒 **隐私优先** - 基于 Monero 的隐私保护技术
- 🔄 **自动更新** - 通过 Debian 仓库轻松安装和更新
@@ -33,11 +33,11 @@ sudo apt-get install mond
### 方式二:通用二进制包
```bash
# 1. 下载对应架构的包
wget https://gitea.bcde.io/releases/download/v0.18.4.5/mond-amd64-ubuntu-v0.18.4.5.tar.gz
# 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-ubuntu-v0.18.4.5.tar.gz
tar -xzf mond-amd64-linux-static-0.18.5.0.tar.gz
# 3. 运行
./mond --help
@@ -92,7 +92,7 @@ sudo systemctl disable mond.service
```
/opt/mond/mond # 二进制文件
/var/lib/mond/params.conf # 配置文件
/etc/mond/params.conf # 配置文件
/var/lib/mond/data/ # 区块链数据目录
/var/log/mond/ # 日志目录
```
@@ -103,7 +103,7 @@ Debian/Ubuntu 系统包使用配置文件方式运行,修改配置非常简单
```bash
# 1. 编辑配置文件
sudo nano /var/lib/mond/params.conf
sudo nano /etc/mond/params.conf
# 2. 重启服务使配置生效
sudo systemctl restart mond.service
@@ -144,14 +144,14 @@ sudo systemctl restart mond.service
### Docker 构建(推荐)
本项目使用 Docker 和官方 depends 系统构建,确保纯静态链接
本项目使用 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.ubuntu \
-f docker/Dockerfile \
--output type=local,dest=./output .
```
@@ -160,57 +160,34 @@ docker buildx build --platform linux/amd64,linux/arm64 \
```bash
# 仅构建 amd64
docker buildx build --platform linux/amd64 \
-f docker/Dockerfile.ubuntu \
-f docker/Dockerfile \
--output type=local,dest=./output .
# 仅构建 arm64
docker buildx build --platform linux/arm64 \
-f docker/Dockerfile.ubuntu \
-f docker/Dockerfile \
--output type=local,dest=./output .
```
#### 验证静态链接
#### 验证依赖
```bash
# 检查二进制文件是否为纯静态链接
# 纯静态校验:应输出 "statically linked"(零外部依赖,可在 glibc/musl 任意发行版运行)
ldd output/linux_amd64/mond
# 预期输出: "not a dynamic executable"
file output/linux_amd64/mond
# 预期输出: "statically linked"
# 预期: 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
```
纯静态构建需在 Alpine 下手编 5 个静态库(OpenSSL/libsodium/libzmq/expat/unbound)并 patch monero CMakeLists,步骤已固化在 [docker/Dockerfile](docker/Dockerfile)——**直接用上面的 Docker 构建即可**,无需手动复现。换名 + patch 逻辑见 [init.sh](init.sh)。
### 构建环境要求
- **操作系统**: Ubuntu 20.04(推荐)或更新版本
- **CPU**: 多核 CPU构建时间约 30-60 分钟
- **构建镜像**: `alpine:3.23`Dockerfile 内置,无需本机安装)
- **CPU**: 多核 CPU`make daemon` 约 7 分钟/架构,5 库命中缓存后
- **内存**: 至少 4GB RAM
- **磁盘**: 至少 10GB 可用空间
- **Docker**: 如使用 Docker 构建,需安装 Docker 和 buildx
- **Docker**: 需安装 Docker 和 buildx
## 📝 许可证
+20 -17
View File
@@ -3,16 +3,18 @@ set -e
# 参数检查
if [ $# -ne 3 ]; then
echo "Usage: $0 <ARCH> <VERSION> <BINARY_DIR>"
echo "Example: $0 amd64 0.18.4.5 build/Linux/release/bin"
echo "Usage: $0 <ARCH> <VERSION> <TARGZ_FILE>"
echo "Example: $0 amd64 0.18.5.0 mond-amd64-linux-static-0.18.5.0.tar.gz"
exit 1
fi
ARCH=$1
VERSION=$2
BINARY_DIR=$3
TARGZ_FILE=$3
PKG_NAME="mond"
DEB_FILE="${PKG_NAME}_${VERSION}_${ARCH}.deb"
DEB_VERSION="${VERSION#v}" # Debian 版本号必须以数字开头,去掉可能的 v 前缀
[ -f "$TARGZ_FILE" ] || { echo "❌ 找不到产物包: $TARGZ_FILE"; exit 1; }
# 转换架构名称(Docker 使用的架构名到 Debian 架构名)
case "$ARCH" in
@@ -28,34 +30,34 @@ case "$ARCH" in
;;
esac
DEB_FILE="${PKG_NAME}_${DEB_VERSION}_${DEB_ARCH}.deb"
echo "📦 Building Debian package: ${DEB_FILE}"
echo " Architecture: ${DEB_ARCH}"
echo " Version: ${VERSION}"
echo " Binary directory: ${BINARY_DIR}"
# 检查二进制文件是否存在
if [ ! -f "${BINARY_DIR}/mond" ]; then
echo "❌ Error: mond binary not found in ${BINARY_DIR}"
exit 1
fi
echo " Version: ${DEB_VERSION}"
echo " Source: ${TARGZ_FILE}"
# 创建临时目录
BUILD_DIR=$(mktemp -d)
trap "rm -rf $BUILD_DIR" EXIT
# 创建包目录结构
PKG_DIR="${BUILD_DIR}/${PKG_NAME}_${VERSION}_${DEB_ARCH}"
PKG_DIR="${BUILD_DIR}/${PKG_NAME}_${DEB_VERSION}_${DEB_ARCH}"
mkdir -p "${PKG_DIR}/DEBIAN"
mkdir -p "${PKG_DIR}/opt/mond"
mkdir -p "${PKG_DIR}/lib/systemd/system"
# 复制二进制文件
echo "📂 Copying binary..."
cp "${BINARY_DIR}/mond" "${PKG_DIR}/opt/mond/mond"
# 解压二进制文件
echo "📂 Extracting binary..."
tar -xzf "${TARGZ_FILE}" -C "${PKG_DIR}/opt/mond"
# 打入默认配置(conf/params.example.conf 为唯一配置源,postinst 据此生成 /etc/mond/params.conf
echo "📄 Bundling default config..."
cp conf/params.example.conf "${PKG_DIR}/opt/mond/params.conf"
# 生成 control 文件
echo "📝 Generating control file..."
sed -e "s/{{VERSION}}/${VERSION}/" \
sed -e "s/{{VERSION}}/${DEB_VERSION}/" \
-e "s/{{ARCH}}/${DEB_ARCH}/" \
debian/control.template > "${PKG_DIR}/DEBIAN/control"
@@ -74,6 +76,7 @@ cp debian/mond.service "${PKG_DIR}/lib/systemd/system/"
# 设置权限
chmod 755 "${PKG_DIR}/opt/mond/mond"
chmod 644 "${PKG_DIR}/opt/mond/params.conf"
chmod 644 "${PKG_DIR}/lib/systemd/system/mond.service"
# 构建 deb 包
-1
View File
@@ -3,7 +3,6 @@ Version: {{VERSION}}
Section: net
Priority: optional
Architecture: {{ARCH}}
Depends: libc6, libboost-system1.74.0 | libboost-system1.81.0 | libboost-system1.83.0, libboost-filesystem1.74.0 | libboost-filesystem1.81.0 | libboost-filesystem1.83.0, libboost-thread1.74.0 | libboost-thread1.81.0 | libboost-thread1.83.0, libboost-program-options1.74.0 | libboost-program-options1.81.0 | libboost-program-options1.83.0, libssl3 | libssl1.1, libzmq5, libunwind8
Maintainer: Mond Team <noreply@example.com>
Homepage: https://github.com/monero-project/monero
Description: Mond cryptocurrency daemon
+1 -1
View File
@@ -9,7 +9,7 @@ Type=simple
WorkingDirectory=/opt/mond
# 执行命令 - 使用配置文件
ExecStart=/opt/mond/mond --config-file=/var/lib/mond/params.conf --non-interactive
ExecStart=/opt/mond/mond --config-file=/etc/mond/params.conf --non-interactive
# 重启策略
Restart=always
+32 -126
View File
@@ -17,120 +17,43 @@ mkdir -p /var/log/mond
chown mond:mond /var/log/mond
chmod 750 /var/log/mond
# Create data directory
# Create data directory(非递归设权限,避免升级时遍历庞大的区块链数据目录)
mkdir -p /var/lib/mond/data
chown -R mond:mond /var/lib/mond
chmod -R 750 /var/lib/mond
chown mond:mond /var/lib/mond /var/lib/mond/data
chmod 750 /var/lib/mond /var/lib/mond/data
# Create configuration file if it doesn't exist
if [ ! -f /var/lib/mond/params.conf ]; then
cat > /var/lib/mond/params.conf << 'EOF'
# 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
# Create config directory
mkdir -p /etc/mond
# DATA STORAGE
# ============================================================================
# data-dir: 区块链数据存储目录
data-dir=/var/lib/mond/data
# BLOCKCHAIN PRUNING
# ============================================================================
# prune-blockchain: 启用区块链修剪模式
prune-blockchain=1
# 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
# SECURITY AND NETWORK INTEGRITY
# ============================================================================
# enforce-dns-checkpointing: 强制执行 DNS 检查点验证
enforce-dns-checkpointing=1
# enable-dns-blocklist: 启用 DNS 黑名单
enable-dns-blocklist=1
# 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 AUTHENTICATION
# ============================================================================
# rpc-login: RPC 访问认证凭据
#rpc-login=user:password
# 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
EOF
chown mond:mond /var/lib/mond/params.conf
chmod 640 /var/lib/mond/params.conf
# 兼容旧版本:配置文件曾位于 /var/lib/mond/params.conf,迁移到 /etc/mond/params.conf
if [ ! -f /etc/mond/params.conf ] && [ -f /var/lib/mond/params.conf ]; then
echo "Migrating existing config from /var/lib/mond to /etc/mond..."
cp /var/lib/mond/params.conf /etc/mond/params.conf
fi
# Set permissions on binary
chown root:mond /opt/mond/mond
# 首次安装:从包内默认配置生成(源:conf/params.example.conf)。升级不覆盖已有配置
if [ ! -f /etc/mond/params.conf ]; then
cp /opt/mond/params.conf /etc/mond/params.conf
fi
chown mond:mond /etc/mond/params.conf
chmod 640 /etc/mond/params.conf
# Set permissions/opt 目录与二进制 755,数据文件 644(对齐 xxxig / xxxig-proxy
chown -R root:root /opt/mond
find /opt/mond -type d -exec chmod 755 {} +
find /opt/mond -type f -exec chmod 644 {} +
chmod 755 /opt/mond/mond
# Reload systemd
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
# Note: Service is NOT auto-enabled or auto-started
# Users should manually enable the service:
# 升级时重启正在运行的服务以加载新二进制;try-restart 不会启动未运行的服务,
# 故首次安装仍保持"不自动启动"语义
systemctl try-restart mond.service 2>/dev/null || true
# Note: On fresh install, service is NOT auto-enabled or auto-started
# systemctl enable mond.service
# systemctl start mond.service
fi
@@ -138,31 +61,14 @@ fi
echo ""
echo "✅ Mond installed successfully!"
echo ""
echo "📋 Configuration and startup:"
echo ""
echo "1. Review and configure settings (optional):"
echo " sudo nano /var/lib/mond/params.conf"
echo ""
echo " Adjust network settings, peer connections, and other options as needed."
echo ""
echo "2. Start Mond:"
echo " sudo systemctl enable mond.service"
echo " sudo systemctl start mond.service"
echo ""
echo "3. Check status:"
echo " sudo systemctl status mond.service"
echo " sudo journalctl -u mond -f"
echo ""
echo "📁 Important paths:"
echo " Config file: /var/lib/mond/params.conf"
echo " Data directory: /var/lib/mond/data"
echo " Log directory: /var/log/mond"
echo " Binary: /opt/mond/mond"
echo " Config file: /etc/mond/params.conf"
echo " Data directory: /var/lib/mond/data"
echo " Log directory: /var/log/mond"
echo " Binaries: /opt/mond/mond"
echo " Systemd services: mond.service"
echo ""
echo "💡 Tip: Your params.conf will NOT be overwritten during package upgrades."
echo ""
echo "For help:"
echo " /opt/mond/mond --help"
echo "💡 Tip: Your config files will NOT be overwritten during package upgrades."
echo ""
exit 0
+2 -1
View File
@@ -12,9 +12,10 @@ case "$1" in
delgroup --quiet mond || true
fi
# Remove data directories (only on purge)
# Remove data/config directories (only on purge)
rm -rf /var/log/mond
rm -rf /var/lib/mond
rm -rf /etc/mond
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+3 -2
View File
@@ -1,8 +1,9 @@
#!/bin/sh
set -e
# Stop and disable service if running
if [ -d /run/systemd/system ]; then
# 仅在卸载(remove)时停用服务;升级(upgrade)时保持运行,
# 由 postinst 的 try-restart 重启以加载新二进制
if [ "$1" = "remove" ] && [ -d /run/systemd/system ]; then
if systemctl is-active --quiet mond.service; then
echo "Stopping mond service..."
systemctl stop mond.service
+66
View File
@@ -0,0 +1,66 @@
# musl fully-static 构建 mondmonerod 换名):手编 5 个静态库 + patch CMakeLists + static-pie。
# 为何 musl 而非 glibcmusl 的 getaddrinfo 自包含,全静态可跨发行版运行;glibc 静态会因 NSS
# 运行时 dlopen 失败(DNS error: resource busy or locked)。详见 CLAUDE.md。
# 产物为 static-pieAlpine gcc 默认 PIE),零外部依赖,可在 glibc/musl 任意发行版直接运行。
# ---- Stage 1: 静态依赖库(版本固定 → Docker 层缓存,源码不变不重编)----
FROM alpine:3.23 AS deps
RUN apk add --no-cache g++ gcc make cmake git linux-headers autoconf automake libtool \
pkgconf perl wget tar xz bzip2 file flex bison boost-static boost-dev rapidjson-dev
ENV CFLAGS="-fPIC -O2" CXXFLAGS="-fPIC -O2"
WORKDIR /deps
# OpenSSL 3.0.16Alpine 仓库只有 .so,须源码编静态)
RUN wget -q https://github.com/openssl/openssl/releases/download/openssl-3.0.16/openssl-3.0.16.tar.gz && \
tar xf openssl-3.0.16.tar.gz && cd openssl-3.0.16 && \
if [ "$(uname -m)" = aarch64 ]; then OSSL_T=linux-aarch64; else OSSL_T=linux-x86_64; fi && \
./Configure no-shared no-tests --prefix=/usr --libdir=lib $OSSL_T && \
make -j"$(nproc)" && make install_sw && cd / && rm -rf /deps/openssl-3.0.16*
# libsodium 1.0.20
RUN wget -q https://download.libsodium.org/libsodium/releases/libsodium-1.0.20.tar.gz && \
tar xf libsodium-1.0.20.tar.gz && cd libsodium-1.0.20 && \
./configure --enable-static --disable-shared --prefix=/usr && \
make -j"$(nproc)" && make install && cd / && rm -rf /deps/libsodium-1.0.20*
# libzmq 4.3.5
RUN wget -q https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz && \
tar xf zeromq-4.3.5.tar.gz && cd zeromq-4.3.5 && \
./configure --enable-static --disable-shared --prefix=/usr --without-docs --enable-drafts=no && \
make -j"$(nproc)" && make install && cd / && rm -rf /deps/zeromq-4.3.5*
# expat 2.6.4
RUN wget -q https://github.com/libexpat/libexpat/releases/download/R_2_6_4/expat-2.6.4.tar.bz2 && \
tar xf expat-2.6.4.tar.bz2 && cd expat-2.6.4 && \
./configure --enable-static --disable-shared --prefix=/usr && \
make -j"$(nproc)" && make install && cd / && rm -rf /deps/expat-2.6.4*
# unbound 1.22.0DNSSECrelease archive 需 flex/bison 现生成 lexer
RUN wget -q https://github.com/NLnetLabs/unbound/archive/refs/tags/release-1.22.0.tar.gz -O unbound.tar.gz && \
tar xf unbound.tar.gz && cd unbound-release-1.22.0 && \
./configure --disable-shared --enable-static --prefix=/usr --with-libexpat=/usr --with-ssl=/usr \
--with-libevent=no --without-pythonmodule --without-pyunbound --with-libunbound-only --with-pic && \
make -j"$(nproc)" && make install && cd / && rm -rf /deps/unbound*
# ---- Stage 2: 换名 + patch + 编译 mond ----
FROM deps AS build
ARG MONERO_VERSION
ARG TARGETARCH
WORKDIR /src
RUN git clone --recursive --branch "${MONERO_VERSION}" --depth 1 --shallow-submodules \
https://github.com/monero-project/monero.git monero
WORKDIR /src/monero
# init.shmonero→mond 换名 + musl fully-static patch(去 -pie、STATIC_FLAGS 改 -static
COPY ./init.sh ./init.sh
RUN sh ./init.sh
RUN if [ "$TARGETARCH" = "arm64" ]; then MARCH=armv8-a; MTAG=linux-armv8; \
else MARCH=x86-64; MTAG=linux-x64; fi && \
cmake -S . -B build/release -DSTATIC=ON -DSTACK_TRACE=OFF -DBUILD_64=ON \
-DCMAKE_BUILD_TYPE=Release -DARCH="$MARCH" -DBUILD_TAG="$MTAG" -DUSE_DEVICE_TREZOR=OFF && \
make -j"$(nproc)" -C build/release daemon && \
mkdir -p /output && cp build/release/bin/mond /output/mond
# ---- Stage 3: 导出(保持 ci.yaml 期望的 linux_<arch>/mond 布局)----
FROM scratch
ARG TARGETARCH
COPY --from=build /output/mond /linux_${TARGETARCH}/mond
-83
View File
@@ -1,83 +0,0 @@
FROM ubuntu:20.04 AS base
ARG TARGETARCH
ARG BUILDPLATFORM
ENV DEBIAN_FRONTEND=noninteractive
# 安装构建依赖(包括 depends 系统所需工具)
RUN apt-get update && apt-get install -y \
git \
wget \
curl \
build-essential \
cmake \
pkg-config \
autoconf \
automake \
libtool \
bzip2 \
xz-utils \
python3 \
gperf \
libboost-all-dev \
libssl-dev \
libzmq3-dev \
libunbound-dev \
libsodium-dev \
libunwind8-dev \
liblzma-dev \
libreadline-dev \
libexpat1-dev \
libpgm-dev \
qttools5-dev-tools \
libhidapi-dev \
libusb-1.0-0-dev \
libprotobuf-dev \
protobuf-compiler \
libudev-dev \
libgtest-dev \
&& rm -rf /var/lib/apt/lists/*
FROM base AS build
ARG MONERO_VERSION=v0.18.4.5
ARG TARGETARCH
ARG BUILDPLATFORM
ARG TARGETPLATFORM
# 克隆 Monero 项目
RUN git clone --recursive https://github.com/monero-project/monero.git && \
cd monero && \
git checkout ${MONERO_VERSION} && \
git submodule update --init --force
WORKDIR /monero
# 复制并运行 init.sh 脚本进行修改
COPY ./init.sh ./init.sh
RUN chmod +x ./init.sh && ./init.sh
# 使用官方 depends 系统构建静态依赖(参考 .source/Dockerfile
RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \
MAKE_JOBS=2; \
else \
MAKE_JOBS=$(nproc); \
fi && \
if [ "$TARGETARCH" = "arm64" ]; then \
DEPENDS_TARGET="aarch64-linux-gnu"; \
else \
DEPENDS_TARGET="x86_64-linux-gnu"; \
fi && \
echo "Building dependencies for $DEPENDS_TARGET with $MAKE_JOBS parallel jobs" && \
make -j$MAKE_JOBS depends target=$DEPENDS_TARGET && \
mkdir -p /output && \
cp build/$DEPENDS_TARGET/release/bin/mond /output/mond
# 最终阶段 - 只复制静态链接的二进制文件
FROM scratch
ARG TARGETARCH
COPY --from=build /output/mond /linux_${TARGETARCH}/mond
+7
View File
@@ -50,6 +50,13 @@ find tests -type f -name "*.cpp" -exec sed -i 's/"Monero '"'"'/"Mond '"'"'/g' {}
# Uncomment the following lines if you want to remove Monero Project copyright
# find . -type f \( -name "*.cpp" -o -name "*.h" \) -exec sed -i '/Copyright.*The Monero Project/d' {} \;
# 8. musl fully-static patch(配合 docker/Dockerfile,产出无 interpreter、零外部依赖的 static-pie
# monero 官方"不支持 fully static"STATIC=ON 在 Linux 仅给 -static-libgcc/-static-libstdc++,且强制 -pie。
# 去掉 -pie(否则强制动态 PIE/带 musl interpreter,无法跨发行版)
sed -i 's|add_linker_flag_if_supported("-pie" LD_SECURITY_FLAGS)|# -pie removed for fully-static|' CMakeLists.txt
# Linux STATIC_FLAGS 从 -static-libgcc/-static-libstdc++ 改真 -static
sed -i 's|set(STATIC_FLAGS "-static-libgcc -static-libstdc++")|set(STATIC_FLAGS "-static")|' CMakeLists.txt
echo "Project successfully modified from Monero to Mond!"
echo "Binary output name: mond"
echo "Project name: mond"
-38
View File
@@ -1,38 +0,0 @@
# Mond 构建系统架构
## 1. 构建环境支持
Mond 项目支持多平台构建:
- Ubuntu (amd64/arm64)
- Alpine Linux (amd64/arm64)
## 2. 关键构建组件
### 初始化脚本 (init.sh)
- 负责版本和配置预处理
- 使用 sed 进行文本替换
- 处理版本宏定义
### Dockerfile
- Alpine Linux: docker/Dockerfile.alpine
- 处理依赖安装
- 配置构建环境
## 3. 依赖管理
### Boost 库组件
必需的 Boost 库组件:
- filesystem
- thread
- date_time
- chrono
- serialization
- program_options
- locale
- system
- regex
## 4. CMake 构建流程
- 检查系统兼容性
- 链接必要库
- 生成可执行文件
-41
View File
@@ -1,41 +0,0 @@
# Mond CI/CD 流水线架构
## 1. 身份标识
- **定义:** Gitea Actions 驱动的多架构持续集成与交付系统
- **目的:** 自动化构建、测试和发布 Mond 项目到多个平台和包管理系统
## 2. 核心组件
- `.gitea/workflows/ci.yaml` (CIWorkflow): 定义整个 CI/CD 流程
- `debian/build-deb.sh` (PackageBuilder): 处理 Debian 包构建逻辑
## 3. 执行流程(LLM 检索路径)
### 持续集成流程
1. **代码推送触发:** 监听 master 分支和 PR 事件
2. **多架构构建:**
- 目标架构:amd64, arm64
- 目标发行版:Ubuntu, Alpine
3. **构建步骤:**
- 代码检出
- 依赖安装
- 单元测试
- 二进制编译
- 包构建
### 发布流程
1. **标签创建:** 手动或自动创建语义化版本标签
2. **构建制品:**
- 多架构 Debian 包(amd64, arm64
- 二进制可执行文件
3. **发布到:**
- Gitea Release(附件形式)
- Generic Package Registry(通用软件包仓库)
- Debian Package Registrystable 发行版)
## 4. 设计原理
- **可移植性:** 支持多架构和发行版
- **自动化:** 减少手动干预
- **一致性:** 标准化构建和发布流程
-59
View File
@@ -1,59 +0,0 @@
# Mond 打包系统架构
## 1. 身份标识
- **定义:** 基于 Debian 打包规范的多平台软件分发系统
- **目的:** 提供标准化、可靠的软件安装和管理机制
## 2. 核心组件
- `debian/control.template` (PackageMetadata): 定义包元数据
- `debian/postinst` (PostInstallScript): 安装后配置脚本
- `debian/mond.service` (SystemdService): systemd 服务配置
- `debian/build-deb.sh` (BuildScript): 构建 Debian 包的脚本
## 3. 打包系统设计
### Debian 包结构
- **元数据:** 版本、依赖、描述
- **文件布局:**
- 二进制文件:`/opt/mond/mond`
- 配置文件:`/var/lib/mond/params.conf`(首次安装时自动创建)
- 数据目录:`/var/lib/mond/data/`
- 日志目录:`/var/log/mond/`
- systemd 服务:`/lib/systemd/system/mond.service`
### 安装后脚本逻辑
1. 创建必要的系统用户和组(`mond:mond`
2. 创建日志目录和数据目录(包括 `/var/lib/mond/data` 子目录)
3. **生成默认配置文件**(如果不存在)
- 位置:`/var/lib/mond/params.conf`
- 包含所有默认运行参数
- 使用 INI 格式
- 设置正确的权限(640, mond:mond
4. 设置文件和目录权限
5. 重载 systemd 配置
6. 显示安装后说明(包括配置文件位置和使用指引)
**重要特性:** 配置文件只在首次安装时创建,升级时不会覆盖用户修改。
### systemd 集成
- 支持标准服务管理命令
- 使用配置文件方式启动(`--config-file=/var/lib/mond/params.conf --non-interactive`
- 配置服务依赖和启动行为
- 提供日志和状态监控
- 安全沙箱设置(NoNewPrivileges, ProtectSystem, ProtectHome
- 允许写入配置目录、数据目录和日志目录(ReadWritePaths
- 自动重启策略(Restart=always
**配置管理优势:**
- 用户修改配置文件后,`apt upgrade` 不会覆盖
- systemd 服务文件可以安全更新,不影响用户配置
- 配置集中管理,易于维护
- 数据与配置分离,便于管理
## 4. 设计原理
- **标准合规:** 遵循 Debian 打包最佳实践
- **可配置性:** 灵活的服务和安装配置
- **可靠性:** 通过 systemd 提供健壮的服务管理
-29
View File
@@ -1,29 +0,0 @@
# Mond 架构设计
## 1. 组件概览
- 主守护进程二进制文件
- 项目初始化和定制脚本
- 多架构构建配置
## 2. 核心文件类型
- 源代码文件
- 构建脚本
- Docker 构建配置
- CMake 配置文件
## 3. 构建流程
1. **源代码准备**:克隆 Monero 源代码
2. **定制应用**:替换 Monero 特定标识符
3. **依赖构建**:使用 Monero 的 depends 系统
4. **编译**:使用 CMake 和 Make 构建
5. **打包**:生成多架构二进制和 Debian 包
## 4. 关键设计决策
- 使用纯静态链接以提高可移植性
- 支持多架构(AMD64、ARM64
- 保留原始 Monero 核心功能
- 简化安装和配置过程
-27
View File
@@ -1,27 +0,0 @@
# 如何构建 Mond 项目
## 支持的平台
- Ubuntu (amd64/arm64)
- Alpine Linux (amd64/arm64)
## 构建步骤
1. **准备环境**
- 安装必要的依赖:Boost、CMake、编译工具链
2. **克隆仓库**
3. **运行初始化脚本**
Project successfully modified from Monero to Mond!
Binary output name: mond
Project name: mond
4. **编译项目**
## 常见问题排查
- 确保所有 Boost 组件已正确安装
- 检查 CMake 版本兼容性
- 验证编译器支持情况
-43
View File
@@ -1,43 +0,0 @@
# Mond 安装指南
## 支持的平台
Mond 支持以下平台和安装方式:
- Debian stable
- Ubuntu 最新 LTS 版本
- 通用 Linux 二进制包(支持 AMD64 和 ARM64
## 方式一:Debian/Ubuntu 安装(推荐)
```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 stable main" | \
sudo tee -a /etc/apt/sources.list.d/wangdefa.list
# 3. 安装
sudo apt-get update
sudo apt-get install mond
```
## 方式二:通用二进制包安装
```bash
# 1. 下载对应架构的包(替换 VERSION 为实际版本号)
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
```
## 依赖项
Mond 没有复杂的外部依赖。Debian 包管理器将自动处理必要的系统依赖。对于二进制包,请确保:
- 使用 Linux 64位系统(AMD64 或 ARM64
- 具有基础 Linux 运行时环境
-64
View File
@@ -1,64 +0,0 @@
# 如何发布 Mond 项目
## 1. 准备工作
### 前提条件
- 已配置 Gitea 仓库
- 具备仓库管理员权限
- 已安装必要的构建工具
## 2. 创建 Release
### 方法一:GitHub/Gitea Web 界面
1. 导航到仓库 Releases 页面
2. 点击 "New Release"
3. 选择目标分支
4. 输入语义化版本标签(例如 `v1.2.3`
5. 填写发布说明
### 方法二:命令行
```bash
git tag -a v1.2.3 -m "Release version 1.2.3"
git push origin v1.2.3
```
## 3. 配置 Gitea Secrets
### 必需的 Secrets
- `REGISTRY_USERNAME`: 包仓库用户名
- `REGISTRY_PASSWORD`: 包仓库认证令牌
- `GPG_PRIVATE_KEY`: 用于签名的 GPG 私钥
- `GPG_PASSPHRASE`: GPG 私钥密码
### 设置步骤
1. 进入仓库设置
2. 选择 "Secrets"
3. 添加每个必需的 Secret
## 4. 包管理仓库上传
### 自动上传
CI 流水线将自动上传到以下位置:
- **Generic Package Registry**:通用软件包仓库
- **Debian Package Registry**stable 发行版
触发条件:新的版本标签推送
### 上传目标
所有 Debian 包统一上传到:
- 发行版:stable
- 组件:main
- 路径:`debian/pool/stable/main`
## 5. 发布后验证
1. 检查 GitHub/Gitea Releases
2. 验证包管理仓库的可用性
3. 测试不同平台的安装
4. 确认 systemd 服务正常运行
## 注意事项
- 遵循语义化版本(Semantic Versioning
- 每次发布前运行完整的测试套件
- 更新 CHANGELOG.md
-55
View File
@@ -1,55 +0,0 @@
# Mond 使用指南
## 基本命令和选项
### 直接运行
```bash
# 基本运行
./mond
# 指定数据目录
./mond --data-dir=/path/to/data
# 指定日志文件
./mond --log-file=/path/to/log
# 后台运行
./mond --detach
```
## Systemd 服务管理
### 服务操作
```bash
# 启用并启动服务
sudo systemctl enable mond.service
sudo systemctl start mond.service
# 查看服务状态
sudo systemctl status mond.service
# 查看实时日志
sudo journalctl -u mond -f
# 停止服务
sudo systemctl stop mond.service
# 禁用服务
sudo systemctl disable mond.service
```
## 配置和日志位置
### Debian/Ubuntu 系统包
- **二进制文件**: `/opt/mond/mond`
- **数据目录**: `/var/lib/mond/`
- **日志目录**: `/var/log/mond/`
### 通用二进制包
- **二进制文件**: 当前目录下的 `mond`
- **数据目录**: 默认为当前用户主目录下的 `.mond`
- **日志目录**: 由 `--log-file` 参数指定,默认为控制台输出
-21
View File
@@ -1,21 +0,0 @@
# Mond 文档
## 概览
[项目概述](/overview/project-overview.md)
## 指南
- [安装指南](/guides/installation.md)
## 架构
- [系统设计](/architecture/system-design.md)
## 参考资料
- [配置参考](/reference/configuration-reference.md)
## 许可证
本文档遵循 BSD-3-Clause 许可证,与 Mond 项目保持一致。
-19
View File
@@ -1,19 +0,0 @@
# Mond: Monero Daemon 定制版
## 1. 身份
- **定义**:Monero 守护进程的定制开源实现
- **目的**:提供高度可移植、易于部署的 Monero 节点解决方案
## 2. 高级描述
Mond 是基于 Monero 项目的定制守护进程实现,专注于多架构支持、简化部署和增强可移植性。通过纯静态链接和多种安装方式,Mond 为不同 Linux 环境中运行 Monero 节点提供了灵活的选择。
## 3. 关键特性
- 多架构支持(AMD64、ARM64
- 多发行版兼容(Ubuntu、Debian
- 纯静态链接
- 灵活的安装和配置选项
- 隐私保护
- 自动更新支持
@@ -1,24 +0,0 @@
# Mond 参考信息
## 核心摘要
Mond 是 Monero 守护进程的定制开源实现,提供高度可配置和可移植的 Monero 节点解决方案。
## 关键信息源
- **源代码库**https://github.com/monero-project/monero
- **官方网站**:未定义(本项目为定制版)
- **授权协议**BSD-3-Clause
## 配置选项参考
### 常用命令行参数
- `--data-dir <path>`:指定数据目录
- `--log-file <path>`:指定日志文件路径
- `--log-level <level>`:日志级别(0-4
- `--detach`:后台运行
- `--rpc-bind-ip <ip>`RPC 绑定 IP
- `--rpc-bind-port <port>`RPC 绑定端口
- `--p2p-bind-ip <ip>`P2P 绑定 IP
- `--p2p-bind-port <port>`P2P 绑定端口
-206
View File
@@ -1,206 +0,0 @@
# Mond 配置参考
## 配置文件
### Debian/Ubuntu 系统包配置文件
Debian/Ubuntu 系统包安装后,Mond 使用配置文件方式运行:
- **配置文件位置**: `/var/lib/mond/params.conf`
- **配置文件格式**: INI 格式,每行一个配置项,采用双语注释(英文大写标题 + 中文详细说明)
- **修改后生效**: 修改配置文件后需要重启服务
```bash
# 编辑配置文件
sudo nano /var/lib/mond/params.conf
# 重启服务使配置生效
sudo systemctl restart mond.service
```
### 配置文件示例
```ini
# DATA STORAGE
# ============================================================================
# data-dir: 区块链数据存储目录
data-dir=/var/lib/mond/data
# BLOCKCHAIN PRUNING
# ============================================================================
# prune-blockchain: 启用区块链修剪模式
prune-blockchain=1
# 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
# SECURITY AND NETWORK INTEGRITY
# ============================================================================
# enforce-dns-checkpointing: 强制执行 DNS 检查点验证
enforce-dns-checkpointing=1
# enable-dns-blocklist: 启用 DNS 黑名单
enable-dns-blocklist=1
# 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 AUTHENTICATION
# ============================================================================
# rpc-login: RPC 访问认证凭据
#rpc-login=user:password
# 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
```
### 配置文件保护
配置文件在以下情况下**不会被覆盖**:
- 执行 `apt upgrade` 升级 mond 包时
- 重新安装 mond 包时
这确保了您的自定义配置不会在更新时丢失。
## 命令行选项
### 使用配置文件
```bash
--config-file <path> # 指定配置文件路径(推荐)
```
### 数据和日志控制
```bash
--data-dir <path> # 指定数据目录
--log-file <path> # 指定日志文件路径
--log-level <level> # 日志级别 (0-4)
--detach # 后台运行
```
### 网络配置
```bash
--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)
```
**注意**: 命令行参数会覆盖配置文件中的对应设置。
## 目录结构
### Debian/Ubuntu 系统包
```
/opt/mond/mond # 二进制文件
/var/lib/mond/params.conf # 配置文件
/var/lib/mond/data/ # 区块链数据目录
/var/log/mond/ # 日志目录
```
### 通用二进制包
```
./mond # 二进制文件
~/.mond/ # 默认数据目录
```
## Systemd 服务配置
### 服务文件位置
`/lib/systemd/system/mond.service`
### 关键配置段
```ini
[Service]
WorkingDirectory=/opt/mond
# 使用配置文件启动
ExecStart=/opt/mond/mond --config-file=/var/lib/mond/params.conf --non-interactive
User=mond
Group=mond
# 安全设置
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/mond /var/lib/mond/data /var/log/mond
```
### 修改服务配置
systemd 服务文件使用 `--config-file` 参数,所有运行时配置都在配置文件中设置。
如需修改服务配置:
1. 编辑配置文件:`sudo nano /var/lib/mond/params.conf`
2. 重启服务:`sudo systemctl restart mond.service`
**不建议**直接修改 systemd 服务文件,因为包更新时可能会被覆盖。
## 日志级别
- `0`: 仅记录关键错误
- `1`: 记录错误和警告
- `2`: 标准日志级别(默认)
- `3`: 详细日志
- `4`: 调试级别(最详细)
-20
View File
@@ -1,20 +0,0 @@
# Mond 项目常见问题解答
## 构建问题
### Q1: 编译时出现 Boost 组件缺失错误
**解决方案:**
- 确保安装所有必需的 Boost 组件
- Alpine Linux 需要额外安装 boost-static 和具体组件包
### Q2: 版本宏定义错误
**解决方案:**
- 检查 init.sh 脚本
- 确保使用正确的 sed 替换命令
- 全局替换 MONERO_VERSION 为 MOND_VERSION
### Q3: CMake 构建失败
**排查步骤:**
1. 验证 CMake 版本兼容性
2. 检查依赖库安装情况
3. 确认编译器版本支持