@snort/system
A collection of caching and querying techniquies used by https://snort.social to serve all content from the nostr protocol.
Simple example:
import { NostrSystem, RequestBuilder, StoreSnapshot, NoteCollection } from "@snort/system";
const System = new NostrSystem({});
(async () => {
await System.Init();
await System.ConnectToRelay("wss://relay.snort.social", { read: true, write: false });
const rb = new RequestBuilder("get-posts");
rb.withFilter()
.authors(["63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed"])
.kinds([1])
.limit(10);
const q = System.Query(rb);
q.on("event", evs => {
console.log(evs);
});
})();