feat(gui): Connect to preset rendezvous nodes at startup (#162)

This commit is contained in:
binarybaron 2024-11-14 17:04:27 +01:00 committed by GitHub
parent 7ebe59bc8d
commit 163f6fa94d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 37 additions and 19 deletions

View file

@ -48,6 +48,21 @@ import logger from "utils/logger";
import { getNetwork, getNetworkName, isTestnet } from "store/config";
import { Blockchain } from "store/features/settingsSlice";
import { setStatus } from "store/features/nodesSlice";
import { discoveredProvidersByRendezvous } from "store/features/providersSlice";
export const PRESET_RENDEZVOUS_POINTS = [
"/dns4/discover.unstoppableswap.net/tcp/8888/p2p/12D3KooWA6cnqJpVnreBVnoro8midDL9Lpzmg8oJPoAGi7YYaamE",
];
export async function fetchSellersAtPresetRendezvousPoints() {
await Promise.all(PRESET_RENDEZVOUS_POINTS.map(async (rendezvousPoint) => {
const response = await listSellersAtRendezvousPoint(rendezvousPoint);
store.dispatch(discoveredProvidersByRendezvous(response.sellers));
console.log(`Discovered ${response.sellers.length} sellers at rendezvous point ${rendezvousPoint} during startup fetch`);
}),
);
}
export async function initEventListeners() {
// This operation is in-expensive