mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-22 20:01:06 -05:00
feat: Reliable Peer Discovery (#408)
* feat(swap): Allow discovery at multiple rendezvous points, request quotes from locally stored peers - Ensure uniqueness of the peer_addresses table (no duplicate entries) - Add peer to local database even if we just request a quote, and no swap (call to list_sellers) - Refactor list_sellers to take multiple rendezvous points - Allow db to be passed into list_sellers, if so request quote from all locally stored peers * feat: editable list of rendezvous points in settings, new maker box on help page * Recover old commits * fix small compile errors due to rebase * amend * fixes * fix(gui): Do not display "Core components are loading..." spinner * fix(gui): Prefer makers with m.minSwapAmount > 0 BTC * feat(cli, gui): Fetch version of maker * feat: display progress bar
This commit is contained in:
parent
686947e8dc
commit
4702bd5bf2
31 changed files with 1869 additions and 512 deletions
|
|
@ -43,13 +43,13 @@ import { CliLog } from "models/cliModel";
|
|||
import { logsToRawString, parseLogsFromString } from "utils/parseUtils";
|
||||
|
||||
export const PRESET_RENDEZVOUS_POINTS = [
|
||||
"/dns4/discover.unstoppableswap.net/tcp/8888/p2p/12D3KooWA6cnqJpVnreBVnoro8midDL9Lpzmg8oJPoAGi7YYaamE",
|
||||
"/dnsaddr/xxmr.cheap/p2p/12D3KooWMk3QyPS8D1d1vpHZoY7y2MnXdPE5yV6iyPvyuj4zcdxT",
|
||||
];
|
||||
|
||||
export async function fetchSellersAtPresetRendezvousPoints() {
|
||||
await Promise.all(
|
||||
PRESET_RENDEZVOUS_POINTS.map(async (rendezvousPoint) => {
|
||||
const response = await listSellersAtRendezvousPoint(rendezvousPoint);
|
||||
const response = await listSellersAtRendezvousPoint([rendezvousPoint]);
|
||||
store.dispatch(discoveredMakersByRendezvous(response.sellers));
|
||||
|
||||
logger.info(
|
||||
|
|
@ -206,10 +206,10 @@ export async function redactLogs(
|
|||
}
|
||||
|
||||
export async function listSellersAtRendezvousPoint(
|
||||
rendezvousPointAddress: string,
|
||||
rendezvousPointAddresses: string[],
|
||||
): Promise<ListSellersResponse> {
|
||||
return await invoke<ListSellersArgs, ListSellersResponse>("list_sellers", {
|
||||
rendezvous_point: rendezvousPointAddress,
|
||||
rendezvous_points: rendezvousPointAddresses,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue