feat: adjust default relay configuration
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { kinds } from 'nostr-tools'
|
||||
import { TMailboxRelay } from './types'
|
||||
|
||||
export const JUMBLE_API_BASE_URL = 'https://api.jumble.social'
|
||||
|
||||
@@ -63,22 +62,20 @@ export const ApplicationDataKey = {
|
||||
|
||||
export const BIG_RELAY_URLS = [
|
||||
'wss://relay.damus.io/',
|
||||
'wss://relay.nostr.band/',
|
||||
'wss://nos.lol/',
|
||||
'wss://relay.primal.net/',
|
||||
'wss://nos.lol/'
|
||||
'wss://offchain.pub/'
|
||||
]
|
||||
|
||||
export const SEARCHABLE_RELAY_URLS = ['wss://relay.nostr.band/', 'wss://search.nos.today/']
|
||||
export const SEARCHABLE_RELAY_URLS = [
|
||||
'wss://search.nos.today/',
|
||||
'wss://relay.ditto.pub/',
|
||||
'wss://relay.nostrcheck.me/',
|
||||
'wss://relay.nostr.band/'
|
||||
]
|
||||
|
||||
export const TRENDING_NOTES_RELAY_URLS = ['wss://trending.relays.land/']
|
||||
|
||||
export const NEW_USER_RELAY_LIST: TMailboxRelay[] = [
|
||||
{ url: 'wss://nos.lol/', scope: 'both' },
|
||||
{ url: 'wss://offchain.pub/', scope: 'both' },
|
||||
{ url: 'wss://relay.damus.io/', scope: 'both' },
|
||||
{ url: 'wss://nostr.mom/', scope: 'both' }
|
||||
]
|
||||
|
||||
export const GROUP_METADATA_EVENT_KIND = 39000
|
||||
|
||||
export const ExtendedKind = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import LoginDialog from '@/components/LoginDialog'
|
||||
import { ApplicationDataKey, BIG_RELAY_URLS, ExtendedKind, NEW_USER_RELAY_LIST } from '@/constants'
|
||||
import { ApplicationDataKey, BIG_RELAY_URLS, ExtendedKind } from '@/constants'
|
||||
import {
|
||||
createDeletionRequestDraftEvent,
|
||||
createFollowListDraftEvent,
|
||||
@@ -614,13 +614,14 @@ export function NostrProvider({ children }: { children: React.ReactNode }) {
|
||||
}
|
||||
|
||||
const setupNewUser = async (signer: ISigner) => {
|
||||
const relays = NEW_USER_RELAY_LIST.map((item) => item.url)
|
||||
await Promise.allSettled([
|
||||
client.publishEvent(relays, await signer.signEvent(createFollowListDraftEvent([]))),
|
||||
client.publishEvent(relays, await signer.signEvent(createMuteListDraftEvent([]))),
|
||||
client.publishEvent(BIG_RELAY_URLS, await signer.signEvent(createFollowListDraftEvent([]))),
|
||||
client.publishEvent(BIG_RELAY_URLS, await signer.signEvent(createMuteListDraftEvent([]))),
|
||||
client.publishEvent(
|
||||
relays.concat(BIG_RELAY_URLS),
|
||||
await signer.signEvent(createRelayListDraftEvent(NEW_USER_RELAY_LIST))
|
||||
BIG_RELAY_URLS,
|
||||
await signer.signEvent(
|
||||
createRelayListDraftEvent(BIG_RELAY_URLS.map((url) => ({ url, scope: 'both' })))
|
||||
)
|
||||
)
|
||||
])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user