upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/build-linux.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build-linux.sh')
-rw-r--r--build-linux.sh72
1 files changed, 0 insertions, 72 deletions
diff --git a/build-linux.sh b/build-linux.sh
deleted file mode 100644
index 4c3844d..0000000
--- a/build-linux.sh
+++ /dev/null
@@ -1,72 +0,0 @@
1#!/usr/bin/env bash
2# Bitflash headless node/miner -- one-shot Linux build (Debian/Ubuntu).
3# Builds the dependencies (libsecp256k1 with schnorrsig, RandomX) and then the
4# node itself. Run from the project root (the directory that contains src/):
5#
6# bash build-linux.sh
7#
8# Result: src/bitflash-node . Run it with: ./src/bitflash-node -gen
9
10set -e
11ROOT="$(cd "$(dirname "$0")" && pwd)"
12cd "$ROOT"
13
14# Use sudo only when not already root (a root login often has no sudo installed).
15SUDO=""
16if [ "$(id -u)" -ne 0 ]; then SUDO="sudo"; fi
17
18echo "==> installing system packages"
19if command -v apt-get >/dev/null 2>&1; then
20 $SUDO apt-get update
21 $SUDO apt-get install -y build-essential cmake git pkg-config autoconf libtool \
22 libssl-dev libdb5.3++-dev libsodium-dev nlohmann-json3-dev libboost-dev \
23 libboost-system-dev libwxgtk3.2-dev
24else
25 echo "!! non-apt system: install manually -> g++ cmake git autoconf libtool"
26 echo " libssl-dev libdb++-dev libsodium-dev nlohmann-json (headers)"
27fi
28
29# ---- libsecp256k1 (Schnorr/BIP340 + extrakeys), static, installed to /usr/local
30if [ ! -f /usr/local/lib/libsecp256k1.a ]; then
31 echo "==> building libsecp256k1"
32 rm -rf "$ROOT/secp256k1-build"
33 git clone --depth 1 https://github.com/bitcoin-core/secp256k1 "$ROOT/secp256k1-build"
34 cd "$ROOT/secp256k1-build"
35 ./autogen.sh
36 ./configure --enable-module-schnorrsig --enable-module-extrakeys \
37 --disable-shared --with-pic --disable-benchmark --disable-tests
38 make -j"$(nproc)"
39 $SUDO make install
40 $SUDO ldconfig
41 cd "$ROOT"
42else
43 echo "==> libsecp256k1 already installed, skipping"
44fi
45
46# ---- RandomX (memory-hard CPU PoW), static lib
47if [ ! -f "$HOME/RandomX/build/librandomx.a" ]; then
48 echo "==> building RandomX"
49 rm -rf "$HOME/RandomX"
50 git clone --depth 1 https://github.com/tevador/RandomX "$HOME/RandomX"
51 mkdir -p "$HOME/RandomX/build"
52 cd "$HOME/RandomX/build"
53 cmake .. -DCMAKE_BUILD_TYPE=Release
54 make -j"$(nproc)" randomx
55 cd "$ROOT"
56else
57 echo "==> RandomX already built, skipping"
58fi
59
60# ---- build
61echo "==> building bitflash"
62cd "$ROOT/src"
63make -f makefile.linux RANDOMX_DIR="$HOME/RandomX" -j"$(nproc)"
64
65echo
66echo "==================================================================="
67echo " DONE. $ROOT/src/bitflash"
68echo
69echo " GUI: ./src/bitflash"
70echo " Daemon mode: ./src/bitflash /nogui /gen"
71echo " Pool server starts automatically on Stratum :3333, stats :19012"
72echo "==================================================================="