summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-02-13 17:50:30 -0800
committerbndw <ben@bdw.to>2026-02-13 17:50:30 -0800
commitd1a6b2ed2cc3e1f21d214ae54a14f6553d1b17b7 (patch)
tree2262c4b0f0a814492081234121f6a8e0fdabe7d8 /README.md
parente3b336ab45a6acf8a02a8c0f1b6d22fb3a320826 (diff)
docs: add README with quick start guide
Diffstat (limited to 'README.md')
-rw-r--r--README.md99
1 files changed, 99 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f3d961a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,99 @@
1# nostr-grpc
2
3A high-performance Nostr relay with gRPC and WebSocket support.
4
5## Features
6
7- **gRPC-first**: Binary protobuf storage with gRPC API
8- **SQLite storage**: WAL mode, optimized indexes
9- **Event validation**: Signature and ID verification
10- **Nostr compatible**: NIP-01 compliant
11
12## Quick Start
13
14### Build
15
16```bash
17make build # Build relay
18make build-client # Build test client
19make build-all # Build both
20```
21
22### Run the Relay
23
24```bash
25./bin/relay
26# or with custom settings:
27./bin/relay -grpc-addr :50051 -db relay.db
28```
29
30The relay will start listening on `:50051` (gRPC).
31
32### Test with Client
33
34```bash
35# In another terminal:
36./bin/testclient
37
38# Output:
39# Generated key: npub1...
40# Publishing event...
41# ✓ Event published successfully: abc123...
42# Querying events...
43# Found 1 events
44# - abc123...: Hello from gRPC client!
45```
46
47## gRPC API
48
49See [proto/nostr/v1/nostr.proto](proto/nostr/v1/nostr.proto) for the full API.
50
51### Available RPCs
52
53- `PublishEvent` - Publish a single event (with validation)
54- `PublishBatch` - Publish multiple events
55- `QueryEvents` - Query events with filters (paginated)
56- `CountEvents` - Count events matching filters
57- `Subscribe` - Stream events (not implemented yet)
58- `Unsubscribe` - Close subscription (not implemented yet)
59
60## Current Status
61
62**Phase 1: Core Relay**
63- ✅ SQLite storage with binary-first design
64- ✅ Event validation (ID, signature)
65- ✅ gRPC publish/query API
66- ⏳ Subscribe/streaming (in progress)
67- ⏳ WebSocket server (planned)
68
69## Development
70
71```bash
72make proto # Regenerate protobuf code
73make test # Run tests
74make proto-lint # Lint proto files
75```
76
77## Architecture
78
79```
80┌─────────────────┐
81│ gRPC Client │
82└────────┬────────┘
83 │ pb.Event
84
85┌─────────────────┐
86│ gRPC Handler │ ← validates using nostr.Event
87│ (convert.go) │ ← generates canonical JSON
88└────────┬────────┘
89 │ pb.Event + canonicalJSON
90
91┌─────────────────┐
92│ Storage Layer │ ← protobuf + compressed JSON
93│ (SQLite) │ ← query by filter
94└─────────────────┘
95```
96
97## License
98
99MIT