From cd2489b8651cc6cf5b2f5ecc00c616da43b6200c Mon Sep 17 00:00:00 2001 From: Silberengel Date: Fri, 16 Jan 2026 18:46:49 +0100 Subject: [PATCH] add orly and newsroom localhost port remove nostr.band get rid of individual relay settings --- TECHNIQUE-create-test-highlights.md | 3 +-- check-publication-structure.js | 2 +- create-test-comments.js | 10 ++++------ create-test-highlights.js | 10 ++++------ src/lib/components/util/Profile.svelte | 2 ++ src/lib/consts.ts | 4 ++-- src/lib/utils/mockCommentData.ts | 15 +++++++++------ src/lib/utils/mockHighlightData.ts | 8 ++++++-- src/lib/utils/websocket_utils.ts | 5 +++-- 9 files changed, 32 insertions(+), 27 deletions(-) diff --git a/TECHNIQUE-create-test-highlights.md b/TECHNIQUE-create-test-highlights.md index d3e1bbd..b628b0e 100644 --- a/TECHNIQUE-create-test-highlights.md +++ b/TECHNIQUE-create-test-highlights.md @@ -47,7 +47,7 @@ const rootAddress = `${data.kind}:${data.pubkey}:${data.identifier}`; console.log("\nRoot Address:", rootAddress); // Fetch the index event to see what sections it references -const relay = "wss://relay.nostr.band"; +const relay = "wss://thecitadel.nostr1.com"; async function fetchPublication() { return new Promise((resolve, reject) => { @@ -172,7 +172,6 @@ const sections = [ // Relays to publish to (matching HighlightLayer's relay list) const relays = [ "wss://relay.damus.io", - "wss://relay.nostr.band", "wss://nostr.wine", ]; diff --git a/check-publication-structure.js b/check-publication-structure.js index 3948a9f..cb5e2ea 100644 --- a/check-publication-structure.js +++ b/check-publication-structure.js @@ -13,7 +13,7 @@ const rootAddress = `${data.kind}:${data.pubkey}:${data.identifier}`; console.log("\nRoot Address:", rootAddress); // Fetch the index event to see what sections it references -const relay = "wss://relay.nostr.band"; +const relay = "wss://thecitadel.nostr1.com"; async function fetchPublication() { return new Promise((resolve, reject) => { diff --git a/create-test-comments.js b/create-test-comments.js index bae0f1b..99b38eb 100644 --- a/create-test-comments.js +++ b/create-test-comments.js @@ -1,5 +1,7 @@ import { finalizeEvent, generateSecretKey, getPublicKey } from "nostr-tools"; import WebSocket from "ws"; +import { activeInboxRelays } from "./src/lib/ndk.ts"; +import { secondaryRelays } from "./src/lib/consts.ts"; // Test user keys (generate fresh ones) const testUserKey = generateSecretKey(); @@ -25,12 +27,8 @@ const sections = [ `30041:${publicationPubkey}:the-persistent-escape-of-knowledge`, ]; -// Relays to publish to (matching CommentLayer's relay list) -const relays = [ - "wss://relay.damus.io", - "wss://relay.nostr.band", - "wss://nostr.wine", -]; +// Relays to publish to - should match src/lib/consts.ts relay constants +const relays = [...secondaryRelays, ...activeInboxRelays]; // Test comments to create const testComments = [ diff --git a/create-test-highlights.js b/create-test-highlights.js index b5acc66..4b97965 100644 --- a/create-test-highlights.js +++ b/create-test-highlights.js @@ -1,5 +1,7 @@ import { finalizeEvent, generateSecretKey, getPublicKey } from "nostr-tools"; import WebSocket from "ws"; +import { activeInboxRelays } from "./src/lib/ndk.ts"; +import { secondaryRelays } from "./src/lib/consts.ts"; // Test user keys (generate fresh ones) const testUserKey = generateSecretKey(); @@ -25,12 +27,8 @@ const sections = [ `30041:${publicationPubkey}:the-persistent-escape-of-knowledge`, ]; -// Relays to publish to (matching HighlightLayer's relay list) -const relays = [ - "wss://relay.damus.io", - "wss://relay.nostr.band", - "wss://nostr.wine", -]; +// Relays to publish to - should match src/lib/consts.ts relay constants +const relays = [...secondaryRelays, ...activeInboxRelays]; // Test highlights to create // AI-NOTE: Kind 9802 highlight events contain the actual highlighted text in .content diff --git a/src/lib/components/util/Profile.svelte b/src/lib/components/util/Profile.svelte index 9d3f1fd..8a57edd 100644 --- a/src/lib/components/util/Profile.svelte +++ b/src/lib/components/util/Profile.svelte @@ -298,6 +298,8 @@ isLoadingExtension = false; try { const ndk = new NDK(); + // AI-NOTE: relay.nsec.app is the specific relay for Amber/NIP-46 signer service + // This is service-specific and not a general-purpose relay, so it remains hard-coded const relay = "wss://relay.nsec.app"; const localNsec = localStorage.getItem("amber/nsec") ?? diff --git a/src/lib/consts.ts b/src/lib/consts.ts index e0224b1..a3de298 100644 --- a/src/lib/consts.ts +++ b/src/lib/consts.ts @@ -11,12 +11,11 @@ export const communityRelays = [ ]; export const searchRelays = [ - "wss://profiles.nostr1.com", + "wss://thecitadel.nostr1.com", "wss://aggr.nostr.land", "wss://relay.noswhere.com", "wss://nostr.wine", "wss://relay.damus.io", - "wss://relay.nostr.band", "wss://freelay.sovbit.host", ]; @@ -46,6 +45,7 @@ export const localRelays: string[] = [ "ws://localhost:8080", "ws://localhost:4869", "ws://localhost:3334", + "ws://localhost:7777" ]; export enum FeedType { diff --git a/src/lib/utils/mockCommentData.ts b/src/lib/utils/mockCommentData.ts index 4bdb19a..835c195 100644 --- a/src/lib/utils/mockCommentData.ts +++ b/src/lib/utils/mockCommentData.ts @@ -1,5 +1,6 @@ import { NDKEvent } from "@nostr-dev-kit/ndk"; import type NDK from "@nostr-dev-kit/ndk"; +import { secondaryRelays } from "../consts.ts"; /** * Generate mock comment data for testing comment UI and threading @@ -49,18 +50,20 @@ function createMockComment( replyToId?: string, replyToAuthor?: string, ): any { + // Use first search relay from constants instead of hard-coded relay + const relayUrl = secondaryRelays[0] || "wss://thecitadel.nostr1.com"; const tags: string[][] = [ - ["A", targetAddress, "wss://relay.damus.io", pubkey], + ["A", targetAddress, relayUrl, pubkey], ["K", "30041"], - ["P", pubkey, "wss://relay.damus.io"], - ["a", targetAddress, "wss://relay.damus.io"], + ["P", pubkey, relayUrl], + ["a", targetAddress, relayUrl], ["k", "30041"], - ["p", pubkey, "wss://relay.damus.io"], + ["p", pubkey, relayUrl], ]; if (replyToId && replyToAuthor) { - tags.push(["e", replyToId, "wss://relay.damus.io", "reply"]); - tags.push(["p", replyToAuthor, "wss://relay.damus.io"]); + tags.push(["e", replyToId, relayUrl, "reply"]); + tags.push(["p", replyToAuthor, relayUrl]); } // Return a plain object that matches NDKEvent structure diff --git a/src/lib/utils/mockHighlightData.ts b/src/lib/utils/mockHighlightData.ts index 950762e..b76ce10 100644 --- a/src/lib/utils/mockHighlightData.ts +++ b/src/lib/utils/mockHighlightData.ts @@ -1,3 +1,5 @@ +import { secondaryRelays } from "../consts.ts"; + /** * Generate mock highlight data (kind 9802) for testing highlight UI * Creates realistic highlight events with context and optional annotations @@ -76,10 +78,12 @@ function createMockHighlight( offsetStart?: number, offsetEnd?: number, ): any { + // Use first search relay from constants instead of hard-coded relay + const relayUrl = secondaryRelays[0] || "wss://thecitadel.nostr1.com"; const tags: string[][] = [ - ["a", targetAddress, "wss://relay.damus.io"], + ["a", targetAddress, relayUrl], ["context", context], - ["p", authorPubkey, "wss://relay.damus.io", "author"], + ["p", authorPubkey, relayUrl, "author"], ]; // Add optional annotation diff --git a/src/lib/utils/websocket_utils.ts b/src/lib/utils/websocket_utils.ts index 43d2025..b5ab129 100644 --- a/src/lib/utils/websocket_utils.ts +++ b/src/lib/utils/websocket_utils.ts @@ -92,8 +92,9 @@ export async function fetchNostrEvent( const { searchRelays, secondaryRelays } = await import("../consts.ts"); availableRelays = [...searchRelays, ...secondaryRelays]; - if (availableRelays.length === 0) { - availableRelays = ["wss://thecitadel.nostr1.com"]; + // Final fallback: use first secondary relay if all else fails + if (availableRelays.length === 0 && secondaryRelays.length > 0) { + availableRelays = [secondaryRelays[1]]; } }