diff --git a/src/db.ts b/src/db.ts deleted file mode 100644 index 022a952..0000000 --- a/src/db.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { lmdb } from '@/deps.ts'; - -const db = lmdb.open('db', {}); - -const gossipDB = db.openDB('gossip', { dupSort: true }); - -export { db, gossipDB }; diff --git a/src/deps.ts b/src/deps.ts index 27c051e..e12e028 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -18,4 +18,3 @@ export { nip21, signEvent as getSignature, } from 'npm:nostr-tools@^1.10.1'; -export { default as lmdb } from 'npm:lmdb'; diff --git a/src/gossip.ts b/src/gossip.ts deleted file mode 100644 index b5d8bbb..0000000 --- a/src/gossip.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { type Event } from '@/event.ts'; - -import { parseRelay } from './schema.ts'; - -/** Gets relays which pertain to the author from the event. */ -function getAuthorRelays(event: Event): URL[] { - const relays: string[] = []; - - switch (event.kind) { - case 10002: - event.tags.forEach((tag) => tag[0] === 'r' && relays.push(tag[1])); - break; - case 2: - relays.push(event.content); - break; - } - - return relays.map(parseRelay).filter((r): r is URL => !!r); -} - -export { getAuthorRelays }; diff --git a/src/query.ts b/src/query.ts deleted file mode 100644 index 4b4d062..0000000 --- a/src/query.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Filter } from '@/deps.ts'; - -function query(_filter: Filter, _relays?: URL[]) { - // TODO -} - -export { query };