Eagerly generate nip29 admins and members lists

This commit is contained in:
Jon Staab
2025-10-30 13:43:37 -07:00
parent e76293c742
commit f375e70a42
3 changed files with 26 additions and 59 deletions
+1 -23
View File
@@ -1,26 +1,4 @@
`README.md` contains high-level project information.
`justfile` contains common commands.
## Codebase Overview
- **zooid/config.go**: Defines `Config` struct with TOML tags for relay configuration (self, groups, management, blossom, roles, data). Contains `LoadConfig()` function and `IsMember()` method.
- **zooid/http.go**: Simple HTTP handler that calls `GetInstance()` and delegates to khatru relay.
- **zooid/instance.go**: Core instance management. `Instance` struct holds config and khatru relay. `MakeInstance()` creates configured relay instances with handlers. `GetInstance()` provides singleton access with lazy loading.
- **zooid/blossom.go**: Blossom file storage integration with member-only access controls.
- **zooid/util.go**: Environment variable utilities with `Env()` function.
- **cmd/relay/main.go**: HTTP server entry point with graceful shutdown.
## SQLite EventStore
The `sqlite/` directory contains a complete SQLite-based khatru eventstore implementation.
### nostrlib API Compatibility
- `Event.Sig` is `[64]byte`, not a separate Signature type
- `Event.CreatedAt` is `nostr.Timestamp` (int64), not `time.Time`
- Use `hex.EncodeToString(evt.Sig[:])` for signature serialization
- Use `hex.DecodeString()` and `copy()` for signature parsing
On startup, run `tree zooid` to get an understanding of the structure of the codebase.