Any Nostr relay’s architected around a middleware pattern?

Basically new commands or extensions could just be new middleware that’s optionally enabled.

Useful for things like whitelists, spam filtering, relay memberships, new relay commands (like AUTH or POW), caching, etc.

Reply to this note

Please Login to reply.

Discussion

Strfry recently released write policy plugins that allow a lot of customizability, but only for writes at this time. I suppose it could be extended to REQs too.

https://github.com/hoytech/strfry/blob/beta/docs/plugins.md

Also the rust relay implementation does something similar with gRPC now.

Thanks. I’ve seen these. I’m thinking for all commands, as I expect the list will grow too.

What I find interesting is how relays are tending toward common Webserver patterns. Kind of makes sense, but lots of other protocols didn’t.

What’s most interesting however, is with that kind of pattern, it accelerates innovation and modularity. Could be a key architecture change that drives the next generation of Nostr relays.