Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Clone all repos to `~/repos/`:
├── council-console/ # Council dashboard
├── pay-platform/ # Moonlight Pay backend (accounts, transactions, POS)
├── moonlight-pay/ # Moonlight Pay frontend (wallet sign-in, POS checkout)
└── network-dashboard/ # Network monitoring dashboard
├── network-dashboard/ # Network monitoring dashboard
└── ui/ # Shared component library (gallery dev server on :3060)
```

If your repos live somewhere other than `~/repos/`, set `BASE_DIR`:
Expand Down Expand Up @@ -109,7 +110,7 @@ This split exists for three reasons:
./up.sh
```

This is the single entry point. It calls `setup-keys.sh` (generates deterministic keypairs) then `infra-up.sh` (starts all services). The infra script runs through 11 sections:
This is the single entry point. It calls `setup-keys.sh` (generates deterministic keypairs) then `infra-up.sh` (starts all services). The infra script runs through 12 sections:

1. Checks prerequisites (Docker, Stellar CLI, Deno) and auto-installs missing ones
2. Starts Jaeger (OTLP on `:4318`, UI on `:16686`)
Expand All @@ -122,6 +123,7 @@ This is the single entry point. It calls `setup-keys.sh` (generates deterministi
9. Builds and serves council-console on `:3030`
10. Builds and serves Moonlight Pay on `:3050`
11. Builds and serves network-dashboard on `:3040`
12. Builds and serves @moonlight/ui gallery on `:3060`

After `up.sh` finishes the services are healthy and reachable, but the protocol state is empty: no contracts deployed, no councils, no PPs. Run the setup scripts to populate it.

Expand Down
3 changes: 3 additions & 0 deletions down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ COUNCIL_CONSOLE_PORT="${COUNCIL_CONSOLE_PORT:-3030}"
MOONLIGHT_PAY_PORT="${MOONLIGHT_PAY_PORT:-3050}"
NETWORK_DASHBOARD_PORT="${NETWORK_DASHBOARD_PORT:-3040}"
NETWORK_DASHBOARD_PLATFORM_PORT="${NETWORK_DASHBOARD_PLATFORM_PORT:-3035}"
MOONLIGHT_UI_PORT="${MOONLIGHT_UI_PORT:-3060}"
PG_CONTAINER="${PG_CONTAINER:-provider-platform-db}"

# Colors
Expand Down Expand Up @@ -77,6 +78,7 @@ stop_process "council-console" "$SCRIPT_DIR/.council-console.pid" "$COUNCIL_CONS
stop_process "moonlight-pay" "$SCRIPT_DIR/.moonlight-pay.pid" "$MOONLIGHT_PAY_PORT"
stop_process "network-dashboard" "$SCRIPT_DIR/.network-dashboard.pid" "$NETWORK_DASHBOARD_PORT"
stop_process "network-dashboard-platform" "$SCRIPT_DIR/.network-dashboard-platform.pid" "$NETWORK_DASHBOARD_PLATFORM_PORT"
stop_process "moonlight-ui-gallery" "$SCRIPT_DIR/.moonlight-ui.pid" "$MOONLIGHT_UI_PORT"

# --- Stop PostgreSQL container ---
if docker ps -a --format '{{.Names}}' | grep -q "^${PG_CONTAINER}$"; then
Expand Down Expand Up @@ -110,6 +112,7 @@ for f in \
"$SCRIPT_DIR/council-console.log" \
"$SCRIPT_DIR/moonlight-pay.log" \
"$SCRIPT_DIR/network-dashboard.log" \
"$SCRIPT_DIR/moonlight-ui.log" \
; do
if [ -f "$f" ]; then
rm "$f"
Expand Down
53 changes: 41 additions & 12 deletions infra-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ PAY_PLATFORM_PATH="${PAY_PLATFORM_PATH:-$BASE_DIR/pay-platform}"
MOONLIGHT_PAY_PATH="${MOONLIGHT_PAY_PATH:-$BASE_DIR/moonlight-pay}"
NETWORK_DASHBOARD_PATH="${NETWORK_DASHBOARD_PATH:-$BASE_DIR/network-dashboard}"
NETWORK_DASHBOARD_PLATFORM_PATH="${NETWORK_DASHBOARD_PLATFORM_PATH:-$BASE_DIR/network-dashboard-platform}"
MOONLIGHT_UI_PATH="${MOONLIGHT_UI_PATH:-$BASE_DIR/ui}"

# Ports — override via env to run multiple stacks in parallel
STELLAR_RPC_PORT="${STELLAR_RPC_PORT:-8000}" # shared
Expand All @@ -51,6 +52,7 @@ PAY_PLATFORM_PORT="${PAY_PLATFORM_PORT:-3025}"
MOONLIGHT_PAY_PORT="${MOONLIGHT_PAY_PORT:-3050}"
NETWORK_DASHBOARD_PORT="${NETWORK_DASHBOARD_PORT:-3040}"
NETWORK_DASHBOARD_PLATFORM_PORT="${NETWORK_DASHBOARD_PLATFORM_PORT:-3035}"
MOONLIGHT_UI_PORT="${MOONLIGHT_UI_PORT:-3060}"

# Container name — override to avoid collisions
PG_CONTAINER="${PG_CONTAINER:-provider-platform-db}"
Expand All @@ -68,7 +70,7 @@ error() { echo -e "${RED}[ERROR]${NC} $*"; exit 1; }
section() { echo -e "\n${BLUE}=== $* ===${NC}"; }

# ============================================================
section "1/12 Prerequisites"
section "1/13 Prerequisites"
# ============================================================

command -v docker >/dev/null 2>&1 || error "Docker not found."
Expand Down Expand Up @@ -103,9 +105,10 @@ info "Deno: $($DENO_BIN --version | head -1)"
[ -d "$PAY_PLATFORM_PATH" ] || error "pay-platform not found at $PAY_PLATFORM_PATH"
[ -d "$NETWORK_DASHBOARD_PATH" ] || error "network-dashboard not found at $NETWORK_DASHBOARD_PATH"
[ -d "$NETWORK_DASHBOARD_PLATFORM_PATH" ] || error "network-dashboard-platform not found at $NETWORK_DASHBOARD_PLATFORM_PATH"
[ -d "$MOONLIGHT_UI_PATH" ] || error "@moonlight/ui not found at $MOONLIGHT_UI_PATH"

# ============================================================
section "2/12 Jaeger (ports 4317/4318/16686)"
section "2/13 Jaeger (ports 4317/4318/16686)"
# ============================================================

JAEGER_CONTAINER="${JAEGER_CONTAINER:-jaeger}"
Expand Down Expand Up @@ -133,7 +136,7 @@ else
fi

# ============================================================
section "3/12 Stellar Network"
section "3/13 Stellar Network"
# ============================================================

# Start the shared Stellar network if not already running
Expand Down Expand Up @@ -181,7 +184,7 @@ done
sleep 2

# ============================================================
section "4/12 PostgreSQL (port $PG_PORT)"
section "4/13 PostgreSQL (port $PG_PORT)"
# ============================================================

if docker ps --format '{{.Names}}' | grep -q "^${PG_CONTAINER}$"; then
Expand Down Expand Up @@ -224,7 +227,7 @@ docker exec "$PG_CONTAINER" psql -U admin -d postgres -tc \
"CREATE DATABASE pay_platform_db" >/dev/null

# ============================================================
section "5/12 Provider Platform (port $PROVIDER_PORT)"
section "5/13 Provider Platform (port $PROVIDER_PORT)"
# ============================================================

cd "$PROVIDER_PLATFORM_PATH"
Expand Down Expand Up @@ -286,7 +289,7 @@ for i in $(seq 1 15); do
done

# ============================================================
section "6/12 Council Platform (port $COUNCIL_PLATFORM_PORT)"
section "6/13 Council Platform (port $COUNCIL_PLATFORM_PORT)"
# ============================================================

cd "$COUNCIL_PLATFORM_PATH"
Expand Down Expand Up @@ -338,7 +341,7 @@ for i in $(seq 1 15); do
done

# ============================================================
section "7/12 Pay Platform (port $PAY_PLATFORM_PORT)"
section "7/13 Pay Platform (port $PAY_PLATFORM_PORT)"
# ============================================================

cd "$PAY_PLATFORM_PATH"
Expand Down Expand Up @@ -404,7 +407,7 @@ for i in $(seq 1 15); do
done

# ============================================================
section "8/12 Network Dashboard Platform (port $NETWORK_DASHBOARD_PLATFORM_PORT)"
section "8/13 Network Dashboard Platform (port $NETWORK_DASHBOARD_PLATFORM_PORT)"
# ============================================================

cd "$NETWORK_DASHBOARD_PLATFORM_PATH"
Expand Down Expand Up @@ -454,7 +457,7 @@ for i in $(seq 1 15); do
done

# ============================================================
section "9/12 Provider Console (port $PROVIDER_CONSOLE_PORT)"
section "9/13 Provider Console (port $PROVIDER_CONSOLE_PORT)"
# ============================================================

cd "$PROVIDER_CONSOLE_PATH"
Expand Down Expand Up @@ -493,7 +496,7 @@ for i in $(seq 1 10); do
done

# ============================================================
section "10/12 Council Console (port $COUNCIL_CONSOLE_PORT)"
section "10/13 Council Console (port $COUNCIL_CONSOLE_PORT)"
# ============================================================

cd "$COUNCIL_CONSOLE_PATH"
Expand Down Expand Up @@ -535,7 +538,7 @@ for i in $(seq 1 10); do
done

# ============================================================
section "11/12 Moonlight Pay (port $MOONLIGHT_PAY_PORT)"
section "11/13 Moonlight Pay (port $MOONLIGHT_PAY_PORT)"
# ============================================================

cd "$MOONLIGHT_PAY_PATH"
Expand Down Expand Up @@ -576,7 +579,7 @@ for i in $(seq 1 10); do
done

# ============================================================
section "12/12 Network Dashboard (port $NETWORK_DASHBOARD_PORT)"
section "12/13 Network Dashboard (port $NETWORK_DASHBOARD_PORT)"
# ============================================================

cd "$NETWORK_DASHBOARD_PATH"
Expand Down Expand Up @@ -612,6 +615,31 @@ for i in $(seq 1 10); do
sleep 1
done

# ============================================================
section "13/13 @moonlight/ui Gallery (port $MOONLIGHT_UI_PORT)"
# ============================================================

cd "$MOONLIGHT_UI_PATH"

info "Starting @moonlight/ui gallery (background)..."
MOONLIGHT_UI_LOG="$SCRIPT_DIR/moonlight-ui.log"
PORT=$MOONLIGHT_UI_PORT \
nohup "$DENO_BIN" task gallery > "$MOONLIGHT_UI_LOG" 2>&1 &
MOONLIGHT_UI_PID=$!
echo "$MOONLIGHT_UI_PID" > "$SCRIPT_DIR/.moonlight-ui.pid"
info "@moonlight/ui Gallery running (PID $MOONLIGHT_UI_PID, log: $MOONLIGHT_UI_LOG)"

for i in $(seq 1 10); do
if curl -sf "http://localhost:${MOONLIGHT_UI_PORT}/" >/dev/null 2>&1; then
info "@moonlight/ui Gallery is ready."
break
fi
if [ "$i" -eq 10 ]; then
warn "@moonlight/ui Gallery may not be ready yet. Check $MOONLIGHT_UI_LOG"
fi
sleep 1
done

# ============================================================
echo ""
echo "========================================"
Expand All @@ -627,6 +655,7 @@ echo " Provider Console: http://localhost:$PROVIDER_CONSOLE_PORT (PID
echo " Council Console: http://localhost:$COUNCIL_CONSOLE_PORT (PID $COUNCIL_CONSOLE_PID)"
echo " Moonlight Pay: http://localhost:$MOONLIGHT_PAY_PORT (PID $MOONLIGHT_PAY_PID)"
echo " Network Dashboard: http://localhost:$NETWORK_DASHBOARD_PORT (PID $NETWORK_DASHBOARD_PID)"
echo " @moonlight/ui Gallery: http://localhost:$MOONLIGHT_UI_PORT (PID $MOONLIGHT_UI_PID)"
echo " PostgreSQL: localhost:$PG_PORT (container: $PG_CONTAINER)"
echo " Stellar RPC: http://localhost:$STELLAR_RPC_PORT (shared)"
echo " Jaeger UI: http://localhost:16686"
Expand Down
Loading