upleb.uk

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

summaryrefslogtreecommitdiff
path: root/install-bitflash-wine.sh
diff options
context:
space:
mode:
authorVictorio Nascimento <155357371+Vic-Nas@users.noreply.github.com>2026-07-27 16:45:28 -0400
committerGitHub <noreply@github.com>2026-07-27 17:45:28 -0300
commit6ca1a1d6799474f8ca977b93ab630af7ace879c2 (patch)
treea0312ebc10fc6a56742d0e5caa85c31eb6d3eaa7 /install-bitflash-wine.sh
parent56df9830d5a002ff9ce3fac47e497673f8159e39 (diff)
Add Linux GUI installer via Wine (#3)
* 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 <pool@bitflash>
Diffstat (limited to 'install-bitflash-wine.sh')
-rw-r--r--install-bitflash-wine.sh155
1 files changed, 155 insertions, 0 deletions
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 @@
1#!/usr/bin/env bash
2# Bitflash GUI installer for Linux (via Wine)
3
4INSTALL_DIR="$HOME/.btf-wine"
5WINE_DATA="$HOME/.wine/drive_c/users/$USER/AppData/Roaming/Bitflash"
6LINUX_DATA="$HOME/.bitflash"
7BIN_DIR="$HOME/.local/bin"
8REPO="Bitflash-sh/bitflash"
9
10echo "==> Bitflash GUI installer"
11echo
12
13# ---- Wine
14echo "==> Checking Wine..."
15if ! command -v wine &>/dev/null; then
16 echo " Installing Wine..."
17 sudo apt-get update -qq && sudo apt-get install -y wine
18fi
19echo " Wine: $(wine --version)"
20
21# ---- db-util
22echo "==> Checking db-util..."
23if ! command -v db_dump &>/dev/null; then
24 echo " Installing db-util..."
25 sudo apt-get install -y db-util
26fi
27echo " db_dump: $(which db_dump)"
28
29# ---- Download
30echo "==> Fetching latest release from GitHub..."
31RELEASE_URL=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" \
32 | grep "browser_download_url" \
33 | grep -i "win\|windows\|gui" \
34 | head -1 | cut -d '"' -f 4)
35
36if [ -z "$RELEASE_URL" ]; then
37 RELEASE_URL=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" \
38 | grep "browser_download_url" | head -1 | cut -d '"' -f 4)
39fi
40
41if [ -z "$RELEASE_URL" ]; then
42 echo "ERROR: No release found at https://github.com/$REPO/releases"
43 exit 1
44fi
45
46echo " URL: $RELEASE_URL"
47TMPZIP=$(mktemp /tmp/bitflash-XXXXXX.zip)
48echo " Downloading..."
49curl -L -o "$TMPZIP" "$RELEASE_URL"
50echo " Downloaded: $(du -h "$TMPZIP" | cut -f1)"
51
52# ---- Extract
53echo "==> Extracting to $INSTALL_DIR..."
54rm -rf "$INSTALL_DIR"
55mkdir -p "$INSTALL_DIR"
56echo " Running unzip -j..."
57unzip -j "$TMPZIP" -d "$INSTALL_DIR" 2>&1 | grep -v "^warning" || true
58echo " Files after extract: $(ls "$INSTALL_DIR" | wc -l)"
59
60# ---- Rename backslash files
61echo "==> Renaming files..."
62count=0
63for f in "$INSTALL_DIR"/*; do
64 [ -f "$f" ] || continue
65 base=$(basename "$f")
66 newname=$(echo "$base" | sed 's/.*\\//')
67 if [ "$newname" != "$base" ]; then
68 mv "$f" "$INSTALL_DIR/$newname"
69 count=$((count+1))
70 fi
71done
72echo " Renamed $count files"
73echo " Files now: $(ls "$INSTALL_DIR" | wc -l)"
74
75rm -f "$TMPZIP"
76
77# ---- Verify
78if [ ! -f "$INSTALL_DIR/bitflash.exe" ]; then
79 echo "ERROR: bitflash.exe not found. Files present:"
80 ls "$INSTALL_DIR"
81 exit 1
82fi
83echo " bitflash.exe found ✓"
84
85# ---- Init Wine data dir
86echo "==> Initializing Wine Bitflash data directory..."
87echo " Starting Wine to create data dir (may take a moment)..."
88WINEDLLOVERRIDES="libdb_cxx-6.2=n" wine "$INSTALL_DIR/bitflash.exe" &
89WINE_PID=$!
90# Wait until wallet.dat is created, max 30 seconds
91for i in $(seq 1 30); do
92 sleep 1
93 if [ -f "$WINE_DATA/wallet.dat" ]; then
94 echo " wallet.dat created after ${i}s"
95 break
96 fi
97 echo " Waiting for Wine to initialize... ${i}s"
98done
99kill $WINE_PID 2>/dev/null || true
100wait $WINE_PID 2>/dev/null || true
101sleep 1
102mkdir -p "$WINE_DATA"
103echo " Wine data dir ready"
104
105# ---- Wallet
106echo
107if [ -f "$LINUX_DATA/wallet.dat" ]; then
108 echo "==> Found existing Linux wallet at $LINUX_DATA/wallet.dat"
109 read -p " Import it into the GUI wallet? [Y/n] " ans
110 ans=${ans:-Y}
111 if [[ "$ans" =~ ^[Yy] ]]; then
112 echo " Dumping Linux wallet..."
113 DUMP=$(mktemp)
114 CONVERTED=$(mktemp)
115 rm "$CONVERTED" # db_load needs a non-existing file
116 db_dump -p "$LINUX_DATA/wallet.dat" > "$DUMP"
117 echo " Converting format..."
118 db_load -f "$DUMP" "$CONVERTED"
119 echo " Installing converted wallet..."
120 cp "$CONVERTED" "$WINE_DATA/wallet.dat"
121 rm "$DUMP" "$CONVERTED"
122 echo " Wallet imported ✓"
123 else
124 echo " Skipping. Re-run script to import later."
125 fi
126else
127 echo "==> No Linux wallet found, starting fresh."
128fi
129
130# ---- Launcher
131echo "==> Creating bitflash command..."
132mkdir -p "$BIN_DIR"
133LAUNCHER_FILE="$BIN_DIR/bitflash"
134printf '#!/usr/bin/env bash\n' > "$LAUNCHER_FILE"
135printf 'RELAY="${BTF_RELAY:-}"\n' >> "$LAUNCHER_FILE"
136printf 'ANNOUNCE=""\n' >> "$LAUNCHER_FILE"
137printf '[ -n "$RELAY" ] && ANNOUNCE="-announcerelay=$RELAY"\n' >> "$LAUNCHER_FILE"
138printf 'WINEDLLOVERRIDES="libdb_cxx-6.2=n" wine "%s/bitflash.exe" $ANNOUNCE "$@"\n' "$INSTALL_DIR" >> "$LAUNCHER_FILE"
139chmod +x "$LAUNCHER_FILE"
140echo " Launcher created: $(cat "$LAUNCHER_FILE" | wc -l) lines"
141
142if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
143 echo "==> Adding ~/.local/bin to PATH..."
144 echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc"
145fi
146export PATH="$HOME/.local/bin:$PATH"
147
148echo
149echo "=================================================================="
150echo " DONE."
151echo " Launch: bitflash"
152echo " Mine: bitflash -gen"
153echo " Relay: bitflash -announcerelay=YOUR_HOST:8434"
154echo " Data: $WINE_DATA"
155echo "=================================================================="