#!/bin/sh
# OBEX miner installer · https://obex.live
# Usage: curl -fsSL https://obex.live/install.sh | sh
set -e
case "$(uname -s)-$(uname -m)" in
  Linux-x86_64)
    echo "OBEX · downloading obex-miner (linux x64, static, ~1.5 MB)..."
    curl -fsSL https://obex.live/downloads/obex-miner-linux-x64 -o obex-miner
    chmod +x obex-miner
    echo ""
    echo "Installed to ./obex-miner"
    echo ""
    echo "Next:"
    echo "  ./obex-miner keygen"
    echo "  ./obex-miner mine --epoch 1 --mem 256MiB --challenges 16"
    echo "  base64 -w0 obex-proof.bin   # paste at obex.live/dashboard"
    ;;
  *)
    echo "No prebuilt binary for $(uname -s) $(uname -m) yet."
    echo "Build from source (needs Rust: https://rustup.rs):"
    echo "  curl -fsSL https://obex.live/downloads/obex-protocol-src.zip -o obex-protocol.zip"
    echo "  unzip obex-protocol.zip && cd obex-protocol"
    echo "  cargo build --release -p obex-miner"
    echo "  ./target/release/obex-miner keygen"
    ;;
esac
