Skip to content

Commit

Permalink
Merge pull request #73 from bitvora/dev-updateEventStore
Browse files Browse the repository at this point in the history
update to latest fiatjaf eventstore
  • Loading branch information
barrydeen authored Sep 30, 2024
2 parents c5e9843 + 7f7b2c0 commit ccb6af8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ require (
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fasthttp/websocket v1.5.7 // indirect
github.com/fiatjaf/eventstore v0.8.3-0.20240913011328-1196fabb86f2 // indirect
github.com/fiatjaf/eventstore v0.10.2-0.20240930205256-591734679cc4 // indirect
github.com/fiatjaf/khatru v0.8.2-0.20240913013357-18fc0dc1dd58 // indirect
github.com/fiatjaf/merge-sorted-slices v0.0.5 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.4.0 // indirect
Expand All @@ -33,7 +34,7 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/nbd-wtf/go-nostr v0.35.1-0.20240912000534-64c6057c08ec // indirect
github.com/nbd-wtf/go-nostr v0.38.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/puzpuzpuz/xsync/v3 v3.4.0 // indirect
github.com/rs/cors v1.7.0 // indirect
Expand All @@ -44,7 +45,7 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.51.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sys v0.25.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ github.com/fiatjaf/eventstore v0.8.2 h1:nCa3UuJNV5Y5t+SDoPQe7PBmKJ6dhm9TQ/WyR4SC
github.com/fiatjaf/eventstore v0.8.2/go.mod h1:ck3RxufitHUBjID1RLcRxfX+NMywQzMsdfNpSt6m+9U=
github.com/fiatjaf/eventstore v0.8.3-0.20240913011328-1196fabb86f2 h1:eb4kt20dn2bQFGIUFNlF9O+nWO37s89gz2PTa/o40kk=
github.com/fiatjaf/eventstore v0.8.3-0.20240913011328-1196fabb86f2/go.mod h1:ck3RxufitHUBjID1RLcRxfX+NMywQzMsdfNpSt6m+9U=
github.com/fiatjaf/eventstore v0.10.2-0.20240930205256-591734679cc4 h1:AIEs4YIpsRVXZ2s/u6FC5m2Tsu/DB+6KG5mAdY+X3yE=
github.com/fiatjaf/eventstore v0.10.2-0.20240930205256-591734679cc4/go.mod h1:y09rOcMyKURaV07sHoC1Dj68ZLqk7zabsPgduEUgf84=
github.com/fiatjaf/khatru v0.8.0 h1:hofUi4qbSqkJiKD4rC9EyNdi9obzBvp3ykJOBxuu/h8=
github.com/fiatjaf/khatru v0.8.0/go.mod h1:jRmqbbIbEH+y0unt3wMUBwqY/btVussqx5SmBoGhXtg=
github.com/fiatjaf/khatru v0.8.1 h1:BWAZqwuT0272ZlyzPkuqAA0eGBOs5G3u0Dn1tlWrm6Q=
Expand All @@ -61,6 +63,8 @@ github.com/fiatjaf/khatru v0.8.2-0.20240912020201-6d827ac89ae6 h1:Ad1Z2+CM0zbp40
github.com/fiatjaf/khatru v0.8.2-0.20240912020201-6d827ac89ae6/go.mod h1:jRmqbbIbEH+y0unt3wMUBwqY/btVussqx5SmBoGhXtg=
github.com/fiatjaf/khatru v0.8.2-0.20240913013357-18fc0dc1dd58 h1:F5Cy44IzxeIhzY8bf34rnORw0pYn6ZT/pIuyMO02Kjs=
github.com/fiatjaf/khatru v0.8.2-0.20240913013357-18fc0dc1dd58/go.mod h1:jRmqbbIbEH+y0unt3wMUBwqY/btVussqx5SmBoGhXtg=
github.com/fiatjaf/merge-sorted-slices v0.0.5 h1:Mmt3TdONTnhp3F4YHN/Uta8tFOm5RhBhdzuLEucStAw=
github.com/fiatjaf/merge-sorted-slices v0.0.5/go.mod h1:k7H3l+OhO2m/PA99FdBjF29Z0TAwRClgKA9PvoT6obY=
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
Expand Down Expand Up @@ -122,6 +126,8 @@ github.com/nbd-wtf/go-nostr v0.34.15 h1:InUaCM3Mw20U3hyoZBpY39LELHBmMa4bK81iGCY5
github.com/nbd-wtf/go-nostr v0.34.15/go.mod h1:NZQkxl96ggbO8rvDpVjcsojJqKTPwqhP4i82O7K5DJs=
github.com/nbd-wtf/go-nostr v0.35.1-0.20240912000534-64c6057c08ec h1:83Ce39kWnvq6VgfMKSMtcbwBcSmnab2VDX+tlKWZuqo=
github.com/nbd-wtf/go-nostr v0.35.1-0.20240912000534-64c6057c08ec/go.mod h1:RNovrTNC8aQNqkwfdX6y4thxHN3zueewqyZoSiDBaQY=
github.com/nbd-wtf/go-nostr v0.38.1 h1:D0moEtIpjhWs2zbgeRyokA4TOLzBdumtpL1/O7/frww=
github.com/nbd-wtf/go-nostr v0.38.1/go.mod h1:TGKGj00BmJRXvRe0LlpDN3KKbELhhPXgBwUEhzu3Oq0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down Expand Up @@ -172,6 +178,8 @@ golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk=
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk=
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func refreshTrustNetwork(ctx context.Context, relay *khatru.Relay) {

filters := []nostr.Filter{{
Authors: []string{config.RelayPubkey},
Kinds: []int{nostr.KindContactList},
Kinds: []int{nostr.KindFollowList},
}}

log.Println("🔍 fetching owner's follows")
Expand All @@ -303,7 +303,7 @@ func refreshTrustNetwork(ctx context.Context, relay *khatru.Relay) {

filters = []nostr.Filter{{
Authors: oneHopNetwork[i:end],
Kinds: []int{nostr.KindContactList, nostr.KindRelayListMetadata, nostr.KindProfileMetadata},
Kinds: []int{nostr.KindFollowList, nostr.KindRelayListMetadata, nostr.KindProfileMetadata},
}}

for ev := range pool.SubManyEose(timeout, seedRelays, filters) {
Expand Down Expand Up @@ -389,7 +389,7 @@ func archiveTrustedNotes(ctx context.Context, relay *khatru.Relay) {
Kinds: []int{
nostr.KindArticle,
nostr.KindDeletion,
nostr.KindContactList,
nostr.KindFollowList,
nostr.KindEncryptedDirectMessage,
nostr.KindMuteList,
nostr.KindReaction,
Expand All @@ -405,7 +405,7 @@ func archiveTrustedNotes(ctx context.Context, relay *khatru.Relay) {
Kinds: []int{
nostr.KindArticle,
nostr.KindDeletion,
nostr.KindContactList,
nostr.KindFollowList,
nostr.KindEncryptedDirectMessage,
nostr.KindMuteList,
nostr.KindRelayListMetadata,
Expand Down Expand Up @@ -472,7 +472,7 @@ func deleteOldNotes(relay *khatru.Relay) error {
Kinds: []int{
nostr.KindArticle,
nostr.KindDeletion,
nostr.KindContactList,
nostr.KindFollowList,
nostr.KindEncryptedDirectMessage,
nostr.KindMuteList,
nostr.KindReaction,
Expand Down

0 comments on commit ccb6af8

Please sign in to comment.