Files
foxhunt/scripts/start_all_services.sh
jgrusewski 8d89fe80ff chore: Second cleanup wave - organize root directory
- Archive: 85 agent .txt files → docs/archive/agents/legacy_txt/
- Scripts: Move 110 shell scripts → scripts/ (keep deploy.sh in root)
- Models: Move 18 .safetensors → ml/models/checkpoints/training_artifacts/
- Delete: 34 directories (~33GB freed) - target/, coverage_*, test artifacts
- Build: Clean 14 build artifacts (.rlib, .o, .pid, binaries)
- Tests: Move 14 .rs files → tests/standalone/
- SQL: Move 5 files → sql/ (keep init-db*.sql for Docker)
- Wave 153: Archive to docs/archive/historical/wave153/
- Docs: Archive 9 markdown files to wave_d/reports/ and historical/

Total impact: ~34GB freed (both waves), root directory cleaned from 583 to ~40 essential files
Directory count reduced from 65 to 31 (52% reduction)
All historical data preserved in organized archive structure
2025-10-30 01:26:02 +01:00

94 lines
2.8 KiB
Bash
Executable File

#!/bin/bash
# Wave 75 Agent 1: Start all backend services with proper TLS configuration
set -e
# Load and export environment variables
set -a
source .env
set +a
# Create logs directory
mkdir -p logs
echo "Starting Foxhunt HFT Services..."
echo "================================"
# Start Trading Service (port 50051)
echo "[1/4] Starting Trading Service on port 50051..."
./target/release/trading_service &> logs/trading.log &
TRADING_PID=$!
sleep 3
# Check if trading service started successfully
if ! kill -0 $TRADING_PID 2>/dev/null; then
echo "ERROR: Trading Service failed to start. Check logs/trading.log"
tail -20 logs/trading.log
exit 1
fi
echo "✓ Trading Service started (PID: $TRADING_PID)"
# Start Backtesting Service (port 50052)
echo "[2/4] Starting Backtesting Service on port 50052..."
./target/release/backtesting_service &> logs/backtesting.log &
BACKTEST_PID=$!
sleep 3
# Check if backtesting service started successfully
if ! kill -0 $BACKTEST_PID 2>/dev/null; then
echo "ERROR: Backtesting Service failed to start. Check logs/backtesting.log"
tail -20 logs/backtesting.log
exit 1
fi
echo "✓ Backtesting Service started (PID: $BACKTEST_PID)"
# Start ML Training Service (port 50053)
echo "[3/4] Starting ML Training Service on port 50053..."
./target/release/ml_training_service serve &> logs/ml_training.log &
ML_PID=$!
sleep 3
# Check if ML training service started successfully
if ! kill -0 $ML_PID 2>/dev/null; then
echo "ERROR: ML Training Service failed to start. Check logs/ml_training.log"
tail -20 logs/ml_training.log
exit 1
fi
echo "✓ ML Training Service started (PID: $ML_PID)"
# Wait for backend services to be ready
echo "Waiting for backend services to initialize..."
sleep 5
# Start API Gateway (port 50050)
echo "[4/4] Starting API Gateway on port 50050..."
./target/release/api_gateway &> logs/api_gateway.log &
GATEWAY_PID=$!
sleep 3
# Check if API gateway started successfully
if ! kill -0 $GATEWAY_PID 2>/dev/null; then
echo "ERROR: API Gateway failed to start. Check logs/api_gateway.log"
tail -20 logs/api_gateway.log
exit 1
fi
echo "✓ API Gateway started (PID: $GATEWAY_PID)"
echo ""
echo "================================"
echo "All services started successfully!"
echo "================================"
echo "Trading Service: localhost:50051 (PID: $TRADING_PID)"
echo "Backtesting Service: localhost:50052 (PID: $BACKTEST_PID)"
echo "ML Training Service: localhost:50053 (PID: $ML_PID)"
echo "API Gateway: localhost:50050 (PID: $GATEWAY_PID)"
echo ""
echo "Environment:"
echo " DATABASE: $DATABASE_URL"
echo " REDIS: $REDIS_URL"
echo " TLS CA: $TLS_CA_PATH"
echo ""
echo "Logs: ./logs/"
echo ""
echo "To stop all services: pkill -f '(trading_service|backtesting_service|ml_training_service|api_gateway)'"