mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
- Create run.sh script for easy command execution - Add QUICKSTART.md with clear instructions - All components now working locally with CGO_ENABLED=0 - Tests passing, demos running, ready for development
63 lines
1.4 KiB
Bash
Executable File
63 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# LX DEX - Run Script
|
|
# This script builds and runs various components of the LX DEX
|
|
|
|
set -e
|
|
|
|
# Ensure CGO is disabled for compatibility
|
|
export CGO_ENABLED=0
|
|
|
|
case "$1" in
|
|
"demo")
|
|
echo "๐ Running LX DEX Demo..."
|
|
go run ./cmd/demo
|
|
;;
|
|
|
|
"server")
|
|
echo "๐ Starting DEX Server..."
|
|
echo "Usage: $0 server [port]"
|
|
PORT=${2:-8080}
|
|
go run ./cmd/dex-server -port $PORT
|
|
;;
|
|
|
|
"memory")
|
|
echo "๐ Running Memory Analysis..."
|
|
go run ./cmd/memory-analysis
|
|
;;
|
|
|
|
"test")
|
|
echo "๐งช Running Tests..."
|
|
go test ./pkg/... -short -timeout 30s
|
|
;;
|
|
|
|
"build")
|
|
echo "๐จ Building all packages..."
|
|
go build ./pkg/...
|
|
echo "โ
Build successful!"
|
|
;;
|
|
|
|
"benchmark")
|
|
echo "โก Running Benchmarks..."
|
|
go test ./pkg/lx -bench=. -run=^$ -benchtime=10s
|
|
;;
|
|
|
|
*)
|
|
echo "LX DEX - Ultra High-Performance Order Book"
|
|
echo ""
|
|
echo "Usage: ./run.sh [command]"
|
|
echo ""
|
|
echo "Commands:"
|
|
echo " demo - Run interactive order book demo"
|
|
echo " server - Start DEX server (default port: 8080)"
|
|
echo " memory - Analyze memory usage for 1M markets"
|
|
echo " test - Run all tests"
|
|
echo " build - Build all packages"
|
|
echo " benchmark - Run performance benchmarks"
|
|
echo ""
|
|
echo "Examples:"
|
|
echo " ./run.sh demo"
|
|
echo " ./run.sh server 9090"
|
|
echo " ./run.sh test"
|
|
;;
|
|
esac |