Files
microdao-daarion/scripts/start-node2-guardian.sh
Apple 80123fd1be feat(node2): Add scripts and docs for NODE2 guardian setup
- Add start-node2-guardian.sh script for easy launch
- Add setup-node2-agents.sh to update node_id for NODE2 agents
- Add NODE2_GUARDIAN_QUICKSTART.md with detailed instructions
- Update agents node_id to node-2-macbook-m4max
2025-12-02 06:59:48 -08:00

51 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Start Node Guardian for NODE2 (MacBook)
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
cd "$PROJECT_ROOT"
# Check if Python 3 is available
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed"
exit 1
fi
# Check if httpx is installed
if ! python3 -c "import httpx" 2>/dev/null; then
echo "⚠️ httpx not installed. Installing..."
pip3 install httpx
fi
# Set environment variables
export NODE_ID="node-2-macbook-m4max"
export NODE_NAME="НОДА2"
export NODE_ENVIRONMENT="development"
export NODE_ROLES="gpu,ai_runtime"
export NODE_HOSTNAME="$(hostname)"
export CITY_SERVICE_URL="https://daarion.space/api/city"
export NODE_SWAPPER_URL="http://localhost:8890"
export NODE_ROUTER_URL="http://localhost:9102"
export GUARDIAN_INTERVAL="60"
echo "🚀 Starting Node Guardian for NODE2..."
echo " Node ID: $NODE_ID"
echo " City Service: $CITY_SERVICE_URL"
echo " Swapper URL: $NODE_SWAPPER_URL"
echo " Router URL: $NODE_ROUTER_URL"
echo ""
# Run node-guardian-loop
python3 "$PROJECT_ROOT/scripts/node-guardian-loop.py" \
--node-id "$NODE_ID" \
--node-name "$NODE_NAME" \
--city-url "$CITY_SERVICE_URL" \
--environment "$NODE_ENVIRONMENT" \
--roles "$NODE_ROLES" \
--hostname "$NODE_HOSTNAME" \
--interval "$GUARDIAN_INTERVAL"