-
Notifications
You must be signed in to change notification settings - Fork 785
Expand file tree
/
Copy pathmeshnode.sh
More file actions
65 lines (52 loc) · 1.73 KB
/
meshnode.sh
File metadata and controls
65 lines (52 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
# ShadowBroker Mesh Node — lightweight, headless
# Syncs the Infonet chain only. No map, no frontend, no data feeds.
set -e
echo "==================================================="
echo " S H A D O W B R O K E R -- MESH NODE"
echo "==================================================="
echo ""
echo " Lightweight node — syncs the Infonet chain only."
echo " No map, no frontend, no data feeds."
echo " Press Ctrl+C to stop."
echo ""
# Check Python
if ! command -v python3 &>/dev/null; then
echo "[!] ERROR: Python 3 is not installed."
echo "[!] Install Python 3.10-3.12"
exit 1
fi
PYVER=$(python3 --version 2>&1 | awk '{print $2}')
echo "[*] Found Python $PYVER"
cd "$(dirname "$0")/backend"
# Setup venv
if [ ! -d "venv" ]; then
echo "[*] Creating Python virtual environment..."
python3 -m venv venv
fi
source venv/bin/activate
echo "[*] Installing Python dependencies..."
pip install -q -r requirements.txt
# Install ws for ais_proxy
if [ ! -d "node_modules/ws" ]; then
if command -v npm &>/dev/null; then
echo "[*] Installing backend Node.js dependencies..."
npm ci --omit=dev --silent 2>/dev/null || true
fi
fi
echo "[*] Dependencies OK."
# Auto-enable node
echo "[*] Auto-enabling node participation..."
mkdir -p data
echo '{"enabled":true,"updated_at":0}' > data/node.json
echo ""
echo "==================================================="
echo " Mesh node starting on port 8000"
echo " Mode: MESH_ONLY (no data feeds)"
echo " Relay: ${MESH_RELAY_PEERS:-default}"
echo " Press Ctrl+C to stop"
echo "==================================================="
echo ""
export MESH_ONLY=true
export MESH_NODE_MODE=participant
python3 -m uvicorn main:app --host 0.0.0.0 --port 8000