Building from Source¶
Instructions for building Orb from source code.
Prerequisites¶
- Go 1.21 or higher
- Git
- Make (optional)
Clone Repository¶
Build Methods¶
Method 1: Using Make¶
Method 2: Using Go¶
# Build
go build -o orb
# Build with optimizations
go build -ldflags="-s -w" -o orb
# Install to $GOPATH/bin
go install
Method 3: Using Build Script¶
Cross-Compilation¶
Linux¶
GOOS=linux GOARCH=amd64 go build -o orb-linux-amd64
GOOS=linux GOARCH=arm64 go build -o orb-linux-arm64
macOS¶
GOOS=darwin GOARCH=amd64 go build -o orb-darwin-amd64
GOOS=darwin GOARCH=arm64 go build -o orb-darwin-arm64
Windows¶
Running Tests¶
# All tests
go test ./...
# With coverage
go test -cover ./...
# Verbose
go test -v ./...
# Specific package
go test ./internal/crypto
# Run benchmarks
go test -bench=. ./...
Development Workflow¶
# Install dependencies
go mod download
# Format code
go fmt ./...
# Vet code
go vet ./...
# Run linters
golangci-lint run
# Build and run
go run main.go relay