Added support for nostr:npub1v0lxxxxutpvrelsksy8cdhgfux9l6a42hsj2qzquu2zk7vc9qnkszrqj49's @snort/worker-relay package in #noStrudel, it runs a SQLite using WASM in a web worker 😀

Its not quite as fast as using the Indexeddb api but it doesn't make the browse freeze up as much. I have not tested it on mobile so I have no idea how well it will work.

You can find the package here https://git.v0l.io/Kieran/snort/src/branch/main/packages/worker-relay

And if your reading this nostr:npub1v0lxxxxutpvrelsksy8cdhgfux9l6a42hsj2qzquu2zk7vc9qnkszrqj49 there are a few improvements id like to see

- a way to delete specific events (base on a REQ filter) from the database

- a method for deleting the database out right

- the ability to stop the web worker and close the database

Right now there is no way to "manage" the database so it just keeps growing in size 😞

Changes are only on next.nostrudel.ninja for testing

Reply to this note

Please Login to reply.

Discussion

pls enable disabling all caches altogether

that would be a cool idea. although I think it would be better to build an in-memory cache. that way you could view stats (total events stored, kinds) but it would reset every time you open the app

pls, just enable disabling of all caching so set relays must be queried

this would be huge for relay devs in general and massive for me, set a price i'll pay it

disabling the cache is a little difficult because the whole app is built around the expectation that the cache exists. although it could be easier than I'm thinking to remove that requirement

if you make this possible i will zap you 14400 sats

remind me

i will double this at some point, don't mess with me

I would be afraid that many normies would find that option and try it out to never un-try it later, just increasing traffic for them and relays while creating support issues for OP.

on behalf of all the relay devs and back end devs in the universe, i wish to bid you a merry GFY

It looks like @nostr-relay/event-repository-sqlite could be helpful for you. It's the database implementation used by nostr-relay-tray. It allows for inserting events and finding events by a filter, and nostr:npub1rw7hlhmgat6ur9zxcw40vweem49guv6530yk767j8xjpynv0y20q6qsl3w is currently developing the filter deletion functionality. However, it's unclear if it can be directly used in a browser.🤣 Perhaps with some minor modifications, it could be made compatible.

Congrats all n Thanks also

keiran hzrd cody

Just tested this on mobile and its surprisingly faster than indexeddb... I was not expecting that

I did notice a few bugs with some notifications not showing though, so I've got to investigate that

nostr:nevent1qvzqqqqqqypzqfngzhsvjggdlgeycm96x4emzjlwf8dyyzdfg4hefp89zpkdgz99qqsggvamcy4z9ysguqnyvfvv35r3d4kp4xjuvukw4xvdltcjx8ldkeqc9k5eq

absolutely, this makes sense

Nice!