chore: remove nostr.watch

This commit is contained in:
Kieran 2023-11-05 11:40:57 +09:00
parent 4ccb052edb
commit 58e6be94fa
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 1 additions and 20 deletions

View File

@ -83,22 +83,7 @@ export async function generateNewLogin(system: SystemInterface, pin: (key: strin
const ent = generateBip39Entropy();
const entropy = utils.bytesToHex(ent);
const privateKey = entropyToPrivateKey(ent);
let newRelays: Record<string, RelaySettings> = {};
try {
const rsp = await fetch("https://api.nostr.watch/v1/online");
if (rsp.ok) {
const online: string[] = await rsp.json();
const pickRandom = randomSample(online, 4);
const relayObjects = pickRandom.map(a => [unwrap(sanitizeRelayUrl(a)), { read: true, write: true }]);
newRelays = {
...Object.fromEntries(relayObjects),
...Object.fromEntries(DefaultRelays.entries()),
};
}
} catch (e) {
console.warn(e);
}
const newRelays = Object.fromEntries(DefaultRelays.entries());
// connect to new relays
await Promise.all(Object.entries(newRelays).map(([k, v]) => system.ConnectToRelay(k, v)));

View File

@ -23,10 +23,6 @@ const DataProviders = [
name: "semisol.dev",
owner: bech32ToHex("npub12262qa4uhw7u8gdwlgmntqtv7aye8vdcmvszkqwgs0zchel6mz7s6cgrkj"),
},
{
name: "nostr.watch",
owner: bech32ToHex("npub1uac67zc9er54ln0kl6e4qp2y6ta3enfcg7ywnayshvlw9r5w6ehsqq99rx"),
},
{
name: "nostr.directory",
owner: bech32ToHex("npub1teawtzxh6y02cnp9jphxm2q8u6xxfx85nguwg6ftuksgjctvavvqnsgq5u"),