docs: unify Ubuntu root /opt PM2 deployment and refresh README

Add docs/ubuntu-server.md; remove Windows and alternate process managers from deployment guides; index strategy, key monitor, TP/SL, breakeven, and replay docs in root README.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-04 11:48:54 +08:00
parent 546bc7bcf1
commit 1282293e91
16 changed files with 355 additions and 491 deletions
+7 -8
View File
@@ -175,7 +175,7 @@ pm2 save
curl -s http://127.0.0.1:15202/status | head -c 200 # 应 ok:true
```
**预防**`.env` 保存为 **LF**Windows `deploy/setup_env.ps1` 复制 `.env.example` 时已写 LF。子代理须经 **`scripts/run_agent.sh`** 启动(内置去 CRLF 的 `load_dotenv_file`),勿裸跑 `python agent.py`
**预防**`.env` 保存为 **LF**(勿在 Windows 记事本直接保存 CRLF。子代理须经 **`scripts/run_agent.sh`** 启动(内置去 CRLF 的 `load_dotenv_file`),勿裸跑 `python agent.py`
详见 [常见问题.md](./常见问题.md) **§3.1**、**§3.3**。
@@ -186,7 +186,7 @@ curl -s http://127.0.0.1:15202/status | head -c 200 # 应 ok:true
需**分别**起 agent 与 hub(与 PM2 合并启动不同):
```bash
# 子代理:scripts/start_agents_3screen.sh 或每目录手动 agent.py
# 子代理:由 ecosystem.config.cjs 经 run_agent.sh 启动(勿用手动多终端)
# 中控:
cd /opt/crypto_monitor/manual_trading_hub
bash scripts/run_hub.sh
@@ -303,12 +303,10 @@ pm2 restart ecosystem.config.cjs
---
## 十二、其它常驻方式
## 十二、进程托管说明
- **screen**`scripts/start_hub_screen.sh` / `stop_hub_screen.sh`
- **systemd**`scripts/example-systemd/manual-hub.service.example`(复制并改路径)
与 PM2 **二选一** 即可,避免同一端口启动两份 hub。
中控与子代理 **仅使用 PM2**`ecosystem.config.cjs`)。勿再用 screen / systemd / nohup 启动 `hub.py` 或 `agent.py`,以免端口冲突。
环境要求见 **[docs/ubuntu-server.md](../docs/ubuntu-server.md)**。
---
@@ -331,7 +329,8 @@ pm2 restart ecosystem.config.cjs
| [常见问题.md](./常见问题.md) | 故障实录 |
| [README.md](./README.md) | 速览 |
| [.env.example](./.env.example) | 环境变量模板 |
| [scripts/后台运行-Ubuntu.md](./scripts/后台运行-Ubuntu.md) | screen / systemd |
| [scripts/后台运行-Ubuntu.md](./scripts/后台运行-Ubuntu.md) | PM2 常驻(唯一推荐) |
| [docs/ubuntu-server.md](../docs/ubuntu-server.md) | Ubuntu / Python / Node / PM2 |
| `scripts/fix_hub_deps.sh` | 安装依赖 |
| `scripts/verify_hub_deploy.sh` | 部署验收 |
| `scripts/fix_env_crlf.sh` | 修复 .env 换行 |