import { NDKKind } from '@nostr-dev-kit/ndk'; import * as Collapsible from '@radix-ui/react-collapsible'; import { appConfigDir } from '@tauri-apps/api/path'; import { invoke } from '@tauri-apps/api/primitives'; import { useEffect, useState } from 'react'; import { toast } from 'sonner'; import { DepotContactCard } from '@app/depot/components/contact'; import { DepotMembers } from '@app/depot/components/members'; import { DepotProfileCard } from '@app/depot/components/profile'; import { DepotRelaysCard } from '@app/depot/components/relays'; import { useArk } from '@libs/ark'; import { ChevronDownIcon, DepotIcon, GossipIcon } from '@shared/icons'; export function DepotScreen() { const ark = useArk(); const [dataPath, setDataPath] = useState(''); const [tunnelUrl, setTunnelUrl] = useState(''); const openFolder = async () => { await invoke('show_in_folder', { path: dataPath + '/nostr.db', }); }; const updateRelayList = async () => { try { if (tunnelUrl.length < 1) return toast.info('Please enter a valid relay url'); if (!tunnelUrl.startsWith('ws')) return toast.info('Please enter a valid relay url'); const relayUrl = new URL(tunnelUrl.replace(/\s/g, '')); if (!/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/.test(relayUrl.host)) return; const relayEvent = await ark.getEventByFilter({ filter: { authors: [ark.account.pubkey], kinds: [NDKKind.RelayList] }, }); let publish: { id: string; seens: string[] }; if (!relayEvent) { publish = await ark.createEvent({ kind: NDKKind.RelayList, tags: [['r', tunnelUrl, '']], }); } const newTags = relayEvent.tags ?? []; newTags.push(['r', tunnelUrl, '']); publish = await ark.createEvent({ kind: NDKKind.RelayList, tags: newTags, }); if (publish) { await ark.createSetting('tunnel_url', tunnelUrl); toast.success('Update relay list successfully.'); setTunnelUrl(''); } } catch (e) { console.error(e); toast.error('Error'); } }; useEffect(() => { async function loadConfig() { const appDir = await appConfigDir(); setDataPath(appDir); } loadConfig(); }, []); return (

Depot is running

Relay URL
ws://localhost:6090
Database

nostr.db (SQLite)

Actions

Expose

Make your Depot visible in the Internet, everyone can connect into it.

ngrok

Cloudflare Tunnel

Local Tunnel

Support Gossip Model (Recommended)

By adding to Relay List, other Nostr Client which support Gossip Model will automatically connect to your Depot and improve the discoverability.

setTunnelUrl(e.target.value)} spellCheck={false} placeholder="wss://" className="h-10 flex-1 rounded-lg border-transparent bg-neutral-100 px-3 placeholder:text-neutral-500 focus:border-blue-500 focus:ring focus:ring-blue-200 dark:bg-neutral-900 dark:placeholder:text-neutral-400 dark:focus:ring-blue-800" />

Backup (Recommended)

Backup all your data to Depot, it always live on your machine.

); }