docs: update NODE1 docs for MD pipeline deploy (ports 8893/8892)

- Fix market-data-service host port 8891→8893 (conflict with Swapper)
- Increase healthcheck start_period/retries for market-data-service
- Add Market Data Service + SenpAI MD Consumer to PROJECT-MASTER-INDEX.md
- Update noda1-operations rule and skill with new ports/containers

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Apple
2026-02-09 12:27:45 -08:00
parent 09dee24342
commit 0555ee9fa6
4 changed files with 70 additions and 6 deletions

View File

@@ -28,8 +28,10 @@ alwaysApply: true
| Qdrant | 6333 | `/healthz` |
| RAG | 9500 | `/health` |
| Swapper | 8890 | `/health` |
| Market Data Service | 8893 | `/health` |
| SenpAI MD Consumer | 8892 | `/health` |
Контейнери: `dagi-gateway-node1`, `dagi-router-node1`, `dagi-memory-service-node1`, `dagi-qdrant-node1`, `swapper-service-node1`, `ollama`.
Контейнери: `dagi-gateway-node1`, `dagi-router-node1`, `dagi-memory-service-node1`, `dagi-qdrant-node1`, `swapper-service-node1`, `dagi-market-data-node1`, `dagi-senpai-md-consumer-node1`, `ollama`.
## Перевірка агентів

View File

@@ -50,7 +50,9 @@ curl -s http://localhost:9300/health | jq '.status, .agents_count, .agents'
curl -s http://localhost:9102/health
curl -s http://localhost:8000/health
curl -s http://localhost:6333/healthz
docker ps --format 'table {{.Names}}\t{{.Status}}' | grep -E 'gateway|router|memory|qdrant'
curl -s http://localhost:8893/health # Market Data Service
curl -s http://localhost:8892/health # SenpAI MD Consumer
docker ps --format 'table {{.Names}}\t{{.Status}}' | grep -E 'gateway|router|memory|qdrant|market|senpai'
```
## 3. Типові виправлення
@@ -61,6 +63,8 @@ docker ps --format 'table {{.Names}}\t{{.Status}}' | grep -E 'gateway|router|mem
| Gateway не відповідає | `docker logs dagi-gateway-node1 --tail 100`; при потребі `docker restart dagi-gateway-node1` |
| Memory 500 | Перевірити env `MEMORY_QDRANT_HOST` та доступність Qdrant |
| Агент без prompt/token | Перевірити `gateway-bot/http_api.py` (AGENT_REGISTRY) і на сервері: `*_prompt.txt`, env з `*_TELEGRAM_BOT_TOKEN` |
| Market Data unhealthy | `docker logs dagi-market-data-node1 --tail 50`; перевірити NATS і WS з'єднання |
| SenpAI Consumer unhealthy | `docker logs dagi-senpai-md-consumer-node1 --tail 50`; перевірити NATS і market-data-service |
## 4. Виправлення помилок

View File

@@ -137,6 +137,8 @@ python3 tools/agents smoke --id <agent_id> # Smoke test
| **NATS** | 4222 | - |
| **Grafana** | 3030 | `/api/health` |
| **Prometheus** | 9090 | `/-/healthy` |
| **Market Data Service** | 8893 | `/health` |
| **SenpAI MD Consumer** | 8892 | `/health` |
---
@@ -282,5 +284,61 @@ TELEGRAM → GATEWAY:9300 → ROUTER:8000 → LLM (Ollama/DeepSeek)
---
## 📈 Market Data Pipeline (SenpAI)
**Дата впровадження:** 2026-02-09
### Архітектура
```
Binance WS ─┐ ┌─ senpai.features.{symbol}
Bybit WS ───┤→ market-data-service ──NATS──→ senpai-md-consumer ──NATS──→ senpai.signals.{symbol}
│ (порт 8893) md.events.> (порт 8892) └─ senpai.alerts
└─ SQLite + JSONL
```
### Компоненти
| Сервіс | Контейнер | Порт | Призначення |
|--------|-----------|------|-------------|
| **market-data-service** | `dagi-market-data-node1` | 8893 | WS producer: Binance+Bybit → NATS `md.events.>` |
| **senpai-md-consumer** | `dagi-senpai-md-consumer-node1` | 8892 | NATS consumer: features, signals, alerts |
### Ключові endpoints
```bash
# Producer
curl http://localhost:8893/health
curl http://localhost:8893/metrics
curl http://localhost:8893/bus-stats
curl "http://localhost:8893/latest?symbol=BTCUSDT"
# Consumer
curl http://localhost:8892/health
curl http://localhost:8892/stats
curl "http://localhost:8892/features/latest?symbol=BTCUSDT"
curl http://localhost:8892/metrics
```
### NATS subjects
| Subject | Publisher | Payload |
|---------|-----------|---------|
| `md.events.trade.{symbol}` | market-data-service | TradeEvent |
| `md.events.quote.{symbol}` | market-data-service | QuoteEvent |
| `senpai.features.{symbol}` | senpai-md-consumer | FeatureSnapshot (11 features) |
| `senpai.signals.{symbol}` | senpai-md-consumer | TradeSignal (long/short) |
| `senpai.alerts` | senpai-md-consumer | AlertEvent (gaps/latency) |
### Файли
| Шлях | Опис |
|------|------|
| `services/market-data-service/` | Код producer-сервісу |
| `services/senpai-md-consumer/` | Код consumer-сервісу |
| Docker volume `market-data-node1` | SQLite DB + JSONL events log |
---
**Автор:** Cursor Agent
**Останнє оновлення:** 2026-01-29
**Останнє оновлення:** 2026-02-09

View File

@@ -646,7 +646,7 @@ services:
- LOG_LEVEL=INFO
- LOG_SAMPLE_RATE=500
ports:
- "8891:8891"
- "8893:8891"
volumes:
- market-data-node1:/data
networks:
@@ -660,8 +660,8 @@ services:
- python -c "import urllib.request; urllib.request.urlopen('http://localhost:8891/health')"
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
retries: 5
start_period: 30s
senpai-md-consumer:
container_name: dagi-senpai-md-consumer-node1
restart: unless-stopped