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

This commit is contained in:
dekun
2026-05-22 10:32:51 +08:00
parent 6695e72e72
commit 94d4c3b777
7 changed files with 133 additions and 138 deletions
+5 -39
View File
@@ -1,45 +1,11 @@
/**
* PM2:四路子代理 agent.py(可选,与中控分开管理
* 仅子代理(一般不单独用;默认请 pm2 start ecosystem.config.cjs 一次起 hub+agent
*
* 每个 app 在对应 crypto_monitor_* 目录启动,以加载该目录 .env 中的 API 密钥。
* Python 解释器使用 manual_trading_hub/.venv(须已 pip install -r requirements.txt)。
*
* 启动:
* pm2 start ecosystem.agents.config.cjs
*
* 仅启动部分账户可编辑下方 apps 数组,或:
* pm2 start ecosystem.agents.config.cjs --only manual-agent-binance
* 若只想重启子代理、不动中控:
* pm2 restart manual-agent-binance manual-agent-gate ...
*/
const path = require("path");
const HUB_DIR = __dirname;
const REPO_ROOT = path.join(HUB_DIR, "..");
const PY = path.join(HUB_DIR, ".venv", "bin", "python");
const AGENT = path.join(HUB_DIR, "agent.py");
function agentApp(name, exchangeDir, exchange, port) {
return {
name,
cwd: path.join(REPO_ROOT, exchangeDir),
script: AGENT,
interpreter: PY,
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: "400M",
env: {
EXCHANGE: exchange,
PORT: String(port),
HOST: "127.0.0.1",
},
};
}
const main = require("./ecosystem.config.cjs");
module.exports = {
apps: [
agentApp("manual-agent-binance", "crypto_monitor_binance", "binance", 15200),
agentApp("manual-agent-okx", "crypto_monitor_okx", "okx", 15201),
agentApp("manual-agent-gate", "crypto_monitor_gate", "gate", 15202),
agentApp("manual-agent-gate-bot", "crypto_monitor_gate_bot", "gate", 15203),
],
apps: main.apps.filter((a) => String(a.name).startsWith("manual-agent-")),
};