feat: gossip model

This commit is contained in:
2023-05-08 17:55:46 +01:00
parent 78bfa57628
commit 185e089ffd
11 changed files with 275 additions and 250 deletions

View File

@ -0,0 +1,18 @@
import { db, UsersRelays } from "Db";
import FeedCache from "./FeedCache";
class UsersRelaysCache extends FeedCache<UsersRelays> {
constructor() {
super("UserRelays", db.userRelays);
}
key(of: UsersRelays): string {
return of.pubkey;
}
takeSnapshot(): Array<UsersRelays> {
return [...this.cache.values()];
}
}
export const UserRelays = new UsersRelaysCache();