xmr-btc-swap/src-gui
Mohan 801ce8fd9d
feat(taker): Improve maker discovery (#692)
* mvp

* only redial if DisconnectedAndNotDialing

* progress

* progress

* progress

* some progress

* progress

* extract common logic into behaviour_util::ConnectionTracker

* extract common logic into BackoffTracker helper struct

* add comment in quote::background behaviour

* BackoffTracker rename get_backoff to get(...)

* cleanup, fix some things that got lost during rebase

* properly propagate quote::background ToSwarm events

* actually persist event loop, add quotes and rendezvous::discovery to cli behaviour

* some progress, cleanup, comments

* progress

* redial all peers that we dont know dont support quote, use quotes_cached behaviour in example, add remove_peer(...) to redial behaviour, don't redial discovered rendezvous peers

* remove old todo

* quotes_cached.rs: cache last connected endpoint

* rename: add_peer_address -> queue_peer_address

* extract p2p defaults into swap-p2p/defaults.rs

* split rendezvous.rs into two sub-modules

* remove unused bob::BackgroundQuoteReceived

* replace usage of list_sellers with event loop

* prune: remove list_sellers command

* use backoff helper in swap-p2p/src/protocols/quotes.rs

* refactor rendezvous::register behaviour, getting some unit tests working again

* add all peer addresses to the swarm on init

* less agressive redials

* extract magic backoff numbers

* proof of concept: drill tracing span into event loop through channels

* add BackoffTracker::increment, re-schedule register when we lose connection to rendezvous point

* fetch identify version and propagate into UI

* forbid private/local/loopback ip addresses to be shared/accepted through Identify

* remove legacy list_sellers code

* ensure uuids are unique for alice during swap_setup

* formatting and nitpicks

* fix: allow multiple swap setup requests over the same connection handler

* small cleanups

* fix: protocols/quotes.rs unit tests

* revert: listen on 0.0.0.0 for asb p2p

* propagate handle_pending_inbound_connection and handle_pending_outbound_connection to identify patch source

* replace loop with repeated return Poll::Ready in discovery.rs

* format

* MultiAddrVecExt trait, emit rendezvous addresses to rendezvous-node swarm

* fix: strictly disallow concurrent swap setup requests for the same swap on the same connection

* fix tests etc

* remove slop from futures_util.rs

* address some comments

* behaviour_util.rs: track inflight dials, add tests, return Some(peer_id) if internal state was changed

* replace boring-avatars with jidenticon

* feat: add peer discovery status dialog

* remove buy-xmr cli command, remove "sellers" arg for BuyXmrArgs, add changelog

* disable body overscroll

* add changelog for jidenticon

* increase quote fetch interval to 45s

* fix rendezvous::register_and_discover_together test
2025-12-01 18:03:13 +01:00
..
public feat: cargo project at root 2024-08-08 00:49:04 +02:00
src feat(taker): Improve maker discovery (#692) 2025-12-01 18:03:13 +01:00
.env.development fixes 2025-09-19 21:16:32 +02:00
.gitignore docs: generally improve docs and add maker page (#242) 2025-01-21 16:05:05 +01:00
eslint.config.js feat(defaults, gui): add bluewallet and cakewallet electrum servers (#686) 2025-11-09 11:41:55 +01:00
index.html feat(taker): Improve maker discovery (#692) 2025-12-01 18:03:13 +01:00
knip.json feat(gui): add knip for checking for unused dead code, remove dead code 2025-11-05 19:08:43 +01:00
package.json feat(taker): Improve maker discovery (#692) 2025-12-01 18:03:13 +01:00
README.md feat(monero-sys): Build system (#500) 2025-08-27 16:45:59 +02:00
tsconfig.json fix(gui): Strictly enforce UI types with Typescript (#678) 2025-11-05 18:38:00 +01:00
tsconfig.node.json feat: cargo project at root 2024-08-08 00:49:04 +02:00
vite.config.ts feat(gui, tauri): Accept --testnet flag, default to mainnet (#106) 2024-10-10 14:51:56 +02:00
yarn.lock feat(taker): Improve maker discovery (#692) 2025-12-01 18:03:13 +01:00

Requirements

  • For compiling the Rust code: cargo and cargo tauri (installation)

  • For running the Typescript code: node and yarn

  • For formatting and bindings: dprint (cargo install dprint@0.50.0) and typeshare (cargo install typeshare-cli)

  • If you are on Windows and you want to use the check-bindings command you'll need to manually install the GNU DiffUtils (installation) and GNU CoreUtils (installtion). Remember to add the installation path (probably C:\Program Files (x86)\GnuWin32\bin) to the PATH in your enviroment variables.

  • Compiling for Windows is only possible from Ubuntu (x86_64). It requires a very recent mingw version which you'll need to build from source. You can do this by running just prepare-windows-build from the root of the repository.

Start development servers

For development, we need to run both vite and tauri servers:

cd src-gui
yarn install && yarn run dev
# let this run
cd src-tauri
cargo tauri dev --no-watch -- -- --testnet
# let this run as well

Generate bindings for Tauri API

Running yarn run dev or yarn build should automatically re-build the Typescript bindings whenever something changes. You can also manually trigger this using the gen-bindings command:

yarn run gen-bindings

You can also check whether the current bindings are up to date:

yarn run check-bindings

Debugging

Because the GUI is running in an embedded browser, we can't use the usual Browser extensions to debug the GUI. Instead we use standalone React DevTools / Redux DevTools.

React DevTools

Run this command to start the React DevTools server. The frontend will connect to this server automatically:

npx react-devtools

Redux DevTools

Run this command to start the Redux DevTools server. The frontend will connect to this server automatically. You can then debug the global Redux state. Observe how it changes over time, go back in time, see dispatch history, etc.

You may have to go to Settings -> 'use local custom server' -> connect inside the devtools window for the state to be reflected correctly.

npx redux-devtools --hostname=localhost --port=8098 --open