From 6ca1a1d6799474f8ca977b93ab630af7ace879c2 Mon Sep 17 00:00:00 2001 From: Victorio Nascimento <155357371+Vic-Nas@users.noreply.github.com> Date: Mon, 27 Jul 2026 16:45:28 -0400 Subject: Add Linux GUI installer via Wine (#3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add Linux GUI installer via Wine * Fix launcher creation and add BTF_RELAY env var support * Pool server, Linux GUI, unified binary, README update * Root Makefile: make linux / make windows, cleaner README * Remove headless.cpp * Fix XPM color count mismatch causing toolbar image errors on Linux * XPM icons: same code on Windows and Linux, no ifdefs around image loading * Fix GTK icon crash and Linux printf format * btfrv: 10s socket timeout on relay connects * Faster peer discovery: more dials per pass, shorter backoff and sleep * Parallel btf peer connections * Fix GetMyExternalIP - was disabled, now uses modern IP echo services * Fix tunnel disconnect on idle and restore external IP detection * Filter stale Nostr descriptors * Sort peers by freshness, fresh first * Pool: add .btf Stratum listener — miners connect via rendezvous, no port forwarding needed * btf pool: self-replacing listeners, one per relay, no queuing between miners * Mining modes: solo/operator/participant — pool server on-demand, participant Stratum client * Status bar: show external IP and .btf address * README: clean rewrite, concept-first, minimal * make linux produces AppImage * make linux produces AppImage * Pool dashboard: connect instructions, tabs, share bars * Perf fixes: GetMyExternalIP threaded, btf listener counted * Perf fixes: GetMyExternalIP threaded, btf listener counted * Fix pool payouts: defer until coinbase maturity * Pool: clean mode switching, IP warning * Pool: clean mode switching * Fix gPoolRunning: remove static * AppImage: use real icon from bitcoin.ico * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Windows build: use mingw32-make * Windows build: simpler make invocation * Add deps-windows target * Windows build fixes * Windows build fixes * Windows makefile: fix obj dir * Windows: output to repo root * Windows: bundle DLLs into zip * Replace wxWidgets with ImGui+GLFW: same build on Linux and Windows * Fix %I64d that slipped back through rebase (main.h, net.h) * MinGW: add _mkdir shim for non-MSVC Windows; fix %I64d * Fix gPoolRunning extern outside ifndef _WIN32 * Remove -lboost_system: boost is header-only in this codebase * Status bar: copy buttons for IP and .btf address * Windows: add app icon via windres, strip wx stuff from rc file * Clean GUI: single Options menu item, bigger font, better spacing, cleaner options dialog; update README * GUI: embed Roboto font at 16px for clear readability on all platforms * Windows: windres depends on obj dir target * Fix balance hidden off-screen: put on own line below address bar * Windows: inline mkdir in every rule, remove dir target that confused make * Windows: move all target to top so it's the default rule * Fix pool server not starting: always start when operator selected, re-sync dialog state on open * Write debug.log to data directory (AppData/Roaming/Bitflash on Windows) * Participant miner: use wallet address as username so payouts go to wallet * Add .gitattributes to lock LF line endings, prevent CRLF drift * Refactor pool mining to btf-only transport * Persist pool settings and startup wiring * Prune stale peers and expose pool queries * Fix build regressions and add CLI mode/arg parity * Fix rpc miner stats declaration order * Centralize pool runtime extern declarations * Separate operator/participant dashboards and restore peer stats * Add live telemetry strip and clearer per-mode runtime metrics * Reduce mining dashboard clutter and remove manual pool entry * Count only authorized pool miners * Seed initial pool job on startup * Use a real share target for pool work * Switch pool accounting to round-based shares * Fix nostr pool announcer stats call sites * Fix pool stats definition order * Improve pool worker status display * Add mutex include for participant status * Replace ImClamp in dashboard layout * Clarify participant work status * Log participant status transitions * Reduce peer discovery log noise * Add participant status badge * Track participant auth acknowledgements * Log and validate pool job delivery --------- Co-authored-by: Bitflash Pool Dev --- install-bitflash-wine.sh | 155 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 install-bitflash-wine.sh (limited to 'install-bitflash-wine.sh') diff --git a/install-bitflash-wine.sh b/install-bitflash-wine.sh new file mode 100644 index 0000000..3fa18a1 --- /dev/null +++ b/install-bitflash-wine.sh @@ -0,0 +1,155 @@ +#!/usr/bin/env bash +# Bitflash GUI installer for Linux (via Wine) + +INSTALL_DIR="$HOME/.btf-wine" +WINE_DATA="$HOME/.wine/drive_c/users/$USER/AppData/Roaming/Bitflash" +LINUX_DATA="$HOME/.bitflash" +BIN_DIR="$HOME/.local/bin" +REPO="Bitflash-sh/bitflash" + +echo "==> Bitflash GUI installer" +echo + +# ---- Wine +echo "==> Checking Wine..." +if ! command -v wine &>/dev/null; then + echo " Installing Wine..." + sudo apt-get update -qq && sudo apt-get install -y wine +fi +echo " Wine: $(wine --version)" + +# ---- db-util +echo "==> Checking db-util..." +if ! command -v db_dump &>/dev/null; then + echo " Installing db-util..." + sudo apt-get install -y db-util +fi +echo " db_dump: $(which db_dump)" + +# ---- Download +echo "==> Fetching latest release from GitHub..." +RELEASE_URL=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" \ + | grep "browser_download_url" \ + | grep -i "win\|windows\|gui" \ + | head -1 | cut -d '"' -f 4) + +if [ -z "$RELEASE_URL" ]; then + RELEASE_URL=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" \ + | grep "browser_download_url" | head -1 | cut -d '"' -f 4) +fi + +if [ -z "$RELEASE_URL" ]; then + echo "ERROR: No release found at https://github.com/$REPO/releases" + exit 1 +fi + +echo " URL: $RELEASE_URL" +TMPZIP=$(mktemp /tmp/bitflash-XXXXXX.zip) +echo " Downloading..." +curl -L -o "$TMPZIP" "$RELEASE_URL" +echo " Downloaded: $(du -h "$TMPZIP" | cut -f1)" + +# ---- Extract +echo "==> Extracting to $INSTALL_DIR..." +rm -rf "$INSTALL_DIR" +mkdir -p "$INSTALL_DIR" +echo " Running unzip -j..." +unzip -j "$TMPZIP" -d "$INSTALL_DIR" 2>&1 | grep -v "^warning" || true +echo " Files after extract: $(ls "$INSTALL_DIR" | wc -l)" + +# ---- Rename backslash files +echo "==> Renaming files..." +count=0 +for f in "$INSTALL_DIR"/*; do + [ -f "$f" ] || continue + base=$(basename "$f") + newname=$(echo "$base" | sed 's/.*\\//') + if [ "$newname" != "$base" ]; then + mv "$f" "$INSTALL_DIR/$newname" + count=$((count+1)) + fi +done +echo " Renamed $count files" +echo " Files now: $(ls "$INSTALL_DIR" | wc -l)" + +rm -f "$TMPZIP" + +# ---- Verify +if [ ! -f "$INSTALL_DIR/bitflash.exe" ]; then + echo "ERROR: bitflash.exe not found. Files present:" + ls "$INSTALL_DIR" + exit 1 +fi +echo " bitflash.exe found ✓" + +# ---- Init Wine data dir +echo "==> Initializing Wine Bitflash data directory..." +echo " Starting Wine to create data dir (may take a moment)..." +WINEDLLOVERRIDES="libdb_cxx-6.2=n" wine "$INSTALL_DIR/bitflash.exe" & +WINE_PID=$! +# Wait until wallet.dat is created, max 30 seconds +for i in $(seq 1 30); do + sleep 1 + if [ -f "$WINE_DATA/wallet.dat" ]; then + echo " wallet.dat created after ${i}s" + break + fi + echo " Waiting for Wine to initialize... ${i}s" +done +kill $WINE_PID 2>/dev/null || true +wait $WINE_PID 2>/dev/null || true +sleep 1 +mkdir -p "$WINE_DATA" +echo " Wine data dir ready" + +# ---- Wallet +echo +if [ -f "$LINUX_DATA/wallet.dat" ]; then + echo "==> Found existing Linux wallet at $LINUX_DATA/wallet.dat" + read -p " Import it into the GUI wallet? [Y/n] " ans + ans=${ans:-Y} + if [[ "$ans" =~ ^[Yy] ]]; then + echo " Dumping Linux wallet..." + DUMP=$(mktemp) + CONVERTED=$(mktemp) + rm "$CONVERTED" # db_load needs a non-existing file + db_dump -p "$LINUX_DATA/wallet.dat" > "$DUMP" + echo " Converting format..." + db_load -f "$DUMP" "$CONVERTED" + echo " Installing converted wallet..." + cp "$CONVERTED" "$WINE_DATA/wallet.dat" + rm "$DUMP" "$CONVERTED" + echo " Wallet imported ✓" + else + echo " Skipping. Re-run script to import later." + fi +else + echo "==> No Linux wallet found, starting fresh." +fi + +# ---- Launcher +echo "==> Creating bitflash command..." +mkdir -p "$BIN_DIR" +LAUNCHER_FILE="$BIN_DIR/bitflash" +printf '#!/usr/bin/env bash\n' > "$LAUNCHER_FILE" +printf 'RELAY="${BTF_RELAY:-}"\n' >> "$LAUNCHER_FILE" +printf 'ANNOUNCE=""\n' >> "$LAUNCHER_FILE" +printf '[ -n "$RELAY" ] && ANNOUNCE="-announcerelay=$RELAY"\n' >> "$LAUNCHER_FILE" +printf 'WINEDLLOVERRIDES="libdb_cxx-6.2=n" wine "%s/bitflash.exe" $ANNOUNCE "$@"\n' "$INSTALL_DIR" >> "$LAUNCHER_FILE" +chmod +x "$LAUNCHER_FILE" +echo " Launcher created: $(cat "$LAUNCHER_FILE" | wc -l) lines" + +if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then + echo "==> Adding ~/.local/bin to PATH..." + echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc" +fi +export PATH="$HOME/.local/bin:$PATH" + +echo +echo "==================================================================" +echo " DONE." +echo " Launch: bitflash" +echo " Mine: bitflash -gen" +echo " Relay: bitflash -announcerelay=YOUR_HOST:8434" +echo " Data: $WINE_DATA" +echo "==================================================================" -- cgit v1.2.3