diff --git a/pkg/pipe/engine.go b/pkg/pipe/engine.go index a8b33b5..8f75e2f 100644 --- a/pkg/pipe/engine.go +++ b/pkg/pipe/engine.go @@ -89,7 +89,7 @@ func Archiver( switch { case nostr.IsRegularKind(event.Kind): - return store.Save(opctx, event) + return nil // do nothing case nostr.IsReplaceableKind(event.Kind): replaced, err := store.Replace(opctx, event) diff --git a/pkg/pipe/fetcher.go b/pkg/pipe/fetcher.go index 6434b35..4a34442 100644 --- a/pkg/pipe/fetcher.go +++ b/pkg/pipe/fetcher.go @@ -19,10 +19,7 @@ type FetcherConfig struct { func NewFetcherConfig() FetcherConfig { return FetcherConfig{ - Kinds: []int{ - nostr.KindProfileMetadata, - nostr.KindFollowList, - }, + Kinds: profileKinds, Relays: defaultRelays, Batch: 100, Interval: time.Minute, diff --git a/pkg/pipe/firehose.go b/pkg/pipe/firehose.go index bf8d479..64da286 100644 --- a/pkg/pipe/firehose.go +++ b/pkg/pipe/firehose.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "log" + "slices" "time" "github.com/nbd-wtf/go-nostr" @@ -40,6 +41,37 @@ var ( "wss://zap.watch", "wss://satsage.xyz", } + + contentKinds = []int{ + nostr.KindTextNote, + nostr.KindComment, + nostr.KindArticle, + 20, // Picture Event + 21, // Video Event + 22, // "Tik-Tok" Video Event + } + + engagementKinds = []int{ + nostr.KindReaction, + nostr.KindRepost, + nostr.KindGenericRepost, + nostr.KindZap, + nostr.KindNutZap, + } + + profileKinds = []int{ + nostr.KindProfileMetadata, + nostr.KindFollowList, + nostr.KindMuteList, + nostr.KindRelayListMetadata, + nostr.KindUserServerList, + } + + allKinds = slices.Concat( + contentKinds, + engagementKinds, + profileKinds, + ) ) type FirehoseConfig struct { @@ -50,10 +82,7 @@ type FirehoseConfig struct { func NewFirehoseConfig() FirehoseConfig { return FirehoseConfig{ - Kinds: []int{ - nostr.KindProfileMetadata, - nostr.KindFollowList, - }, + Kinds: allKinds, Relays: defaultRelays, Offset: time.Minute, }