guide: full step-by-step (reg -> shim -> channel -> all ranks -> diagnostics); probe watcher rotates keys

This commit is contained in:
2026-11-13 22:24:03 +02:00
parent 5075c3f19f
commit 846eb86aaf
3 changed files with 215 additions and 2 deletions
+5 -2
View File
@@ -12,7 +12,7 @@ import sys
import time
from concurrent.futures import ThreadPoolExecutor
KEYS = os.environ.get("NUMES_KEYS", "/opt/numes-shim/keys.json")
KEYS = "/opt/numes-shim/keys.json"
BASE = "https://api.numes.ai/api/v1"
CHANNEL = "numes-pool"
STATE = "/opt/numes-shim/watch_state.json"
@@ -34,11 +34,14 @@ def log(msg):
def first_key():
"""Rotate across the key bank so one account never eats the whole probe load."""
try:
d = json.load(open(KEYS))
if isinstance(d, dict):
d = d.get("keys", [])
return d[0] if d else None
if not d:
return None
return d[int(time.time() // 600) % len(d)]
except Exception:
return None