mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
11d201da989f05ad87b3e4a0fb284df80f2292bd
- Add tenant config system (lib/tenant.ts) — hostname → branding + MPC mode - Tenants: bridge.lux.network, bridge.pars.network, bridge.hanzo.ai, bridge.zoo.ngo - Middleware passes x-tenant-hostname header for SSR + API routes - /api/tenant endpoint resolves tenant config by hostname - TenantProvider React context applies CSS vars (--brand-primary, --brand-accent) - Layout reads tenant config server-side, injects CSS vars + favicon + metadata - Header supports logoSrc prop for custom logo override per tenant - next.config.js allows remote logo images from all tenant domains - k8s ingress: added rules for bridge.pars.network, bridge.hanzo.ai, bridge.zoo.ngo - MPC backend pluggable: lux-mpc (3-node cluster) or t-chain (ThresholdVM) - Self-hosted deployments supported via BRIDGE_TENANT_CONFIG env var Anyone can point a domain at the bridge + add config → instant white-label bridge. All tenants share the same lux-mpc backend (no per-network SPOF).
Lux Bridge
Bridge monorepo for Lux Network - a decentralized cross-chain bridge using Multi-Party Computation (MPC) for secure asset transfers.
Prerequisites
- Node.js v20+
- pnpm v9.15.0+
- Go 1.22+ (for MPC tools)
- Docker (for infrastructure services)
Quick Start
1. Install Dependencies
# Install pnpm if needed
npm install -g pnpm
# Install project dependencies
pnpm install
# Install MPC tools via Go
make install-mpc
2. Start Infrastructure
# Start infrastructure services (Lux ID, KMS, databases, etc.)
make up
This starts:
- Lux ID (Casdoor) - Port 8000 - Unified authentication
- KMS (Vault) - Port 8200 - Key management
- NATS - Port 4223 - Messaging
- Consul - Port 8501 - Service discovery
- PostgreSQL - Port 5433 - Bridge database
- Lux ID DB - Port 5434 - Auth database
3. Start MPC Network
# Start 3-node MPC network
make start-mpc-nodes
This runs MPC nodes on:
- Node 0: HTTP 6000, gRPC 9090
- Node 1: HTTP 6001, gRPC 9091
- Node 2: HTTP 6002, gRPC 9092
4. Start Application Services
In separate terminals:
# Terminal 1: Bridge API Server
cd app/server && pnpm dev
# Terminal 2: Bridge UI
cd app/bridge && pnpm dev
5. Access Services
- Bridge UI: http://localhost:3000
- Bridge API: http://localhost:5000
- Lux ID Admin: http://localhost:8000
- Consul UI: http://localhost:8501
Architecture
Bridge UI → Bridge Server → MPC Nodes → Blockchain Networks
↓
KMS + Lux ID + Consul
Key Features
- MPC Security: 2-of-3 threshold signatures
- Multi-Chain: Support for EVM and non-EVM chains
- Unified Auth: Lux ID (Casdoor) integration
- Key Management: Secure key storage in KMS
- Service Discovery: Consul for dynamic configuration
Development
# Run tests
pnpm test
# Check MPC status
lux-mpc-cli status --url http://localhost:6000
# View logs
tail -f logs/mpc-node-0.log
# Stop services
make stop-mpc-nodes # Stop MPC
make down # Stop infrastructure
Documentation
Tips
Since "pnpm" is a finger twister, many people alias it to "pn". For example, with bash, put alias pn='pnpm' in .bashrc.
Description
▼ Bridge, powered by trustless MPC network and privacy focused Teleport protocol.
260 MiB
Languages
TypeScript
52.2%
Go
40.9%
Solidity
2.8%
JavaScript
1.8%
Shell
1.4%
Other
0.8%