Add Linux GUI installer via Wine#3
Open
Vic-Nas wants to merge 38 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Linux-side installer script intended to bootstrap and run the Bitflash Windows GUI wallet under Wine, including optional wallet import and a convenience bitflash launcher in ~/.local/bin.
Changes:
- Introduces
install-bitflash-wine.shto install Wine + DB utilities, download the latest Windows GUI release, and extract it into~/.btf-wine/. - Initializes the Wine environment and optionally converts/imports an existing Linux
~/.bitflash/wallet.dat. - Creates a
bitflashlauncher and updates userPATHfor easy invocation.
Comments suppressed due to low confidence (7)
install-bitflash-wine.sh:18
- This block assumes
sudoandapt-getare available. If the script is run as root (common for installers) andsudoisn’t installed, or on a non-apt distro, the install step will fail in a confusing way. Prefer the sameSUDOpattern used in build-linux.sh and fail fast when apt-get is missing.
if ! command -v wine &>/dev/null; then
echo " Installing Wine..."
sudo apt-get update -qq && sudo apt-get install -y wine
fi
install-bitflash-wine.sh:136
- The generated launcher doesn’t set
WINEPREFIX, so it will always run against the user’s default prefix even if the installer uses a dedicated prefix. This can lead to the GUI using a different data directory than the installer prepared.
cat > "$BIN_DIR/bitflash" << LAUNCHER
#!/usr/bin/env bash
WINEDLLOVERRIDES="libdb_cxx-6.2=n" wine "$INSTALL_DIR/bitflash.exe" "\$@"
LAUNCHER
install-bitflash-wine.sh:58
unzipis used but never checked/installed, and theunzip | grep ... || truepipeline masks unzip failures (the script may proceed even if extraction failed). Installunzipif missing and preserve unzip’s exit code while filtering warnings.
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)"
install-bitflash-wine.sh:94
- If Wine never creates
wallet.datwithin the timeout, the script still continues and later steps will operate on a non-initialized prefix/data dir. It should fail with a clear error when initialization doesn’t complete.
# 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"
install-bitflash-wine.sh:121
- Importing overwrites the GUI wallet file without taking a backup. Re-running the installer (or importing by mistake) could cause irreversible wallet loss. Create a timestamped backup of the existing Wine wallet before copying the converted file in place.
echo " Installing converted wallet..."
cp "$CONVERTED" "$WINE_DATA/wallet.dat"
rm "$DUMP" "$CONVERTED"
install-bitflash-wine.sh:142
- This appends to
~/.bashrcbased on the currentPATH, which can cause duplicate entries on repeated runs (e.g., if PATH is customized elsewhere). It’s safer to check whether the exact export line is already present in~/.bashrcbefore appending, and to use$BIN_DIRconsistently.
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
echo "==> Adding ~/.local/bin to PATH..."
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc"
fi
install-bitflash-wine.sh:49
- The download step doesn’t fail on HTTP errors and doesn’t retry transient failures, which can lead to corrupted/partial downloads being executed. At minimum, make curl fail fast and retry; ideally also verify a published checksum/signature for the release asset.
curl -L -o "$TMPZIP" "$RELEASE_URL"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1
to
+3
| #!/usr/bin/env bash | ||
| # Bitflash GUI installer for Linux (via Wine) | ||
|
|
Comment on lines
+4
to
+8
| 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" |
…ort forwarding needed
…icipant Stratum client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a one-shot installer that runs the Bitflash Windows GUI wallet on Linux via Wine, making the full GUI (including Send Coins) available without needing a separate machine.
What it does:
~/.btf-wine/~/.bitflash/wallet.dat(converting BDB format automatically via db_dump/db_load)bitflashcommand in~/.local/bin/that accepts the same args as the node (-gen,-announcerelay, etc.)Usage after install:
Tested on: Ubuntu 24.04, Wine 9.0
Why this is useful: The headless Linux node has no send functionality — this gives Linux users a GUI wallet with full send capability, and allows importing coins mined by the headless node into the GUI wallet.