increased and organized event kinds

Archiver stopped saving regular events
This commit is contained in:
pippellia-btc
2025-09-15 14:04:26 +02:00
parent 938dd09c58
commit 416e735552
3 changed files with 35 additions and 9 deletions

View File

@@ -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)

View File

@@ -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,

View File

@@ -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,
}