| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
WebSocket handler:
- NIP-01 protocol (EVENT, REQ, CLOSE, OK, EOSE, NOTICE)
- JSON envelope parsing
- Shares subscription manager with gRPC (unified event fan-out)
- Standard Nostr client compatibility
Relay now serves dual protocols:
- gRPC on :50051 (binary, high performance)
- WebSocket on :8080 (JSON, Nostr standard)
Both protocols share:
- Same storage layer
- Same subscription manager
- Same validation logic
Compatible with all Nostr clients!
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Subscription manager:
- Track active subscriptions across connections
- Filter matching with full NIP-01 support
- Event fan-out to matching subscribers
Subscribe RPC:
- Query stored events (past)
- Stream them to client
- Keep stream open for new events (real-time)
- Auto-generate subscription ID if not provided
PublishEvent now:
- Stores event
- Notifies all matching active subscriptions
- Streams to gRPC clients in real-time
4 new tests, all 41 tests passing
|
| |
|
|
|
|
|
|
|
|
|
| |
Handler implementation:
- EventStore interface (consumer-side)
- Server with PublishEvent, QueryEvents, CountEvents, PublishBatch
- pb.Event <-> nostr.Event conversion helpers
- Signature and ID validation using existing nostr package
- Canonical JSON generation for storage
9 tests passing
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Query implementation:
- QueryEvents method with filter support
- Full NIP-01 filter support (ids, authors, kinds, tags, since, until, limit)
- ID and pubkey prefix matching
- Tag filtering using SQLite JSON functions
- Multiple filter UNION support
- DESC ordering by created_at
- Optional canonical JSON inclusion
23 tests passing, 1322 total lines
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Storage implementation:
- Concrete type with constructor (consumer-side interfaces)
- Event storage: protobuf + zstd-compressed canonical JSON
- Schema: events, deletions, replaceable_events, auth_challenges, rate_limits
- WAL mode, STRICT typing, optimized indexes
- Methods: StoreEvent, GetEvent, GetEventWithCanonical, DeleteEvent
Dependencies:
- modernc.org/sqlite v1.45.0 (pure Go SQLite driver)
- github.com/klauspost/compress v1.18.4 (zstd compression)
366 lines, 10 tests passing
|
| |
|