Files
dex/run.sh
T
zeekay 868ea87be0 Add run script and quickstart guide for easy local testing
- 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
2025-08-25 14:15:46 -05:00

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