I know we don't talk too much about NIP-45 (Event Counts) anymore because its not very useful to get a count of events from a public relay. but what about a personal local cache relay? I'd like to easily count the number of followers, likes, reactions, etc from by local relay

nostr:npub1syjmjy0dp62dhccq3g97fr87tngvpvzey08llyt6ul58m2zqpzps9wf6wl would this be hard to add to nostr-relay-tray?

Reply to this note

Please Login to reply.

Discussion

The worker relay supports count, have you tried?

I think I implemented it into the relay interface I built around it but didn't use it yet. I'll use it to test though

Also it's been working great on mobile, I've managed to get up to 80k events with no issues or slowdown.

Just need a way to prune the database so I can limit it at 80k

Damn thats a lot, i have about 50k and its slow for me at startup especially, what phone do you have?

I think i will implement a special DELETE verb which takes a filter, then you can delete specific kinds / date ranges whatever you want

just running a pixel 4a with the default browser

Having just recently been crafting some nostr queries, is this type of query something that's even possible without querying *all follow lists, parsing them to see if your name is there, and counting? Ie, can a req even do it, or is it just doom because of positional arrays and such?

Ya, I'm a noob at nostr reqs.. because so far I hadn't needed to learn them.

This feature is relatively easy to implement for personal relays. I have 300k events locally and the count query is still very fast. I've simply implemented it, you can give it a try. Btw, the results of queries with multiple filtering conditions are inaccurate. I simply add up the results of each filtering condition.

https://github.com/CodyTseng/nostr-relay-tray/pull/11