diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml new file mode 100644 index 000000000..c082bd4d9 --- /dev/null +++ b/.github/workflows/flatpak.yml @@ -0,0 +1,132 @@ +name: Build Flatpak + +on: + push: + branches: + - "**flatpak**" + release: + types: + - published + workflow_dispatch: + +concurrency: + group: flatpak-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build-flatpak: + name: Build Flatpak (${{ matrix.arch }}) + permissions: + contents: write + strategy: + matrix: + include: + - arch: x86_64 + runs-on: ubuntu-latest + protoc-zip: protoc-25.2-linux-x86_64.zip + protoc-sha256: 78ab9c3288919bdaa6cfcec6127a04813cf8a0ce406afa625e48e816abee2878 + - arch: aarch64 + runs-on: ubuntu-24.04-arm + protoc-zip: protoc-25.2-linux-aarch_64.zip + protoc-sha256: 07683afc764e4efa3fa969d5f049fbc2bdfc6b4e7786a0b233413ac0d8753f6b + + runs-on: ${{ matrix.runs-on }} + timeout-minutes: 20 + + steps: + - name: Check out code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Install Flatpak and Flatpak Builder + run: | + sudo apt-get update + sudo apt-get install -y flatpak flatpak-builder + + - name: Add Flathub remote + run: | + sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + + - name: Install Flatpak SDK and runtime + run: | + sudo flatpak install -y --noninteractive flathub \ + org.freedesktop.Platform//25.08 \ + org.freedesktop.Sdk//25.08 \ + org.freedesktop.Sdk.Extension.rust-stable//25.08 \ + org.freedesktop.Sdk.Extension.llvm21//25.08 + echo "=== Disk space after SDK install ===" + df -h + + - name: Patch manifest for architecture + run: | + sed -i "s|protoc-25.2-linux-x86_64.zip|${{ matrix.protoc-zip }}|g" flatpak/org.dash.DashEvoTool.yml + sed -i "s|sha256: 78ab9c3288919bdaa6cfcec6127a04813cf8a0ce406afa625e48e816abee2878|sha256: ${{ matrix.protoc-sha256 }}|" flatpak/org.dash.DashEvoTool.yml + + - name: Prepare Cargo cache + run: mkdir -p cargo-cache/registry cargo-cache/git cargo-target + + - name: Restore Cargo cache + uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: | + cargo-cache + cargo-target + key: cargo-flatpak-${{ matrix.arch }}-${{ hashFiles('Cargo.lock') }} + restore-keys: | + cargo-flatpak-${{ matrix.arch }}- + + - name: Bind-mount Cargo cache into Flatpak sandbox + run: | + WORKSPACE="$(pwd)" + sed -i "/^ build-args:$/,/--share=network/{ + /--share=network/a\\ + - --bind-mount=/run/build/dash-evo-tool/cargo=${WORKSPACE}/cargo-cache\\ + - --bind-mount=/run/build/dash-evo-tool/target=${WORKSPACE}/cargo-target + }" flatpak/org.dash.DashEvoTool.yml + + - name: Cache Flatpak builder + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: .flatpak-builder + key: flatpak-builder-${{ matrix.arch }}-${{ hashFiles('flatpak/org.dash.DashEvoTool.yml', 'Cargo.lock') }} + restore-keys: | + flatpak-builder-${{ matrix.arch }}- + + - name: Build Flatpak + run: | + flatpak-builder --force-clean --repo=flatpak-repo build-dir flatpak/org.dash.DashEvoTool.yml + + - name: Create Flatpak bundle + run: | + flatpak build-bundle flatpak-repo dash-evo-tool-linux-${{ matrix.arch }}.flatpak org.dash.DashEvoTool + + - name: Clean Cargo cache for storage + run: | + rm -rf cargo-target/release/incremental + rm -rf cargo-cache/registry/src + echo "=== Cargo cache sizes ===" + du -sh cargo-cache cargo-target || true + + - name: Save Cargo cache + uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: | + cargo-cache + cargo-target + key: cargo-flatpak-${{ matrix.arch }}-${{ hashFiles('Cargo.lock') }} + + - name: Upload Flatpak bundle as artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: dash-evo-tool-linux-${{ matrix.arch }}-flatpak + path: dash-evo-tool-linux-${{ matrix.arch }}.flatpak + + - name: Attach bundle to release + if: github.event_name == 'release' + uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: dash-evo-tool-linux-${{ matrix.arch }}.flatpak diff --git a/.gitignore b/.gitignore index f038c0579..60cccf155 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,10 @@ build-test/ # Build artifacts *.snap +*.flatpak +.flatpak-builder/ +flatpak-repo/ +build-dir/ # Dot env file .env diff --git a/README.md b/README.md index 0c9cd47ce..1d3d1d238 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,13 @@ The tool supports both Mainnet and Testnet networks. Check out the [documentatio ## Table of Contents +- [Install via Flatpak (Linux)](#install-via-flatpak-linux) - [Prerequisites](#prerequisites) - [Rust Installation](#rust-installation) - [Dependencies](#dependencies) - [Windows Runtime Dependencies](#windows-runtime-dependencies) - [Dash Core Wallet Setup](#dash-core-wallet-setup) -- [Installation](#installation) +- [Build from Source](#build-from-source) - [Getting Started](#getting-started) - [Start the App](#start-the-app) - [Application directory](#application-directory) @@ -31,8 +32,38 @@ The tool supports both Mainnet and Testnet networks. Check out the [documentatio - [Support](#support) - [Security Note](#security-note) +## Install via Flatpak (Linux) + +The easiest way to run Dash Evo Tool on Linux is via Flatpak. Download the `.flatpak` bundle for your architecture from the [latest release](https://github.com/dashpay/dash-evo-tool/releases) and install it: + +``` shell +# x86_64 +flatpak install dash-evo-tool-linux-x86_64.flatpak + +# aarch64 (ARM) +flatpak install dash-evo-tool-linux-aarch64.flatpak +``` + +To run: + +``` shell +flatpak run org.dash.DashEvoTool +``` + +To uninstall: + +``` shell +flatpak uninstall org.dash.DashEvoTool +``` + +The Flatpak version runs in SPV (light client) mode — no full Dash Core node is required. Application data is stored in `~/.var/app/org.dash.DashEvoTool/config/dash-evo-tool/`. + +> **Note:** The Flatpak data path differs from native Linux builds, which use `~/.config/dash-evo-tool/`. + ## Prerequisites +The following prerequisites are only needed if you want to build from source. + Before you begin, ensure you have met the following requirements: ### Rust Installation @@ -82,9 +113,9 @@ If you use the prebuilt Windows binary, make sure the target machine has: - **Synchronize Wallet**: Ensure the wallet is fully synced with the network you intend to use (Mainnet or Testnet). -## Installation +## Build from Source -To install Dash Evo Tool: +To build Dash Evo Tool from source: 1. **Clone the repository**: diff --git a/flatpak/org.dash.DashEvoTool.desktop b/flatpak/org.dash.DashEvoTool.desktop new file mode 100644 index 000000000..98b91e1ce --- /dev/null +++ b/flatpak/org.dash.DashEvoTool.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Dash Evo Tool +Comment=Graphical user interface for interacting with Dash Evolution +Exec=dash-evo-tool +Icon=org.dash.DashEvoTool +Type=Application +Terminal=false +Categories=Finance;Network;Utility; +Keywords=Dash;Blockchain;Crypto;Wallet;DPNS;Evolution; +StartupWMClass=org.dash.DashEvoTool diff --git a/flatpak/org.dash.DashEvoTool.metainfo.xml b/flatpak/org.dash.DashEvoTool.metainfo.xml new file mode 100644 index 000000000..ca5049c72 --- /dev/null +++ b/flatpak/org.dash.DashEvoTool.metainfo.xml @@ -0,0 +1,49 @@ + + + org.dash.DashEvoTool + Dash Evo Tool + Graphical user interface for interacting with Dash Platform + + MIT + MIT + + +

+ A cross-platform desktop application for interacting with Dash Platform + (Layer 2). Features include DPNS username registration, contest voting, + state transition viewing, wallet management, and identity operations. + Works in SPV (light client) mode - no full Dash Core node required. +

+
+ + + Finance + Network + BlockchainTools + + + + Dash + cryptocurrency + blockchain + wallet + DPNS + + + https://github.com/dashpay/dash-evo-tool + https://github.com/dashpay/dash-evo-tool/issues + + org.dash.DashEvoTool.desktop + + org.dash.DashEvoTool + + + + + Dash Core Group + + + + + +
diff --git a/flatpak/org.dash.DashEvoTool.yml b/flatpak/org.dash.DashEvoTool.yml new file mode 100644 index 000000000..10583c21a --- /dev/null +++ b/flatpak/org.dash.DashEvoTool.yml @@ -0,0 +1,74 @@ +# Flatpak manifest for Dash Evo Tool +# Build with: flatpak-builder --user --force-clean --repo=flatpak-repo build-dir flatpak/org.dash.DashEvoTool.yml +# Install locally: flatpak-builder --user --install --force-clean build-dir flatpak/org.dash.DashEvoTool.yml +# Create bundle: flatpak build-bundle flatpak-repo dash-evo-tool.flatpak org.dash.DashEvoTool + +app-id: org.dash.DashEvoTool +runtime: org.freedesktop.Platform +runtime-version: '25.08' +sdk: org.freedesktop.Sdk +sdk-extensions: + - org.freedesktop.Sdk.Extension.rust-stable + - org.freedesktop.Sdk.Extension.llvm21 + +command: dash-evo-tool + +finish-args: + # X11 shared memory for display + - --share=ipc + # Network access for blockchain communication + - --share=network + # Display server support (prefer Wayland, fall back to X11) + - --socket=wayland + - --socket=fallback-x11 + # GPU acceleration for egui rendering + - --device=dri + +build-options: + append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm21/bin + build-args: + - --share=network + env: + CARGO_HOME: /run/build/dash-evo-tool/cargo + PROTOC: /app/bin/protoc + PROTOC_INCLUDE: /app/include + +modules: + # Module 1: Install protobuf compiler (required for building dash-sdk) + # NOTE: CI patches this module for aarch64 via sed (see .github/workflows/flatpak.yml). + - name: protoc + buildsystem: simple + sources: + - type: file + url: https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protoc-25.2-linux-x86_64.zip + sha256: 78ab9c3288919bdaa6cfcec6127a04813cf8a0ce406afa625e48e816abee2878 + build-commands: + - unzip protoc-25.2-linux-x86_64.zip bin/protoc -d /app + - unzip protoc-25.2-linux-x86_64.zip 'include/*' -d /app + - chmod 755 /app/bin/protoc + + # Module 2: Build libsodium (required for crypto operations) + - name: libsodium + buildsystem: autotools + sources: + - type: archive + url: https://github.com/jedisct1/libsodium/releases/download/1.0.20-RELEASE/libsodium-1.0.20.tar.gz + sha256: ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19 + + # Module 3: Build dash-evo-tool from source + - name: dash-evo-tool + buildsystem: simple + sources: + - type: dir + path: .. + skip: + - .flatpak-builder + - build-dir + - flatpak-repo + - target + build-commands: + - cargo build --release --locked + - install -Dm755 target/release/dash-evo-tool /app/bin/dash-evo-tool + - install -Dm644 flatpak/org.dash.DashEvoTool.desktop /app/share/applications/org.dash.DashEvoTool.desktop + - install -Dm644 flatpak/org.dash.DashEvoTool.metainfo.xml /app/share/metainfo/org.dash.DashEvoTool.metainfo.xml + - install -Dm644 assets/DET_LOGO.png /app/share/icons/hicolor/512x512/apps/org.dash.DashEvoTool.png diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml deleted file mode 100644 index 41c74408b..000000000 --- a/snap/snapcraft.yaml +++ /dev/null @@ -1,226 +0,0 @@ -name: dash-evo-tool -title: Dash Evo Tool -icon: mac_os/AppIcons/Assets.xcassets/AppIcon.appiconset/512.png -type: app -version: "0.9.0-preview.4" -summary: Graphical user interface for interacting with Dash Evolution -description: | - Dash Evo Tool is a graphical user interface for easily interacting with - Dash Evolution. The current version enables registering DPNS usernames, - viewing active DPNS username contests, voting on active contests, and - decoding state transitions. The tool supports both Mainnet and Testnet networks. - -grade: devel -confinement: strict - -base: core24 - -platforms: - amd64: - arm64: - -apps: - dash-evo-tool: - command: bin/dash-evo-tool - desktop: usr/share/applications/dash-evo-tool.desktop - environment: - XKB_CONFIG_ROOT: $SNAP/usr/share/X11/xkb - plugs: - - home - - network - - network-bind - - desktop - - desktop-legacy - - wayland - - x11 - - opengl - - gsettings - - screen-inhibit-control - - browser-support - - process-control # Required to spawn external processes - # - system-files # Required to access system binaries - -parts: - rust-deps: - plugin: nil - build-packages: - - curl - - build-essential - - pkg-config - - libssl-dev - override-build: | - # Install Rust - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.92 - export PATH="$HOME/.cargo/bin:$PATH" - rustc --version - cargo --version - - protoc: - plugin: nil - build-packages: - - curl - - unzip - override-build: | - # Install protoc to stage directory (build-time only) - PROTOC_VERSION="31.1" - if [ "$CRAFT_ARCH_BUILD_ON" = "arm64" ]; then - PROTOC_ARCH="aarch_64" - else - PROTOC_ARCH="x86_64" - fi - curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip" - unzip -o "protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip" -d $SNAPCRAFT_STAGE bin/protoc - unzip -o "protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip" -d $SNAPCRAFT_STAGE 'include/*' - chmod +x $SNAPCRAFT_STAGE/bin/protoc - - dash-evo-tool: - after: [rust-deps, protoc] - plugin: nil - source: . - build-packages: - - build-essential - - pkg-config - - clang - - cmake - - libsqlite3-dev - - libxcb-xfixes0-dev - - libxcb-shape0-dev - - libxcb-randr0-dev - - libxcb-xkb-dev - - libxkbcommon-x11-dev - - libxkbcommon-dev - - libssl-dev - - libsodium-dev - - libbsd-dev - - libc6-dev - - libclang-dev - - xkb-data - stage-packages: - - xkb-data - - libxkbcommon0 - - libxkbcommon-x11-0 - - libxcb-xfixes0 - - libxcb-shape0 - - libxcb-randr0 - - libxcb-xkb1 - - libssl3 - - libsodium23 - - libbsd0 - - libsqlite3-0 - - libfontconfig1 - - libfreetype6 - - libx11-6 - - libx11-xcb1 - - libxcursor1 - - libxi6 - - libxrandr2 - - libgl1-mesa-dri - - libglu1-mesa - - libwayland-client0 - - libwayland-cursor0 - - libwayland-egl1 - - mesa-utils - override-build: | - # Setup environment - export PATH="$HOME/.cargo/bin:$PATH" - export PROTOC="$SNAPCRAFT_STAGE/bin/protoc" - - # Create necessary directories and copy files - mkdir -p dash-evo-tool/ - cp .env.example dash-evo-tool/.env - cp -r dash_core_configs/ dash-evo-tool/dash_core_configs - - # Build the project - cargo build --release - - # Install binary - mkdir -p $SNAPCRAFT_PART_INSTALL/bin - cp target/release/dash-evo-tool $SNAPCRAFT_PART_INSTALL/bin/ - - # Install configuration - mkdir -p $SNAPCRAFT_PART_INSTALL/etc/dash-evo-tool - cp -r dash_core_configs/ $SNAPCRAFT_PART_INSTALL/etc/dash-evo-tool/ - cp .env.example $SNAPCRAFT_PART_INSTALL/etc/dash-evo-tool/.env - - # Create desktop file - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/applications - cat > $SNAPCRAFT_PART_INSTALL/usr/share/applications/dash-evo-tool.desktop << EOF - [Desktop Entry] - Name=Dash Evo Tool - Comment=Graphical user interface for interacting with Dash Evolution - Exec=dash-evo-tool - Icon=\${SNAP}/usr/share/icons/hicolor/256x256/apps/dash-evo-tool.png - Type=Application - Categories=Utility;Finance;Network; - StartupWMClass=dash-evo-tool - X-SnapInstanceName=dash-evo-tool - EOF - - # Install icon - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/icons/hicolor/256x256/apps - if [ -f "mac_os/AppIcons/Assets.xcassets/AppIcon.appiconset/256.png" ]; then - cp mac_os/AppIcons/Assets.xcassets/AppIcon.appiconset/256.png $SNAPCRAFT_PART_INSTALL/usr/share/icons/hicolor/256x256/apps/dash-evo-tool.png - else - # Create a placeholder icon if the original doesn't exist - convert -size 256x256 xc:lightblue -gravity center -pointsize 24 -annotate +0+0 "Dash" $SNAPCRAFT_PART_INSTALL/usr/share/icons/hicolor/256x256/apps/dash-evo-tool.png - fi - - # Include dash-qt in the snap package - dash-qt: - plugin: nil - build-packages: - - curl - - unzip - stage-packages: - # XCB libraries for X11 support - - libxcb-icccm4 - - libxcb-image0 - - libxcb-shm0 - - libxcb-keysyms1 - - libxcb-randr0 - - libxcb-render-util0 - - libxcb-render0 - - libxcb-shape0 - - libxcb-sync1 - - libxcb-xfixes0 - - libxcb-xinerama0 - - libxcb-xkb1 - - libxcb1 - - libxcb-util1 - # X11 authentication - - libxau6 - - libxdmcp6 - # Font and graphics support - - libfontconfig1 - - libfreetype6 - - libexpat1 - - libpng16-16 - # BSD libraries - - libbsd0 - - libmd0 - # XKB support - - libxkbcommon0 - - libxkbcommon-x11-0 - # Core system libraries (usually included but ensure they're available) - - libgcc-s1 - - libc6 - override-build: | - # Download and install dash-qt - DASH_VERSION="22.1.2" - if [ "$CRAFT_ARCH_BUILD_FOR" = "arm64" ]; then - DASH_ARCH="aarch64" - else - DASH_ARCH="x86_64" - fi - - # Download from official Dash releases - curl -L "https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-${DASH_ARCH}-linux-gnu.tar.gz" -o dash.tar.gz - tar -xzf dash.tar.gz - - # Install binaries - mkdir -p $SNAPCRAFT_PART_INSTALL/bin $SNAPCRAFT_PART_INSTALL/lib - cp dashcore-${DASH_VERSION}/bin/dash-qt $SNAPCRAFT_PART_INSTALL/bin/ - cp dashcore-${DASH_VERSION}/lib/* $SNAPCRAFT_PART_INSTALL/lib/ - - # Make executable - chmod +x $SNAPCRAFT_PART_INSTALL/bin/* diff --git a/src/main.rs b/src/main.rs index 0d0121cb0..2b364f62d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,7 +52,9 @@ async fn start(app_data_dir: &std::path::Path) -> Result<(), eframe::Error> { persist_window: true, // Persist window size and position centered: true, // Center window on startup if not maximized persistence_path: Some(app_data_dir.join("app.ron")), - viewport: egui::ViewportBuilder::default().with_icon(icon_data), + viewport: egui::ViewportBuilder::default() + .with_icon(icon_data) + .with_app_id("org.dash.DashEvoTool"), ..Default::default() };