环境要求
| 组件 | 最低要求 |
|---|---|
| 中继服务端 | Linux x86_64,1 核 512MB RAM,公网 IP,开放 8443/8444 端口 |
| 本地客户端 | Linux 或 Windows,与矿机同局域网 |
| 矿机 | 支持 Stratum 协议(BTC/ETH/LTC/KAS 等均可) |
| 数据库(可选) | SQLite(内置,无需额外安装) |
1
步骤一 — 部署服务端
下载服务端二进制文件并使用默认配置启动。
bash
# Download the latest server binary (Linux x86_64)
curl -Lo hashrelay-server https://github.com/hashrelay/hashrelay/releases/latest/download/server-linux-x86_64
chmod +x hashrelay-server
# Start with default config (SQLite mode)
./hashrelay-server --config server.toml2
步骤二 — 安装客户端
在与矿机同局域网的机器上安装。
bash
# Download the latest client binary (Linux x86_64)
curl -Lo hashrelay-client https://github.com/hashrelay/hashrelay/releases/latest/download/client-linux-x86_64
chmod +x hashrelay-client
# Start the client
./hashrelay-client --config client.toml配置说明
- •在 client.toml 中设置服务端地址和管理员 Token
- •选择传输协议:tcp_tls、tcp_encrypt 或 quic
- •配置为 systemd 服务或 Windows 服务以实现开机自启
3
步骤三 — 配置端口映射
通过 API 创建矿池和端口映射。
bash
# Create a pool
curl -X POST http://YOUR_SERVER:8080/api/v1/pools \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"F2Pool-BTC","coin":"BTC","host":"stratum.f2pool.com","port":3333}'
# Create a port mapping (local port 13333 → F2Pool BTC)
curl -X POST http://YOUR_SERVER:8080/api/v1/port-mappings \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"local_port":13333,"pool_id":1}'刚刚发生了什么
- •将矿机矿池地址改为 客户端IP:13333 即可开始挖矿
- •验证:查看服务端日志或调用 /api/v1/system/status
- •从这一刻起,所有流量都会通过隧道自动加密
部署成功!
您的挖矿中继已启动。请检查以下内容:
- 客户端在线(心跳正常)
- 矿机 Share 提交成功
- 服务端日志无报错
接下来做什么?
📊
查看算力统计
实时监控每个 Worker 的性能
⚡
开启请求聚合
大型矿场专用 — 减少 99.8% 的连接数
🔔
配置预警通知
异常发生时即时收到通知