From 4de9a8a38dc3680e66e808ca2297c09db1918e34 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 22 May 2026 06:25:04 +0000 Subject: [PATCH] ecosystem: pass --external_ip / --listener_port to the miner Without --external_ip the miner advertises http://0.0.0.0: on /miners/active, which validators can't reach. Pull both values from the .env loader (already the source of truth for RADAR_MINER_API_KEY et al.) so operators can set RADAR_MINER_EXTERNAL_IP in one place and pm2 restart picks it up. --- ecosystem.config.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ecosystem.config.js b/ecosystem.config.js index 47eb390..b97b477 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -64,13 +64,27 @@ const sharedEnv = { const agentDir = env.RADAR_AGENT_DIR || "../radar-miner-examples/agents/autonomous/"; +// Listener — validators POST /prepare here to dispatch training. The +// URL the DB advertises is http://:, so +// externalIp must be reachable from the validator (public IP or DNS +// name). Defaulting to 0.0.0.0 keeps the miner running but invisible +// to validators — set RADAR_MINER_EXTERNAL_IP in .env on real deploys. +const externalIp = env.RADAR_MINER_EXTERNAL_IP || "0.0.0.0"; +const listenerPort = env.RADAR_MINER_LISTENER_PORT || "8090"; + +const minerArgs = [ + "--agent_dir", agentDir, + "--external_ip", externalIp, + "--listener_port", listenerPort, +].join(" "); + module.exports = { apps: [ { name: "radar-miner", script: "miner/neuron.py", interpreter: "python3", - args: `--agent_dir ${agentDir}`, + args: minerArgs, cwd: __dirname, env: sharedEnv, autorestart: true,