diff options
| author | bndw <ben@bdw.to> | 2026-02-16 10:58:11 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-16 10:58:11 -0800 |
| commit | 4b7dfe1e7764d8424b1be935c7fea09a102382e8 (patch) | |
| tree | bd80dc38b0c3d9e4332b9f5df25c17fb4943ea64 | |
| parent | 7a5d5a53e5d6878f38382c4d35f644e088d318d2 (diff) | |
fix: cleanup bench
| -rw-r--r-- | BENCHMARKS.md | 47 | ||||
| -rw-r--r-- | BENCHMARK_SUMMARY.md | 2 | ||||
| -rw-r--r-- | benchmarks/comparison/README.md | 44 | ||||
| -rw-r--r-- | benchmarks/comparison/comparison_bench_test.go (renamed from comparison_bench_test.go) | 6 | ||||
| -rw-r--r-- | benchmarks/comparison/go.mod | 39 | ||||
| -rw-r--r-- | benchmarks/comparison/go.sum | 85 | ||||
| -rw-r--r-- | example_test.go | 2 | ||||
| -rw-r--r-- | examples/basic/main.go | 2 | ||||
| -rw-r--r-- | go.mod | 2 | ||||
| -rw-r--r-- | relay.go | 2 | ||||
| -rw-r--r-- | relay_test.go | 2 |
11 files changed, 200 insertions, 33 deletions
diff --git a/BENCHMARKS.md b/BENCHMARKS.md index 14a861c..1a671c1 100644 --- a/BENCHMARKS.md +++ b/BENCHMARKS.md | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | This directory contains comprehensive benchmarks comparing three popular Go Nostr libraries: | 3 | This directory contains comprehensive benchmarks comparing three popular Go Nostr libraries: |
| 4 | 4 | ||
| 5 | - **NWIO** (`northwest.io/nostr`) - This library | 5 | - **NWIO** (`code.northwest.io/nostr`) - This library |
| 6 | - **NBD** (`github.com/nbd-wtf/go-nostr`) - Popular community library | 6 | - **NBD** (`github.com/nbd-wtf/go-nostr`) - Popular community library |
| 7 | - **Fiat** (`fiatjaf.com/nostr`) - Original implementation by Fiatjaf | 7 | - **Fiat** (`fiatjaf.com/nostr`) - Original implementation by Fiatjaf |
| 8 | 8 | ||
| @@ -25,61 +25,60 @@ This directory contains comprehensive benchmarks comparing three popular Go Nost | |||
| 25 | 25 | ||
| 26 | ## Running Benchmarks | 26 | ## Running Benchmarks |
| 27 | 27 | ||
| 28 | **Important**: The comparison benchmarks require the `benchcmp` build tag to avoid polluting the module dependencies with competitor libraries. | 28 | **Important**: The comparison benchmarks are in a separate module (`benchmarks/comparison/`) to avoid polluting the main module dependencies with competitor libraries. |
| 29 | 29 | ||
| 30 | ### Quick Start | 30 | ### Quick Start |
| 31 | 31 | ||
| 32 | Run all benchmarks (automatically handles dependencies): | 32 | Run all comparison benchmarks: |
| 33 | ```bash | 33 | ```bash |
| 34 | ./run_benchmarks.sh | 34 | cd benchmarks/comparison |
| 35 | ``` | 35 | go test -bench=. -benchmem -benchtime=1s |
| 36 | |||
| 37 | Or manually: | ||
| 38 | ```bash | ||
| 39 | # First, get the comparison dependencies | ||
| 40 | go get -tags=benchcmp -t ./... | ||
| 41 | |||
| 42 | # Then run the benchmarks | ||
| 43 | go test -tags=benchcmp -bench=. -benchmem -benchtime=1s | ||
| 44 | ``` | 36 | ``` |
| 45 | 37 | ||
| 46 | ### Specific Benchmark Groups | 38 | ### Specific Benchmark Groups |
| 47 | 39 | ||
| 48 | Event unmarshaling: | 40 | Event unmarshaling: |
| 49 | ```bash | 41 | ```bash |
| 50 | go test -tags=benchcmp -bench=BenchmarkEventUnmarshal -benchmem | 42 | cd benchmarks/comparison |
| 43 | go test -bench=BenchmarkEventUnmarshal -benchmem | ||
| 51 | ``` | 44 | ``` |
| 52 | 45 | ||
| 53 | Event signing: | 46 | Event signing: |
| 54 | ```bash | 47 | ```bash |
| 55 | go test -tags=benchcmp -bench=BenchmarkEventSign -benchmem | 48 | cd benchmarks/comparison |
| 49 | go test -bench=BenchmarkEventSign -benchmem | ||
| 56 | ``` | 50 | ``` |
| 57 | 51 | ||
| 58 | Event verification: | 52 | Event verification: |
| 59 | ```bash | 53 | ```bash |
| 60 | go test -tags=benchcmp -bench=BenchmarkEventVerify -benchmem | 54 | cd benchmarks/comparison |
| 55 | go test -bench=BenchmarkEventVerify -benchmem | ||
| 61 | ``` | 56 | ``` |
| 62 | 57 | ||
| 63 | Filter matching: | 58 | Filter matching: |
| 64 | ```bash | 59 | ```bash |
| 65 | go test -tags=benchcmp -bench=BenchmarkFilterMatch -benchmem | 60 | cd benchmarks/comparison |
| 61 | go test -bench=BenchmarkFilterMatch -benchmem | ||
| 66 | ``` | 62 | ``` |
| 67 | 63 | ||
| 68 | ### Compare Single Library | 64 | ### Compare Single Library |
| 69 | 65 | ||
| 70 | NWIO only: | 66 | NWIO only: |
| 71 | ```bash | 67 | ```bash |
| 72 | go test -tags=benchcmp -bench='.*_NWIO' -benchmem | 68 | cd benchmarks/comparison |
| 69 | go test -bench='.*_NWIO' -benchmem | ||
| 73 | ``` | 70 | ``` |
| 74 | 71 | ||
| 75 | NBD only: | 72 | NBD only: |
| 76 | ```bash | 73 | ```bash |
| 77 | go test -tags=benchcmp -bench='.*_NBD' -benchmem | 74 | cd benchmarks/comparison |
| 75 | go test -bench='.*_NBD' -benchmem | ||
| 78 | ``` | 76 | ``` |
| 79 | 77 | ||
| 80 | Fiat only: | 78 | Fiat only: |
| 81 | ```bash | 79 | ```bash |
| 82 | go test -tags=benchcmp -bench='.*_Fiat' -benchmem | 80 | cd benchmarks/comparison |
| 81 | go test -bench='.*_Fiat' -benchmem | ||
| 83 | ``` | 82 | ``` |
| 84 | 83 | ||
| 85 | ## Analyzing Results | 84 | ## Analyzing Results |
| @@ -91,14 +90,16 @@ Use `benchstat` for statistical analysis: | |||
| 91 | go install golang.org/x/perf/cmd/benchstat@latest | 90 | go install golang.org/x/perf/cmd/benchstat@latest |
| 92 | 91 | ||
| 93 | # Run benchmarks multiple times and compare | 92 | # Run benchmarks multiple times and compare |
| 94 | go test -tags=benchcmp -bench=. -benchmem -count=10 > results.txt | 93 | cd benchmarks/comparison |
| 94 | go test -bench=. -benchmem -count=10 > results.txt | ||
| 95 | benchstat results.txt | 95 | benchstat results.txt |
| 96 | ``` | 96 | ``` |
| 97 | 97 | ||
| 98 | Compare two specific libraries: | 98 | Compare two specific libraries: |
| 99 | ```bash | 99 | ```bash |
| 100 | go test -tags=benchcmp -bench='.*_NWIO' -benchmem -count=10 > nwio.txt | 100 | cd benchmarks/comparison |
| 101 | go test -tags=benchcmp -bench='.*_NBD' -benchmem -count=10 > nbd.txt | 101 | go test -bench='.*_NWIO' -benchmem -count=10 > nwio.txt |
| 102 | go test -bench='.*_NBD' -benchmem -count=10 > nbd.txt | ||
| 102 | benchstat nwio.txt nbd.txt | 103 | benchstat nwio.txt nbd.txt |
| 103 | ``` | 104 | ``` |
| 104 | 105 | ||
diff --git a/BENCHMARK_SUMMARY.md b/BENCHMARK_SUMMARY.md index e7f5b6d..2e087a3 100644 --- a/BENCHMARK_SUMMARY.md +++ b/BENCHMARK_SUMMARY.md | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | # Benchmark Results Summary | 1 | # Benchmark Results Summary |
| 2 | 2 | ||
| 3 | Comparison of three Go Nostr libraries: **NWIO** (northwest.io/nostr), **NBD** (github.com/nbd-wtf/go-nostr), and **Fiat** (fiatjaf.com/nostr) | 3 | Comparison of three Go Nostr libraries: **NWIO** (code.northwest.io/nostr), **NBD** (github.com/nbd-wtf/go-nostr), and **Fiat** (fiatjaf.com/nostr) |
| 4 | 4 | ||
| 5 | ## Quick Performance Overview | 5 | ## Quick Performance Overview |
| 6 | 6 | ||
diff --git a/benchmarks/comparison/README.md b/benchmarks/comparison/README.md new file mode 100644 index 0000000..1b97429 --- /dev/null +++ b/benchmarks/comparison/README.md | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | # Nostr Library Comparison Benchmarks | ||
| 2 | |||
| 3 | This module contains benchmarks comparing `code.northwest.io/nostr` with other popular Go Nostr libraries: | ||
| 4 | |||
| 5 | - **NWIO** (`code.northwest.io/nostr`) - This library | ||
| 6 | - **NBD** (`github.com/nbd-wtf/go-nostr`) - Popular community library | ||
| 7 | - **Fiat** (`fiatjaf.com/nostr`) - Original implementation by Fiatjaf | ||
| 8 | |||
| 9 | ## Why a Separate Module? | ||
| 10 | |||
| 11 | The comparison libraries are isolated in this separate Go module to keep the main `code.northwest.io/nostr` package clean. Users who import the main package won't have `fiatjaf.com/nostr` or `github.com/nbd-wtf/go-nostr` pulled into their dependency tree. | ||
| 12 | |||
| 13 | ## Running Benchmarks | ||
| 14 | |||
| 15 | From this directory: | ||
| 16 | |||
| 17 | ```bash | ||
| 18 | # Run all comparison benchmarks | ||
| 19 | go test -bench=. -benchmem | ||
| 20 | |||
| 21 | # Run specific benchmarks | ||
| 22 | go test -bench=BenchmarkEventSign -benchmem | ||
| 23 | |||
| 24 | # Compare NWIO vs NBD | ||
| 25 | go test -bench='.*_(NWIO|NBD)' -benchmem | ||
| 26 | ``` | ||
| 27 | |||
| 28 | From the project root: | ||
| 29 | |||
| 30 | ```bash | ||
| 31 | cd benchmarks/comparison | ||
| 32 | go test -bench=. -benchmem | ||
| 33 | ``` | ||
| 34 | |||
| 35 | ## Benchmark Categories | ||
| 36 | |||
| 37 | - **Event Unmarshaling/Marshaling**: JSON parsing and serialization | ||
| 38 | - **Event Serialization**: Canonical serialization for ID computation | ||
| 39 | - **Event ID Computation**: Computing event ID hashes | ||
| 40 | - **Key Generation**: Generating new private keys | ||
| 41 | - **Event Signing/Verification**: Cryptographic operations | ||
| 42 | - **Filter Matching**: Simple and complex filter matching | ||
| 43 | |||
| 44 | See [../../BENCHMARKS.md](../../BENCHMARKS.md) for detailed documentation. | ||
diff --git a/comparison_bench_test.go b/benchmarks/comparison/comparison_bench_test.go index ee3e936..866b4df 100644 --- a/comparison_bench_test.go +++ b/benchmarks/comparison/comparison_bench_test.go | |||
| @@ -1,13 +1,11 @@ | |||
| 1 | //go:build benchcmp | 1 | package comparison_test |
| 2 | |||
| 3 | package nostr_test | ||
| 4 | 2 | ||
| 5 | import ( | 3 | import ( |
| 6 | "encoding/hex" | 4 | "encoding/hex" |
| 7 | "encoding/json" | 5 | "encoding/json" |
| 8 | "testing" | 6 | "testing" |
| 9 | 7 | ||
| 10 | nwio "northwest.io/nostr" | 8 | nwio "code.northwest.io/nostr" |
| 11 | nbd "github.com/nbd-wtf/go-nostr" | 9 | nbd "github.com/nbd-wtf/go-nostr" |
| 12 | fiat "fiatjaf.com/nostr" | 10 | fiat "fiatjaf.com/nostr" |
| 13 | ) | 11 | ) |
diff --git a/benchmarks/comparison/go.mod b/benchmarks/comparison/go.mod new file mode 100644 index 0000000..f76c374 --- /dev/null +++ b/benchmarks/comparison/go.mod | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | module code.northwest.io/nostr/benchmarks/comparison | ||
| 2 | |||
| 3 | go 1.25 | ||
| 4 | |||
| 5 | require ( | ||
| 6 | code.northwest.io/nostr v0.0.0 | ||
| 7 | fiatjaf.com/nostr v0.0.0-20260211144128-7a4b71b39b12 | ||
| 8 | github.com/nbd-wtf/go-nostr v0.52.3 | ||
| 9 | ) | ||
| 10 | |||
| 11 | require ( | ||
| 12 | github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3 // indirect | ||
| 13 | github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect | ||
| 14 | github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect | ||
| 15 | github.com/bytedance/sonic v1.13.1 // indirect | ||
| 16 | github.com/bytedance/sonic/loader v0.2.4 // indirect | ||
| 17 | github.com/cloudwego/base64x v0.1.5 // indirect | ||
| 18 | github.com/coder/websocket v1.8.13 // indirect | ||
| 19 | github.com/decred/dcrd/crypto/blake256 v1.1.0 // indirect | ||
| 20 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect | ||
| 21 | github.com/josharian/intern v1.0.0 // indirect | ||
| 22 | github.com/json-iterator/go v1.1.12 // indirect | ||
| 23 | github.com/klauspost/cpuid/v2 v2.2.10 // indirect | ||
| 24 | github.com/mailru/easyjson v0.9.0 // indirect | ||
| 25 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
| 26 | github.com/modern-go/reflect2 v1.0.2 // indirect | ||
| 27 | github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect | ||
| 28 | github.com/templexxx/cpu v0.0.1 // indirect | ||
| 29 | github.com/templexxx/xhex v0.0.0-20200614015412-aed53437177b // indirect | ||
| 30 | github.com/tidwall/gjson v1.18.0 // indirect | ||
| 31 | github.com/tidwall/match v1.1.1 // indirect | ||
| 32 | github.com/tidwall/pretty v1.2.1 // indirect | ||
| 33 | github.com/twitchyliquid64/golang-asm v0.15.1 // indirect | ||
| 34 | golang.org/x/arch v0.15.0 // indirect | ||
| 35 | golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect | ||
| 36 | golang.org/x/sys v0.35.0 // indirect | ||
| 37 | ) | ||
| 38 | |||
| 39 | replace code.northwest.io/nostr => ../.. | ||
diff --git a/benchmarks/comparison/go.sum b/benchmarks/comparison/go.sum new file mode 100644 index 0000000..fb3bb78 --- /dev/null +++ b/benchmarks/comparison/go.sum | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | fiatjaf.com/nostr v0.0.0-20260211144128-7a4b71b39b12 h1:lNVaw/O5ThXVzO0Pz7D+b9fys/OaVaDG3C10kCJQFvg= | ||
| 2 | fiatjaf.com/nostr v0.0.0-20260211144128-7a4b71b39b12/go.mod h1:ue7yw0zHfZj23Ml2kVSdBx0ENEaZiuvGxs/8VEN93FU= | ||
| 3 | github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3 h1:ClzzXMDDuUbWfNNZqGeYq4PnYOlwlOVIvSyNaIy0ykg= | ||
| 4 | github.com/ImVexed/fasturl v0.0.0-20230304231329-4e41488060f3/go.mod h1:we0YA5CsBbH5+/NUzC/AlMmxaDtWlXeNsqrwXjTzmzA= | ||
| 5 | github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= | ||
| 6 | github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= | ||
| 7 | github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= | ||
| 8 | github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= | ||
| 9 | github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g= | ||
| 10 | github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4= | ||
| 11 | github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= | ||
| 12 | github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= | ||
| 13 | github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= | ||
| 14 | github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= | ||
| 15 | github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= | ||
| 16 | github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= | ||
| 17 | github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE= | ||
| 18 | github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs= | ||
| 19 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
| 20 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
| 21 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
| 22 | github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= | ||
| 23 | github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= | ||
| 24 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= | ||
| 25 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= | ||
| 26 | github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= | ||
| 27 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= | ||
| 28 | github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= | ||
| 29 | github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= | ||
| 30 | github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= | ||
| 31 | github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= | ||
| 32 | github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= | ||
| 33 | github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= | ||
| 34 | github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= | ||
| 35 | github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= | ||
| 36 | github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= | ||
| 37 | github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= | ||
| 38 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||
| 39 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= | ||
| 40 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||
| 41 | github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= | ||
| 42 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= | ||
| 43 | github.com/nbd-wtf/go-nostr v0.52.3 h1:Xd87pXfJEJRXHpM+fLjQQln8dBNNaoPA10V7BbyP4KI= | ||
| 44 | github.com/nbd-wtf/go-nostr v0.52.3/go.mod h1:4avYoc9mDGZ9wHsvCOhHH9vPzKucCfuYBtJUSpHTfNk= | ||
| 45 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
| 46 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
| 47 | github.com/puzpuzpuz/xsync/v3 v3.5.1 h1:GJYJZwO6IdxN/IKbneznS6yPkVC+c3zyY/j19c++5Fg= | ||
| 48 | github.com/puzpuzpuz/xsync/v3 v3.5.1/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA= | ||
| 49 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
| 50 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= | ||
| 51 | github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= | ||
| 52 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | ||
| 53 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
| 54 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
| 55 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
| 56 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= | ||
| 57 | github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= | ||
| 58 | github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= | ||
| 59 | github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= | ||
| 60 | github.com/templexxx/cpu v0.0.1 h1:hY4WdLOgKdc8y13EYklu9OUTXik80BkxHoWvTO6MQQY= | ||
| 61 | github.com/templexxx/cpu v0.0.1/go.mod h1:w7Tb+7qgcAlIyX4NhLuDKt78AHA5SzPmq0Wj6HiEnnk= | ||
| 62 | github.com/templexxx/xhex v0.0.0-20200614015412-aed53437177b h1:XeDLE6c9mzHpdv3Wb1+pWBaWv/BlHK0ZYIu/KaL6eHg= | ||
| 63 | github.com/templexxx/xhex v0.0.0-20200614015412-aed53437177b/go.mod h1:7rwmCH0wC2fQvNEvPZ3sKXukhyCTyiaZ5VTZMQYpZKQ= | ||
| 64 | github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= | ||
| 65 | github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= | ||
| 66 | github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= | ||
| 67 | github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= | ||
| 68 | github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
| 69 | github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= | ||
| 70 | github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
| 71 | github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= | ||
| 72 | github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= | ||
| 73 | golang.org/x/arch v0.15.0 h1:QtOrQd0bTUnhNVNndMpLHNWrDmYzZ2KDqSrEymqInZw= | ||
| 74 | golang.org/x/arch v0.15.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE= | ||
| 75 | golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw= | ||
| 76 | golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM= | ||
| 77 | golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= | ||
| 78 | golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= | ||
| 79 | golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= | ||
| 80 | golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= | ||
| 81 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
| 82 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
| 83 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
| 84 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
| 85 | nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= | ||
diff --git a/example_test.go b/example_test.go index 6d10ced..9a2aab1 100644 --- a/example_test.go +++ b/example_test.go | |||
| @@ -5,7 +5,7 @@ import ( | |||
| 5 | "fmt" | 5 | "fmt" |
| 6 | "time" | 6 | "time" |
| 7 | 7 | ||
| 8 | "northwest.io/nostr" | 8 | "code.northwest.io/nostr" |
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | // Example_basic demonstrates basic usage of the nostr library. | 11 | // Example_basic demonstrates basic usage of the nostr library. |
diff --git a/examples/basic/main.go b/examples/basic/main.go index 1a4061a..47092ef 100644 --- a/examples/basic/main.go +++ b/examples/basic/main.go | |||
| @@ -6,7 +6,7 @@ import ( | |||
| 6 | "os" | 6 | "os" |
| 7 | "time" | 7 | "time" |
| 8 | 8 | ||
| 9 | "northwest.io/nostr" | 9 | "code.northwest.io/nostr" |
| 10 | ) | 10 | ) |
| 11 | 11 | ||
| 12 | // Example_basic demonstrates basic usage of the nostr library. | 12 | // Example_basic demonstrates basic usage of the nostr library. |
| @@ -1,4 +1,4 @@ | |||
| 1 | module northwest.io/nostr | 1 | module code.northwest.io/nostr |
| 2 | 2 | ||
| 3 | go 1.25 | 3 | go 1.25 |
| 4 | 4 | ||
| @@ -6,7 +6,7 @@ import ( | |||
| 6 | "fmt" | 6 | "fmt" |
| 7 | "sync" | 7 | "sync" |
| 8 | 8 | ||
| 9 | "northwest.io/nostr/internal/websocket" | 9 | "code.northwest.io/nostr/internal/websocket" |
| 10 | ) | 10 | ) |
| 11 | 11 | ||
| 12 | // Relay represents a connection to a Nostr relay. | 12 | // Relay represents a connection to a Nostr relay. |
diff --git a/relay_test.go b/relay_test.go index 38b2062..37d1a36 100644 --- a/relay_test.go +++ b/relay_test.go | |||
| @@ -9,7 +9,7 @@ import ( | |||
| 9 | "testing" | 9 | "testing" |
| 10 | "time" | 10 | "time" |
| 11 | 11 | ||
| 12 | "northwest.io/nostr/internal/websocket" | 12 | "code.northwest.io/nostr/internal/websocket" |
| 13 | ) | 13 | ) |
| 14 | 14 | ||
| 15 | // mockRelay creates a test WebSocket server that echoes messages | 15 | // mockRelay creates a test WebSocket server that echoes messages |
