diff options
| author | Clawd <ai@clawd.bot> | 2026-02-16 12:12:37 -0800 |
|---|---|---|
| committer | Clawd <ai@clawd.bot> | 2026-02-16 12:12:37 -0800 |
| commit | 9d20d2281f4698024b7be67d1b86178b4e8e2484 (patch) | |
| tree | f72986f33904afc36b72dd8bbb7d83802fee0479 | |
| parent | 4b7dfe1e7764d8424b1be935c7fea09a102382e8 (diff) | |
Clean up project structure
- Add README.md
- Move benchmark files to benchmarks/
- Move PLAN.md to .claude/
- Add .gitignore
| -rw-r--r-- | .claude/PLAN.md (renamed from PLAN.md) | 0 | ||||
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | README.md | 59 | ||||
| -rw-r--r-- | benchmarks/BENCHMARKS.md (renamed from BENCHMARKS.md) | 0 | ||||
| -rw-r--r-- | benchmarks/BENCHMARK_SUMMARY.md (renamed from BENCHMARK_SUMMARY.md) | 0 | ||||
| -rw-r--r-- | benchmarks/benchmark_results.txt (renamed from benchmark_results.txt) | 0 | ||||
| -rwxr-xr-x | benchmarks/run_benchmarks.sh (renamed from run_benchmarks.sh) | 0 |
7 files changed, 60 insertions, 0 deletions
diff --git a/PLAN.md b/.claude/PLAN.md index 39d8318..39d8318 100644 --- a/PLAN.md +++ b/.claude/PLAN.md | |||
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d6b130c --- /dev/null +++ b/.gitignore | |||
| @@ -0,0 +1 @@ | |||
| .claude/settings.local.json | |||
diff --git a/README.md b/README.md new file mode 100644 index 0000000..0e7c891 --- /dev/null +++ b/README.md | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | # nostr | ||
| 2 | |||
| 3 | A Go library for the [Nostr protocol](https://github.com/nostr-protocol/nostr). | ||
| 4 | |||
| 5 | ```bash | ||
| 6 | go get code.northwest.io/nostr | ||
| 7 | ``` | ||
| 8 | |||
| 9 | ## Features | ||
| 10 | |||
| 11 | - **Keys** — Generate, parse, and convert between hex/bech32 (npub/nsec) | ||
| 12 | - **Events** — Create, sign, and verify NIP-01 events | ||
| 13 | - **Filters** — Build subscription filters | ||
| 14 | - **Relay** — WebSocket connections with publish/subscribe | ||
| 15 | - **Tags** — Parse and build event tags | ||
| 16 | |||
| 17 | ## Usage | ||
| 18 | |||
| 19 | ```go | ||
| 20 | package main | ||
| 21 | |||
| 22 | import ( | ||
| 23 | "context" | ||
| 24 | "fmt" | ||
| 25 | "code.northwest.io/nostr" | ||
| 26 | ) | ||
| 27 | |||
| 28 | func main() { | ||
| 29 | // Generate a new key pair | ||
| 30 | key, _ := nostr.GenerateKey() | ||
| 31 | fmt.Println("npub:", key.Npub()) | ||
| 32 | |||
| 33 | // Create and sign an event | ||
| 34 | event := &nostr.Event{ | ||
| 35 | Kind: nostr.KindTextNote, | ||
| 36 | Content: "Hello Nostr!", | ||
| 37 | } | ||
| 38 | event.Sign(key) | ||
| 39 | |||
| 40 | // Connect to a relay and publish | ||
| 41 | ctx := context.Background() | ||
| 42 | relay, _ := nostr.Connect(ctx, "wss://relay.damus.io") | ||
| 43 | defer relay.Close() | ||
| 44 | |||
| 45 | relay.Publish(ctx, event) | ||
| 46 | } | ||
| 47 | ``` | ||
| 48 | |||
| 49 | ## Examples | ||
| 50 | |||
| 51 | See [examples/basic](examples/basic) for a complete runnable example. | ||
| 52 | |||
| 53 | ## Benchmarks | ||
| 54 | |||
| 55 | Performance benchmarks are in [benchmarks/](benchmarks/). | ||
| 56 | |||
| 57 | ## License | ||
| 58 | |||
| 59 | MIT | ||
diff --git a/BENCHMARKS.md b/benchmarks/BENCHMARKS.md index 1a671c1..1a671c1 100644 --- a/BENCHMARKS.md +++ b/benchmarks/BENCHMARKS.md | |||
diff --git a/BENCHMARK_SUMMARY.md b/benchmarks/BENCHMARK_SUMMARY.md index 2e087a3..2e087a3 100644 --- a/BENCHMARK_SUMMARY.md +++ b/benchmarks/BENCHMARK_SUMMARY.md | |||
diff --git a/benchmark_results.txt b/benchmarks/benchmark_results.txt index c3976e6..c3976e6 100644 --- a/benchmark_results.txt +++ b/benchmarks/benchmark_results.txt | |||
diff --git a/run_benchmarks.sh b/benchmarks/run_benchmarks.sh index 87dfd17..87dfd17 100755 --- a/run_benchmarks.sh +++ b/benchmarks/run_benchmarks.sh | |||
