Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ jobs:
fetch-depth: 0
submodules: recursive

# -d enables the pinned Epic/MWC native-assets prebuilts for flutter test.
- name: Configure app (prebuilt native assets)
- name: Install Xelis Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.94.1'

- name: Configure app
run: |
cd scripts
echo "yes" | ./build_app.sh -v "0.0.1" -b "1" -p "linux" -a "stack_wallet" -d -s
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ENV RUSTUP_HOME=/usr/local/rustup \

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain 1.89.0 --profile minimal --no-modify-path \
&& rustup install 1.85.1 1.71.0 stable --profile minimal \
&& rustup install 1.85.1 1.71.0 1.94.1 stable --profile minimal \
&& rustup target add x86_64-unknown-linux-gnu --toolchain 1.89.0 \
&& cargo install cargo-ndk \
&& chmod -R a+rwX "$CARGO_HOME" "$RUSTUP_HOME"
Expand Down Expand Up @@ -123,6 +123,10 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
&& rustup target add \
aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android \
--toolchain 1.89.0 \
&& rustup toolchain install 1.94.1 --profile minimal \
&& rustup target add \
aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android \
--toolchain 1.94.1 \
&& cargo install cargo-ndk \
&& chmod -R a+rwX "$CARGO_HOME" "$RUSTUP_HOME"

Expand Down Expand Up @@ -185,7 +189,7 @@ RUN git config --system --add safe.directory '*'
RUN flutter --version && rustc --version && cargo --version && go version


# Image for flutter test (no Android SDK or cross-compilers)
# Test image: Native Assets hooks also compile the Xelis Rust runtime.
FROM ubuntu:24.04 AS test

ENV DEBIAN_FRONTEND=noninteractive \
Expand All @@ -210,6 +214,7 @@ ENV RUSTUP_HOME=/usr/local/rustup \

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain 1.90.0 --profile minimal --no-modify-path \
&& rustup toolchain install 1.94.1 --profile minimal \
&& chmod -R a+rwX "$CARGO_HOME" "$RUSTUP_HOME"

ENV PATH=/usr/local/go/bin:$PATH
Expand Down
26 changes: 22 additions & 4 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Here you will find instructions on how to install the necessary tools for buildi

## Prerequisites

- Xelis requires Flutter 3.47.2 and Rustup. Its native wallet library is
built automatically through Native Assets, using Rust 1.94.1.
Android builds require NDK r28 or newer.

- The only OS supported for building Android and Linux desktop is Ubuntu 24.04. Windows builds require using Ubuntu 24.04 on WSL2. macOS builds for itself and iOS. Advanced users may also be able to build on other Debian-based distributions like Linux Mint.
- Android setup ([Android Studio](https://developer.android.com/studio) and subsequent dependencies)
- 100 GB of storage
Expand All @@ -14,7 +18,7 @@ Here you will find instructions on how to install the necessary tools for buildi
The following instructions are for building and running on a Linux host. Alternatively, see the [Mac](#mac-host) and/or [Windows](#windows-host) section. This entire section (except for the Android Studio section) needs to be completed in WSL if building on a Windows host.

### Flutter
Install Flutter 3.38.5 by [following their guide](https://docs.flutter.dev/get-started/install/linux/desktop?tab=download#install-the-flutter-sdk). Run `flutter doctor` in a terminal to confirm its installation.
Install Flutter 3.47.2 by [following their guide](https://docs.flutter.dev/get-started/install/linux/desktop?tab=download#install-the-flutter-sdk). Run `flutter doctor` in a terminal to confirm its installation.

### Android Studio
Install Android Studio. Follow instructions here [https://developer.android.com/studio/install#linux](https://developer.android.com/studio/install#linux) or install via snap:
Expand Down Expand Up @@ -69,7 +73,7 @@ pip3 install --upgrade meson==0.64.1 markdown==3.4.1 markupsafe==2.1.1 jinja2==3
```

### Flutter
Install Flutter 3.38.5 by [following their guide](https://docs.flutter.dev/install/manual).
Install Flutter 3.47.2 by [following their guide](https://docs.flutter.dev/install/manual).

Run `flutter doctor` in a terminal to confirm its installation.

Expand Down Expand Up @@ -220,7 +224,7 @@ rustup target add aarch64-apple-ios aarch64-apple-darwin
Optionally download [Android Studio](https://developer.android.com/studio) as an IDE and activate its Dart and Flutter plugins. VS Code may work as an alternative, but this is not recommended.

### Flutter
Install 3.38.5 on your Mac host by [following their guide](https://docs.flutter.dev/install/manual). Run `flutter doctor` in a terminal to confirm its installation.
Install Flutter 3.47.2 on your Mac host by [following their guide](https://docs.flutter.dev/install/manual). Run `flutter doctor` in a terminal to confirm its installation.

### Build plugins and configure
#### Building plugins for iOS
Expand Down Expand Up @@ -300,7 +304,7 @@ If the DLL was built on the WSL filesystem instead of on Windows, copy `stack_wa
Frostdart will be built by the Windows host later.

### Install Flutter on Windows host
Install Flutter 3.38.5 on your Windows host (not in WSL2) by [following their guide](https://docs.flutter.dev/install/manual). Run `flutter doctor` in PowerShell to confirm its installation.
Install Flutter 3.47.2 on your Windows host (not in WSL2) by [following their guide](https://docs.flutter.dev/install/manual). Run `flutter doctor` in PowerShell to confirm its installation.

### Rust
Install [Rust](https://www.rust-lang.org/tools/install) on the Windows host (not in WSL2). Download the installer from [rustup.rs](https://rustup.rs), make sure it works on the commandline (you may need to open a new terminal), and install the following versions:
Expand Down Expand Up @@ -363,6 +367,20 @@ dart run coinlib:build_windows
flutter run -d windows
```

## Xelis devnet test

To validate Xelis transfers locally, provide a `xelis_daemon` 1.25
executable built for your host OS. The test starts an isolated temporary
devnet node; no running node is required.

```sh
flutter test test/wallets/xelis_local_transfer_test.dart \
--dart-define=XELIS_LOCAL_DAEMON=/absolute/path/to/xelis_daemon
```

This test is skipped when `XELIS_LOCAL_DAEMON` is not set.
The daemon is not required to build the app.

# Troubleshooting

Run with `-v` or `--verbose` to see a more detailed error. Certain exceptions (like missing a plugin library) may not report quality errors without `verbose`, especially on Windows.
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ final openedFromSWBFileStringStateProvider = StateProvider<String?>(
// runs the MyApp widget and checks for new users, caching the value in the
// miscellaneous box for later use
void main(List<String> args) async {
WidgetsFlutterBinding.ensureInitialized();
// talker.info('initializing Rust lib ...');
if (AppConfig.coins.whereType<Xelis>().isNotEmpty) {
await libXelis.initRustLib();
}
WidgetsFlutterBinding.ensureInitialized();

if (Util.isDesktop && args.length == 2 && args.first == "-d") {
StackFileSystem.setDesktopOverrideDir(args.last);
Expand Down
Loading
Loading