Files
p2pool/llmdoc/guides/debian-package.md
Wang Defa 9ff0daa938
All checks were successful
Build and Release / build-and-test (arm64, alpine) (push) Successful in 30s
Build and Release / build-and-test (amd64, alpine) (push) Successful in 42s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 41s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 54s
Build and Release / release (push) Has been skipped
添加配置文件管理和完整文档系统
- 重构配置方式:使用 params.conf 替代命令行参数
- postinst 自动创建配置文件,升级时保护用户配置
- 初始化 llmdoc 文档系统(概述、架构、指南、参考)
- 创建 README.md 和配置指南
- 提供完整的配置模板示例

配置文件优势:升级安全、集中管理、易于维护
2025-12-19 09:20:33 +08:00

135 lines
2.8 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.
# Debian 包安装与配置指南
## 安装步骤
### 添加 Gitea 包仓库
```bash
# 导入 Gitea 仓库密钥
sudo curl https://GITEA_URL/api/packages/OWNER/debian/repository.key \
-o /etc/apt/keyrings/gitea-OWNER.asc
# 添加仓库源(以 Debian 12 为例)
echo "deb [signed-by=/etc/apt/keyrings/gitea-OWNER.asc] \
https://GITEA_URL/api/packages/OWNER/debian bookworm main" | \
sudo tee /etc/apt/sources.list.d/OWNER.list
# 更新包列表并安装
sudo apt-get update
sudo apt-get install p2pool
```
## 配置 P2Pool
### 编辑配置文件
P2Pool 使用配置文件 `/var/lib/p2pool/params.conf` 来管理所有设置。安装后会自动创建示例配置文件。
```bash
# 编辑配置文件
sudo nano /var/lib/p2pool/params.conf
```
配置文件示例:
```conf
# P2Pool Configuration File
# Monero node connection
host = 127.0.0.1
rpc-port = 18081
zmq-port = 18083
# Your Monero wallet address (REQUIRED)
wallet = YOUR_MONERO_WALLET_ADDRESS
# P2P settings
p2p = 0.0.0.0:37889
# API settings
data-api = /var/lib/p2pool/data-api
local-api = true
# Logging
log-file = /var/log/p2pool/p2pool.log
loglevel = 3
# Mining mode (uncomment to enable mini sidechain)
# mini = true
# Stratum server (for miners to connect)
# stratum = 0.0.0.0:3333
```
### 关键配置参数
- `host`Monero 节点的 IP 地址
- `rpc-port`Monero 节点的 RPC 端口
- `zmq-port`Monero 节点的 ZMQ 端口
- `wallet`**必需** - 您的 Monero 钱包地址
- `mini`:启用 mini 侧链(适合算力较小的矿工)
- `stratum`Stratum 服务器地址,供矿机连接
- `loglevel`日志级别0-63 为默认值)
### 配置文件的优势
-**版本升级安全**`params.conf``apt upgrade` 时不会被覆盖
-**易于管理**:所有配置集中在一个文件中
-**支持注释**:可以添加说明和注释
-**无需修改 systemd**:避免编辑系统服务文件
## 启动和管理服务
```bash
# 启用服务,设置开机自启
sudo systemctl enable p2pool.service
# 启动服务
sudo systemctl start p2pool.service
# 查看服务状态
sudo systemctl status p2pool.service
# 查看实时日志
sudo journalctl -u p2pool -f
```
## 目录结构
- `/opt/p2pool/p2pool`P2Pool 二进制文件
- `/var/lib/p2pool/`:数据目录
- `/var/log/p2pool/`:日志目录
## 安全建议
- 使用专用钱包地址
- 限制 Stratum 端口的网络访问
- 定期更新 p2pool 版本
## 故障排查
### 常见错误
- RPC 端口配置不正确
- 钱包地址无效
- 网络连接问题
### 检查日志
```bash
# 查看完整日志
sudo cat /var/log/p2pool/p2pool.log
# 查看最近错误
sudo journalctl -u p2pool -n 50 --no-pager
```
## 版本管理
```bash
# 查看当前版本
/opt/p2pool/p2pool --version
# 检查可用更新
sudo apt-get update
sudo apt-cache policy p2pool
```