I'm considering adding a "relay-set router" to NDK.

This would give developers the ability of providing certain policies to route both event fetching and publishing to a particular set of relays, overriding the default calculation. It could (or not) include in the information the router receives the selection that NDK has done, including what it wants to do per the outbox model.

I want to use it for an application that I'm making that creates certain kind of special events and with this I could create a router that says:

"whenever you fetch/publish kind XXX, send it to only these relays"

"whenever you fetch/publish kind 0, include PurplePages, otherwise don't include PurplePages"

Does anybody find this interesting or useful?

Reply to this note

Please Login to reply.

Discussion

Yes, these routing policies can definitely be very powerful in developing a consistent ux.

Yes šŸ’Æ I would also like to know per event, which relays it came from as well. Many client libraries lump all the events together and you can't tell where they came from... (not sure if ndk already does this I only use it with a single relay at a time so far..)

It does; each event has a relays property added to it

awesome!

Is this a new feature? I'm using ndk 2.1.1 and haven't see this.

This makes sense to me for kind-focused relays like your purplepages. So the routing depends on which kind of event needs to be broadcasted right? This will also incentify building more niche relays focused on handling one or more kinds really good (also decentralization will increase of the network imo)

Exactly what I’m thinking

Build it, I will test it for sure (with a own configured relay besides)! 😃

For me it makes sense too. I'm develooping an app for an organization using a specific kind and I can imagine publishing and reading just from an own relay set.