1.3.1 • Published 7 days ago
@snort/system v1.3.1
@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";
// Singleton instance to store all connections and access query fetching system
const System = new NostrSystem({});
(async () => {
// Setup cache system
await System.Init();
// connec to one "bootstrap" relay to pull profiles/relay lists from
// also used as a fallback relay when gossip model doesnt know which relays to pick, or "authors" are not provided in the request
await System.ConnectToRelay("wss://relay.snort.social", { read: true, write: false });
// ID should be unique to the use case, this is important as all data fetched from this ID will be merged into the same NoteStore
const rb = new RequestBuilder("get-posts");
rb.withFilter()
.authors(["63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed"]) // Kieran pubkey
.kinds([1])
.limit(10);
const q = System.Query(rb);
// basic usage using "onEvent", fired every 100ms
q.on("event", evs => {
console.log(evs);
// something else..
});
})();
1.3.1
7 days ago
1.3.0
7 days ago
1.2.12
2 months ago
1.2.10
3 months ago
1.2.11
3 months ago
1.2.9
3 months ago
1.2.8
3 months ago
1.2.7
3 months ago
1.2.6
3 months ago
1.2.5
3 months ago
1.2.4
3 months ago
1.2.3
3 months ago
1.2.2
3 months ago
1.2.1
3 months ago
1.2.0
4 months ago
1.1.8
5 months ago
1.1.7
5 months ago
1.1.6
5 months ago
1.1.5
5 months ago
1.1.4
6 months ago
1.1.3
6 months ago
1.1.2
6 months ago
1.1.1
6 months ago
1.1.0
6 months ago
1.0.22
7 months ago
1.0.21
8 months ago
1.0.20
8 months ago
1.0.19
8 months ago
1.0.18
8 months ago
1.0.17
9 months ago
1.0.16
10 months ago
1.0.15
10 months ago
1.0.14
10 months ago
1.0.13
11 months ago
1.0.12
11 months ago
1.0.11
11 months ago
1.0.10
11 months ago
1.0.9
11 months ago
1.0.8
11 months ago
1.0.7
11 months ago
1.0.6
11 months ago
1.0.5
11 months ago
1.0.4
11 months ago
1.0.3
11 months ago
1.0.2
11 months ago
1.0.1
11 months ago
1.0.0
11 months ago