Alright, now that I'm back home from Nostrica I'm working on Nostrocket again.

I've decide to refactor the state machine because it has been a bit unreliable.

I've also changed the architecture somewhat.

I originally built it like a stateful relay that clients can subscribe to and get the current state. But that turned out to be a bit unreliable because it needs to have a stable connection and also the state machine needs to *not* crash when someone hits it with malformed events etc.

So what I'm doing now is whenever state is changed (in response to an event) it republishes the state as a replaceable event.

So clients no longer need a direct connection to the nostrocket state machine, they only need to be on the same relay.

This also got me thinking. This architecture is pretty cool. It's like you are running a "web service" (for lack of s better term) behind a firewall.

You interact with the service using nostr events - changing "server side" state. When state changes, the "server" publishes an event with the new state. Perhaps for many use cases, we no longer need a large pipe to support popular web services. Great news if you want to compete with Google etc and don't have a gorillion dollars to pay for bandwidth.

I dunno, but I think I've stumbled on something cool here.

Reply to this note

Please Login to reply.

Discussion

No replies yet.