diff options
| author | Victorio Nascimento <155357371+Vic-Nas@users.noreply.github.com> | 2026-07-27 16:45:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-27 17:45:28 -0300 |
| commit | 6ca1a1d6799474f8ca977b93ab630af7ace879c2 (patch) | |
| tree | a0312ebc10fc6a56742d0e5caa85c31eb6d3eaa7 /install-bitflash-wine.sh | |
| parent | 56df9830d5a002ff9ce3fac47e497673f8159e39 (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.sh | 155 |
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 | |||
| 4 | INSTALL_DIR="$HOME/.btf-wine" | ||
| 5 | WINE_DATA="$HOME/.wine/drive_c/users/$USER/AppData/Roaming/Bitflash" | ||
| 6 | LINUX_DATA="$HOME/.bitflash" | ||
| 7 | BIN_DIR="$HOME/.local/bin" | ||
| 8 | REPO="Bitflash-sh/bitflash" | ||
| 9 | |||
| 10 | echo "==> Bitflash GUI installer" | ||
| 11 | echo | ||
| 12 | |||
| 13 | # ---- Wine | ||
| 14 | echo "==> Checking Wine..." | ||
| 15 | if ! command -v wine &>/dev/null; then | ||
| 16 | echo " Installing Wine..." | ||
| 17 | sudo apt-get update -qq && sudo apt-get install -y wine | ||
| 18 | fi | ||
| 19 | echo " Wine: $(wine --version)" | ||
| 20 | |||
| 21 | # ---- db-util | ||
| 22 | echo "==> Checking db-util..." | ||
| 23 | if ! command -v db_dump &>/dev/null; then | ||
| 24 | echo " Installing db-util..." | ||
| 25 | sudo apt-get install -y db-util | ||
| 26 | fi | ||
| 27 | echo " db_dump: $(which db_dump)" | ||
| 28 | |||
| 29 | # ---- Download | ||
| 30 | echo "==> Fetching latest release from GitHub..." | ||
| 31 | RELEASE_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 | |||
| 36 | if [ -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) | ||
| 39 | fi | ||
| 40 | |||
| 41 | if [ -z "$RELEASE_URL" ]; then | ||
| 42 | echo "ERROR: No release found at https://github.com/$REPO/releases" | ||
| 43 | exit 1 | ||
| 44 | fi | ||
| 45 | |||
| 46 | echo " URL: $RELEASE_URL" | ||
| 47 | TMPZIP=$(mktemp /tmp/bitflash-XXXXXX.zip) | ||
| 48 | echo " Downloading..." | ||
| 49 | curl -L -o "$TMPZIP" "$RELEASE_URL" | ||
| 50 | echo " Downloaded: $(du -h "$TMPZIP" | cut -f1)" | ||
| 51 | |||
| 52 | # ---- Extract | ||
| 53 | echo "==> Extracting to $INSTALL_DIR..." | ||
| 54 | rm -rf "$INSTALL_DIR" | ||
| 55 | mkdir -p "$INSTALL_DIR" | ||
| 56 | echo " Running unzip -j..." | ||
| 57 | unzip -j "$TMPZIP" -d "$INSTALL_DIR" 2>&1 | grep -v "^warning" || true | ||
| 58 | echo " Files after extract: $(ls "$INSTALL_DIR" | wc -l)" | ||
| 59 | |||
| 60 | # ---- Rename backslash files | ||
| 61 | echo "==> Renaming files..." | ||
| 62 | count=0 | ||
| 63 | for 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 | ||
| 71 | done | ||
| 72 | echo " Renamed $count files" | ||
| 73 | echo " Files now: $(ls "$INSTALL_DIR" | wc -l)" | ||
| 74 | |||
| 75 | rm -f "$TMPZIP" | ||
| 76 | |||
| 77 | # ---- Verify | ||
| 78 | if [ ! -f "$INSTALL_DIR/bitflash.exe" ]; then | ||
| 79 | echo "ERROR: bitflash.exe not found. Files present:" | ||
| 80 | ls "$INSTALL_DIR" | ||
| 81 | exit 1 | ||
| 82 | fi | ||
| 83 | echo " bitflash.exe found ✓" | ||
| 84 | |||
| 85 | # ---- Init Wine data dir | ||
| 86 | echo "==> Initializing Wine Bitflash data directory..." | ||
| 87 | echo " Starting Wine to create data dir (may take a moment)..." | ||
| 88 | WINEDLLOVERRIDES="libdb_cxx-6.2=n" wine "$INSTALL_DIR/bitflash.exe" & | ||
| 89 | WINE_PID=$! | ||
| 90 | # Wait until wallet.dat is created, max 30 seconds | ||
| 91 | for 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" | ||
| 98 | done | ||
| 99 | kill $WINE_PID 2>/dev/null || true | ||
| 100 | wait $WINE_PID 2>/dev/null || true | ||
| 101 | sleep 1 | ||
| 102 | mkdir -p "$WINE_DATA" | ||
| 103 | echo " Wine data dir ready" | ||
| 104 | |||
| 105 | # ---- Wallet | ||
| 106 | echo | ||
| 107 | if [ -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 | ||
| 126 | else | ||
| 127 | echo "==> No Linux wallet found, starting fresh." | ||
| 128 | fi | ||
| 129 | |||
| 130 | # ---- Launcher | ||
| 131 | echo "==> Creating bitflash command..." | ||
| 132 | mkdir -p "$BIN_DIR" | ||
| 133 | LAUNCHER_FILE="$BIN_DIR/bitflash" | ||
| 134 | printf '#!/usr/bin/env bash\n' > "$LAUNCHER_FILE" | ||
| 135 | printf 'RELAY="${BTF_RELAY:-}"\n' >> "$LAUNCHER_FILE" | ||
| 136 | printf 'ANNOUNCE=""\n' >> "$LAUNCHER_FILE" | ||
| 137 | printf '[ -n "$RELAY" ] && ANNOUNCE="-announcerelay=$RELAY"\n' >> "$LAUNCHER_FILE" | ||
| 138 | printf 'WINEDLLOVERRIDES="libdb_cxx-6.2=n" wine "%s/bitflash.exe" $ANNOUNCE "$@"\n' "$INSTALL_DIR" >> "$LAUNCHER_FILE" | ||
| 139 | chmod +x "$LAUNCHER_FILE" | ||
| 140 | echo " Launcher created: $(cat "$LAUNCHER_FILE" | wc -l) lines" | ||
| 141 | |||
| 142 | if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then | ||
| 143 | echo "==> Adding ~/.local/bin to PATH..." | ||
| 144 | echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc" | ||
| 145 | fi | ||
| 146 | export PATH="$HOME/.local/bin:$PATH" | ||
| 147 | |||
| 148 | echo | ||
| 149 | echo "==================================================================" | ||
| 150 | echo " DONE." | ||
| 151 | echo " Launch: bitflash" | ||
| 152 | echo " Mine: bitflash -gen" | ||
| 153 | echo " Relay: bitflash -announcerelay=YOUR_HOST:8434" | ||
| 154 | echo " Data: $WINE_DATA" | ||
| 155 | echo "==================================================================" | ||