9 Commits

Author SHA1 Message Date
binarybaron
2633e8e6bf
fix(asb): Compilation error introduced in #203 (#222) 2024-12-03 22:18:24 +01:00
binarybaron
d53c12d64e
feat(asb, cli): Listen on onion address, dial onion addresses (#203)
This pull requests
- Adds rust native support for the `asb` to listen on an onion service. Previously we were depedent on a seperately running `torc` client. Instead we now use [arti](https://tpo.pages.torproject.net/core/arti/), a rust implementation of the tor protocol.
- Removes the `tor.control_port` and `tor.socks5_port` property from the config of the `asb`
- Adds a new `tor.register_hidden_service` boolean property to the config of the `asb` which when enabled automatically runs a hidden service at startup
- Adds a new `tor.hidden_service_num_intro_points` config property to specify how many introduction points to register the onion service at
- Adds support for the `cli` to dial onion addresses

This is dependent on https://github.com/umgefahren/libp2p-tor/pull/24

Closes https://github.com/UnstoppableSwap/core/issues/16
2024-12-03 21:24:33 +01:00
binarybaron
6cd228fada
feat(swap): Use art_client to dial over Tor (#196)
- Upgrade `sqlx` to `0.8`
- Use `arti_client@0.24` in combination with [`libp2p-community-tor`](https://crates.io/crates/libp2p-community-tor/0.4.1). https://github.com/umgefahren/libp2p-tor/pull/18 was required for this.
- Display spinner in GUI while Tor circuits are being established
- Remove unused dependencies (`once_cell`, `tauri-plugin-devtools`, `digest`, `hyper`, `itertools`, `erased_serde`)
- Bundle roboto font from npm registry
2024-11-21 01:00:36 +01:00
binarybaron
c027e51087
refactor(swap): Upgrade libp2p to 0.53.2, reliable retry mechanisms (#109)
Our libp2p version is out of date, and we need to tackle the upgrade even though it's a significant undertaking. This'll also fix some other [issues](https://github.com/UnstoppableSwap/core/issues/95).

## This PR includes the following changes:
- Breaking network protocol change: The libp2p version has been upgraded to 0.53 which includes breaking network protocol changes. ASBs and CLIs will not be able to swap if one of them is on the old version.
- ASB: Transfer proofs will be repeatedly sent until they are acknowledged by the other party. This fixes a bug where it'd seem to Bob as if the Alice never locked the Monero. Forcing the swap to be refunded.
- CLI: Encrypted signatures will be repeatedly sent until they are acknowledged by the other party
- CLI+ASB: Libp2p network errors in request-response protocols are now propagated throught the event loop channels. This allows the caller to retry if an error occurs (e.g timeout)

Closes https://github.com/UnstoppableSwap/core/issues/101, https://github.com/UnstoppableSwap/core/issues/95
2024-11-11 00:14:42 +01:00
binarybaron
5bb33fe35d
fix(asb): Allow history command to be run while asb is running (#82)
This applies the following PRs from upstream to our fork:
* fix(asb): Allow history command to be run while asb is running (#1724)
* Allow history command to be executed while asb is running by opening database in read-only mode (#1722)

---------

Co-authored-by: einliterflasche <einliterflasche@pm.me>
Co-authored-by: Einliterflasche <81313171+Einliterflasche@users.noreply.github.com>
2024-09-17 17:32:21 +02:00
binarybaron
57c153de99
refactor(cli): Refactor RPC server and fix tests
- Use the Request trait introduced in https://github.com/UnstoppableSwap/xmr-btc-swap/pull/10 for the RPC server
- Delegate deserialization of RPC server method parameters to serde by using structs like BuyXmrArgs
- Remove `get_raw_states` RPC server method because it's not used
- Fix RPC server tests including removing test for the "log reference id" feature which was removed as part of https://github.com/UnstoppableSwap/xmr-btc-swap/pull/10
- Rename GetCurrentSwap struct to GetCurrentSwapArgs
2024-08-28 12:18:58 +02:00
binarybaron
dc3c937333 fix(swap): Unit test compilation errors 2024-08-26 18:03:04 +02:00
binarybaron
4939d63524
refactor(swap, tauri_bindings): Overhaul API architecture and introduce Tauri events
- Implement trait-based request handling in api/request.rs
- Add Tauri bindings and event system in api/tauri_bindings.rs
- Refactor CLI command parsing and execution in cli/command.rs
- Update RPC methods to use new request handling approach
- Emit Tauri events in swap/src/protocol/bob/swap.rs
- Add typescript type bindings use typeshare crate
2024-08-26 15:18:11 +02:00
binarybaron
709a2820c4
feat: cargo project at root 2024-08-08 00:49:04 +02:00