This directory contains scripts for building and running ORLY relay binaries across multiple platforms.
build-all-platforms.shComprehensive build script that creates binaries for all supported platforms:
Usage:
./scripts/build-all-platforms.sh
Output: All binaries are placed in build/ directory with platform-specific names.
platform-detect.shHelper script for platform detection and binary/library name resolution.
Usage:
# Detect current platform
./scripts/platform-detect.sh detect
# Output: linux-amd64
# Get binary name for version
./scripts/platform-detect.sh binary v0.25.0
# Output: orly-v0.25.0-linux-amd64
# Get library name
./scripts/platform-detect.sh library
# Output: libsecp256k1-linux-amd64.so
run-orly.shUniversal launcher that automatically selects and runs the correct binary for your platform.
Usage:
./scripts/run-orly.sh [arguments for orly]
Features:
# Install cross-compilation tools
sudo apt-get update
sudo apt-get install -y \
gcc-mingw-w64-x86-64 \
gcc-aarch64-linux-gnu \
autoconf automake libtool
Download and install Android NDK, then:
export ANDROID_NDK_HOME=/path/to/android-ndk
`bash
./scripts/build-all-platforms.sh
`
`bash
./scripts/run-orly.sh
`
`bash
# Linux
export LDLIBRARYPATH=./build:$LDLIBRARYPATH
./build/orly-v0.25.0-linux-amd64
# macOS ./build/orly-v0.25.0-darwin-arm64
# Windows
set PATH=.\build;%PATH%
.\build\orly-v0.25.0-windows-amd64.exe
`
| Platform | Architecture | CGO | Library Required | Status |
|---|---|---|---|---|
| Linux | AMD64 | ✓ | libsecp256k1.so | Full Support |
| Linux | ARM64 | ✓ | libsecp256k1.so | Full Support |
| macOS | AMD64 | ✗ | - | Full Support |
| macOS | ARM64 | ✗ | - | Full Support |
| Windows | AMD64 | ✓ | libsecp256k1.dll | Full Support |
| Android | ARM64 | ✓ | libsecp256k1.so | Experimental |
| Android | AMD64 | ✓ | libsecp256k1.so | Experimental |
Note: macOS builds use pure Go (no CGO) for easier distribution. Crypto operations are slower but no library dependency is required.
All deployment and test scripts have been updated to support platform detection:
scripts/deploy.sh - Builds with CGO and copies librariesscripts/test.sh - Sets library paths for testsscripts/benchmark.sh - Uses platform-specific binariesscripts/runtests.sh - Sets library paths for benchmark testsGitHub Actions workflow (.github/workflows/go.yml) automatically:
Binaries:
orly-{version}-{os}-{arch}[.ext]orly-v0.25.0-linux-amd64Libraries:
libsecp256k1-{os}-{arch}.{ext}libsecp256k1-linux-amd64.soWhen distributing binaries, include:
Example release structure:
release/
├── orly-v0.25.0-linux-amd64
├── orly-v0.25.0-linux-arm64
├── orly-v0.25.0-darwin-amd64
├── orly-v0.25.0-darwin-arm64
├── orly-v0.25.0-windows-amd64.exe
├── libsecp256k1-linux-amd64.so
├── libsecp256k1-linux-arm64.so
├── libsecp256k1-windows-amd64.dll
└── SHA256SUMS-v0.25.0.txt
Binary not found:
Run ./scripts/build-all-platforms.sh to build binaries.
Library not found at runtime: Set the library path:
# Linux
export LD_LIBRARY_PATH=./build:$LD_LIBRARY_PATH
# macOS
export DYLD_LIBRARY_PATH=./build:$DYLD_LIBRARY_PATH
# Windows
set PATH=.\build;%PATH%
Cross-compilation fails: Install the required cross-compiler (see Build Prerequisites above).
| Build Type | Crypto Speed | Binary Size | Distribution |
|---|---|---|---|
| CGO (Linux) | Fast (2-3x) | Smaller | Needs .so |
| Pure Go (Mac) | Slower | Larger | Self-contained |
For detailed documentation, see docs/BUILD_PLATFORMS.md.