This is cool. Im interested more how this works at a high level. Do you have a local relay that then talks with all the other relays specified by the user? So note deck simply queries the local relay and as things come in from other relays they are shown?

Reply to this note

Please Login to reply.

Discussion

You create subscriptions on nostrdb, but they are just threadsafe queues of pointers to binary notes in the db instead of json and websockets and all that.

The idea is that you create remote subscriptions like normal, but the results of those subscriptions are only dumped into nostrdb.

nostrdb has a super efficient de-duping threadpool note processor. Any new incoming note matching a local subscription will be pushed to the subscription queues. They can be then polled or you can register a callback.

You can even do privacy stuff like open a remote global filter, and have local subscriptions that try to match notes without leaking any queries on the relay. This is a bit more bandwidth intensive of course.

Very interesting. Right now for Seer Im using SwiftData as the backing local db. Connections and subs are created like normal and then pushed into it. Locally I have live queries to SwiftData. It's actually working well so far, but I haven't really been able to stress it with data yet. So we will see... 😅