中控增加下单,关键位,系统设置

This commit is contained in:
dekun
2026-05-22 10:37:35 +08:00
parent 94d4c3b777
commit 6d7b45e714
4 changed files with 38 additions and 9 deletions
+4 -3
View File
@@ -36,7 +36,7 @@ source .venv/bin/activate # 激活 venv(当前终端后续 pip/python
pip install -r requirements.txt
cp .env.example .env
# 编辑 .envHUB_PORT、HUB_DISABLED_IDS、公网时 HUB_BRIDGE_TOKEN 等
chmod +x scripts/run_hub.sh scripts/pm2_hub.sh scripts/pm2_agents.sh
chmod +x scripts/run_hub.sh scripts/run_agent.sh scripts/pm2_hub.sh scripts/pm2_agents.sh
deactivate # 可选;交给 PM2 时不必保持激活
```
@@ -70,7 +70,7 @@ deactivate # 可选;交给 PM2 时不必保持激活
|------|----------|
| `ecosystem.config.cjs` | `manual-agent-binance` / `okx` / `gate` / `gate-bot` + **`manual-trading-hub`** |
`run_hub.sh` 加载 **`manual_trading_hub/.env`** 后执行 `hub.py`;各 agent 在对应策略目录启动以读取该目录 **`.env`** 中的 API 密钥。
`run_hub.sh` 加载 **`manual_trading_hub/.env`** 后执行 `hub.py`;各 agent **`run_agent.sh`** 在对应策略目录加载 **`.env`**(含 API 密钥),再执行 `agent.py`
```bash
cd /opt/crypto_monitor/manual_trading_hub
@@ -215,7 +215,8 @@ pm2 restart ecosystem.config.cjs
| 现象 | 处理 |
|------|------|
| PM2 启动后立刻退出 | `pm2 logs manual-trading-hub`;检查 `.venv``.env``run_hub.sh` 可执行 |
| 监控无持仓 | 子代理未起或 Agent URL 错`curl http://127.0.0.1:15200/status` |
| 余额显示 —、无报错 | 子代理未加载策略目录 `.env`(旧版 PM2 直接跑 agent.py) | 更新代码后 `pm2 restart ecosystem.config.cjs``curl http://127.0.0.1:15200/status``ok:true` 且有 `balance_usdt` |
| 监控无持仓 | 子代理未起或 Agent URL 错;或交易所确实无仓 | `curl http://127.0.0.1:15200/status` |
| 无关键位/下单 401 | Flask 未起或 `HUB_BRIDGE_TOKEN` 不一致;或设 `APP_AUTH_DISABLED=true` |
| 子代理 SOCKS 报错 | 在 **manual_trading_hub/.venv** 安装 `PySocks`**pm2 restart** 子代理 |
| 公网访问中控 403 | 反代未指向本机、或客户端非私网且 `HUB_TRUST_LAN=true`;反代改 `127.0.0.1:5100` 或在反代层鉴权 |