mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
bridge-ui ships as a prebuilt Vite SPA inside ghcr.io/hanzoai/spa
(see app/bridge/Dockerfile final stage), not a Next.js dev container.
The compose + k8s manifests were still describing the old Next shape:
containerPort 3000, `npm run dev`, /app/.next volume mount, and
NEXT_PUBLIC_* env vars. None of that exists in the image anymore.
- compose.testnet.yml / compose.mainnet.yml: port 3001:80 (was 3001:3000);
drop command + .next mount; swap NEXT_PUBLIC_* for VITE_BRIDGE_* env
(the names app/bridge/src/bridge.config.ts reads).
- k8s/mpc-deployment.yaml: containerPort 80 (was 3000); Service
targetPort 80 (was 3000 — broken since the static-SPA cutover); swap
NEXT_PUBLIC_* for VITE_BRIDGE_* on the Deployment env.
- compose.yml: keep local hot-reload UX by mounting the repo root and
running `pnpm -C app/bridge dev --host 0.0.0.0 --port 3001` against
node:22-alpine. Dev port moves 3000 -> 3001 to match the published
SPA convention across envs.
- scripts/start-local.sh: update printed UI URL to :3001.
compose.infra.yml and compose.local.yml don't define bridge-ui — left
untouched. scripts/launch-mpc-bridge.sh already prints :3001 and has no
Next-specific config; check-ci-status.sh only references bridge-ui as a
GHCR package name (image preserved per spec). Both verified clean.
Validated:
- docker compose -f compose.{yml,testnet,mainnet,infra,local}.yml config -q
- kubectl --dry-run=client apply -f k8s/mpc-deployment.yaml
59 lines
1.8 KiB
Bash
Executable File
59 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Colors for output
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
echo -e "${GREEN}Starting Lux Bridge Local Environment...${NC}"
|
|
|
|
# Check if Docker is running
|
|
if ! docker info > /dev/null 2>&1; then
|
|
echo -e "${RED}Docker is not running. Please start Docker first.${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
# Clean up any existing containers
|
|
echo -e "${YELLOW}Cleaning up existing containers...${NC}"
|
|
docker-compose -f docker-compose.local.yaml down -v
|
|
|
|
# Build MPC service
|
|
echo -e "${YELLOW}Building MPC service...${NC}"
|
|
cd mpc-service && go mod tidy && cd ..
|
|
|
|
# Start infrastructure services first
|
|
echo -e "${YELLOW}Starting infrastructure services...${NC}"
|
|
docker-compose -f docker-compose.local.yaml up -d nats consul postgres
|
|
|
|
# Wait for services to be healthy
|
|
echo -e "${YELLOW}Waiting for infrastructure services to be ready...${NC}"
|
|
sleep 10
|
|
|
|
# Start MPC nodes
|
|
echo -e "${YELLOW}Starting MPC nodes...${NC}"
|
|
docker-compose -f docker-compose.local.yaml up -d mpc-node-0 mpc-node-1 mpc-node-2
|
|
|
|
# Wait for MPC nodes to be ready
|
|
echo -e "${YELLOW}Waiting for MPC nodes to initialize...${NC}"
|
|
sleep 5
|
|
|
|
# Start bridge server and UI
|
|
echo -e "${YELLOW}Starting bridge server and UI...${NC}"
|
|
docker-compose -f docker-compose.local.yaml up -d bridge-server bridge-ui
|
|
|
|
# Show status
|
|
echo -e "${GREEN}Bridge environment is starting up!${NC}"
|
|
echo -e "${YELLOW}Services:${NC}"
|
|
echo " - NATS: http://localhost:8223"
|
|
echo " - Consul: http://localhost:8501"
|
|
echo " - Bridge UI: http://localhost:3001"
|
|
echo " - Bridge API: http://localhost:5000"
|
|
echo " - MPC Nodes: http://localhost:6000, :6001, :6002"
|
|
echo " - PostgreSQL: localhost:5433"
|
|
echo ""
|
|
echo -e "${YELLOW}Logs:${NC}"
|
|
echo " docker-compose -f docker-compose.local.yaml logs -f"
|
|
echo ""
|
|
echo -e "${YELLOW}Stop:${NC}"
|
|
echo " docker-compose -f docker-compose.local.yaml down" |