I'm trying to take a different path with my Nostr library stack. So far I've done the consensus layer for the Nostr protocol (roots) and the websocket message schema (roots-ws) in both go and typescript. And I'm working on the basic messaging library (honeybee). And as you need advanced features, the goal is to place them in separate libraries. And then you compose the parts you need into an app.

https://github.com/wisehodl/go-roots

https://github.com/wisehodl/go-roots-ws

Reply to this note

Please Login to reply.

Discussion

yeah, I like this approach. It's what I'm following already, but not at the same level of categorization

- library for data structures (now go-nostr, but not for long)

- relay framework = rely (was, messages, relay logic)

- database (nostr-sqlite)

In the future I'll be looking at replacing go-nostr, and this seems a good library for it.

Just a few comments:

1) ID, Pubkey, Sig imo should be specific types of [32]byte or [64]byte, all represented as string with the method Hex(). This would allow inspections of individual bytes which I think might be useful.

2) Filter.Limit, when unspecified I think it should be MaxInt, because an unspecified limit means "give me everything". Similar to Since and Until, this would allow to avoid pointer checks and simply using comparison operators.

if filter.Limit > 1000 {

filter.Limit = 1000

}