mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-26 22:51:14 +00:00
build(amm): link amm_client_ffi into the AMM UI module
This commit is contained in:
@@ -26,4 +26,6 @@ logos_module(
|
||||
LINK_LIBRARIES
|
||||
Qt6::Gui
|
||||
Qt6::Network
|
||||
EXTERNAL_LIBS
|
||||
amm_client_ffi
|
||||
)
|
||||
|
||||
+9
-3
@@ -20,7 +20,7 @@ honors), and its config (`wallet_config.json`) self-initializes.
|
||||
|
||||
Account/keystore sharing follows the runtime:
|
||||
|
||||
- **Standalone** (`nix run .`): own core-module instance, but the canonical
|
||||
- **Standalone** (`nix run .#amm-ui`): own core-module instance, but the canonical
|
||||
`~/.lee/wallet` keystore is shared with the LEZ wallet UI and any other LEZ
|
||||
app on the machine. A previously-created wallet auto-opens on launch.
|
||||
- **Inside Basecamp**: the core wallet module is a single shared instance, so on
|
||||
@@ -50,14 +50,20 @@ This makes `lgpm` available as a global command.
|
||||
|
||||
## Running the UI standalone
|
||||
|
||||
Start the UI with:
|
||||
The app is built from the **repository-root** flake (which also provides the
|
||||
`amm_client_ffi` library it links). From the repo root, launch it with its named
|
||||
attribute:
|
||||
|
||||
```bash
|
||||
nix run .
|
||||
nix run .#amm-ui
|
||||
```
|
||||
|
||||
This builds and runs the application in development mode. The Logos bridge is unavailable in standalone mode, but the UI layout and mock data are fully functional.
|
||||
|
||||
Build just the FFI crate with `nix build .#amm_client_ffi`. (Each UI is exposed
|
||||
under its own name, so future apps are `nix run .#<name>` — there is no bare
|
||||
`nix run .` default.)
|
||||
|
||||
## Running inside Logos Basecamp
|
||||
|
||||
This app is a UI plugin that depends on the **core wallet module**
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
logos_execution_zone.url = "github:logos-blockchain/logos-execution-zone-module?rev=d2e9400ac06c3cdbfc2405b4f153fff9841a453c";
|
||||
};
|
||||
|
||||
# NOTE: this flake is no longer built standalone. The amm_client_ffi crate
|
||||
# (the Rust C FFI library the AmmUiBackend C++ code links against) lives in
|
||||
# the repo-root flake, and referencing it from here would require either a
|
||||
# hardcoded absolute `git+file://` path or a `path:../..` input — the latter
|
||||
# fails flake evaluation because the app directory is copied into the Nix
|
||||
# store as its own flake root, so `../..` can't escape it there. Instead,
|
||||
# the repo-root flake.nix builds this module directly (src = ./apps/amm)
|
||||
# and resolves amm_client_ffi via `self`. Build/run the app from the repo
|
||||
# root, e.g. `nix build .#packages.<system>.default` or `nix run .`.
|
||||
outputs = inputs@{ logos-module-builder, ... }:
|
||||
logos-module-builder.lib.mkLogosQmlModule {
|
||||
src = ./.;
|
||||
|
||||
@@ -14,11 +14,13 @@
|
||||
"build": [],
|
||||
"runtime": ["qt6.qtdeclarative", "zstd", "krb5", "abseil-cpp"]
|
||||
},
|
||||
"external_libraries": [],
|
||||
"external_libraries": [
|
||||
{ "name": "amm_client_ffi" }
|
||||
],
|
||||
"cmake": {
|
||||
"find_packages": [],
|
||||
"extra_sources": [],
|
||||
"extra_include_dirs": [],
|
||||
"extra_include_dirs": ["lib"],
|
||||
"extra_link_libraries": []
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user