PrimalHQ / primal-caching-service

Primal’s caching service for Nostr connects to the specified set of relays, collects all events in real time, stores them locally, and makes them available to nostr clients through a web socket-based API.
https://primal.net
MIT License
85 stars 13 forks source link

Add filters to fetcher #22

Open abhay-raizada opened 5 months ago

abhay-raizada commented 5 months ago

Hello Team,

It'd be great to have an optional feature to fetch events only based on specified filters instead of fetching everything on nostr, it would enable the caching service to be hosted on smaller hosts, and only for usecase specific tasks, IMO it would make it very versatile.

Are there any plans to do this? I can help contribute to this area as well.

pritk commented 5 months ago

hi, filters for fetching are specified here:

https://github.com/PrimalHQ/primal-caching-service/blob/ef7d38933885dc25b0121f725de980c56e78052e/src/fetching.jl#L110-L111

abhay-raizada commented 5 months ago

yes, but this is only author right? do you mean i can add new filters here?

pritk commented 5 months ago

yes, this is place in code where you can add different filters if you want.