chore: remove Windows deployment scripts and update hub usage examples

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-04 11:53:42 +08:00
parent 1282293e91
commit 4569e070fd
3 changed files with 16 additions and 256 deletions
+16 -22
View File
@@ -51,8 +51,10 @@
### 2.1 依赖安装
```powershell
cd c:\Users\dekun\Desktop\crypto_monitor\manual_trading_hub
```bash
cd /opt/crypto_monitor/manual_trading_hub
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
@@ -71,8 +73,9 @@ pip install -r requirements.txt
### 2.3 强制关闭某账户
```powershell
$env:HUB_DISABLED_IDS="1" # 默认即关闭 OKXid=1
```bash
# 在 manual_trading_hub/.env 中设置,或临时:
export HUB_DISABLED_IDS=1 # 默认即关闭 OKXid=1
```
与设置页「启用」取 **与** 关系:环境变量强制关闭时,网页勾选框会灰掉且无法启用。
@@ -229,22 +232,14 @@ Chrome **桌面快捷方式**图标来自站点 `favicon` / `manifest`(已配
- `DB_PATH` → 独立库(如 `crypto_gate2.db`),**勿**与 5000/5002 共用 `crypto.db`
- `GATE_API_KEY` / `GATE_API_SECRET`**该子账户** 密钥
- `HUB_BRIDGE_TOKEN` → 与中控、其它实例 **相同**
3. 安装 venv 与依赖( Gate 部署文档相同),启动:
3. 安装 venv 与依赖(`bash /opt/crypto_monitor/deploy/setup_env.sh --only gate` 或按 Gate 部署文档),启动:
```powershell
cd crypto_monitor_gate_2
$env:PYTHONPATH=".."
python app.py
```bash
cd /opt/crypto_monitor/crypto_monitor_gate_2
pm2 start ecosystem.config.cjs
```
4. 另开终端,**cwd 必须为新目录**,启动子代理:
```powershell
cd crypto_monitor_gate_2
$env:EXCHANGE="gate"
$env:PORT="15204"
python ..\manual_trading_hub\agent.py
```
4. 在中控 `ecosystem.config.cjs` 增加对应 agent,或单独 `run_agent.sh` 配置后 `pm2 restart`(勿与已有 agent 端口冲突)。
验收:`curl http://127.0.0.1:5005/login` 能开页;`curl http://127.0.0.1:15204/status` 返回 `ok`
@@ -382,9 +377,8 @@ PM2:仓库 `ecosystem.config.cjs` 默认只有四 agent;第五户需自行 `
手动探测实例桥接:
```powershell
$tok = "你的令牌"
Invoke-WebRequest -Uri "http://127.0.0.1:5001/api/hub/ping" -Headers @{"X-Hub-Token"=$tok}
```bash
curl -sS -H "X-Hub-Token: 你的令牌" http://127.0.0.1:5001/api/hub/ping
```
---
@@ -399,10 +393,10 @@ Invoke-WebRequest -Uri "http://127.0.0.1:5001/api/hub/ping" -Headers @{"X-Hub-To
子代理 `agent.py` 仍负责持仓与全平;`HUB_AGENTS` 环境变量在新版 hub 中 **不再使用**(以设置文件为准)。
**PM2 守护(推荐 Linux**
**PM2 守护**
```bash
cd manual_trading_hub
cd /opt/crypto_monitor/manual_trading_hub
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt