From 0406e24e1259e1a9adcd739da388dcca9ec8feba Mon Sep 17 00:00:00 2001 From: bndw Date: Sat, 14 Feb 2026 08:21:01 -0800 Subject: refactor: rename project from nostr-grpc to muxstr Update module path from northwest.io/nostr-grpc to northwest.io/muxstr. This includes updating all Go imports, protobuf definitions, generated files, and documentation. --- README.md | 2 +- api/nostr/v1/nostr.pb.go | 4 ++-- api/nostr/v1/nostrv1connect/nostr.connect.go | 2 +- buf.gen.yaml | 2 +- cmd/relay/main.go | 14 +++++++------- cmd/testclient/main.go | 4 ++-- examples/basic/main.go | 2 +- go.mod | 6 +++--- go.sum | 12 ++---------- internal/handler/connect/handler.go | 6 +++--- internal/handler/grpc/convert.go | 4 ++-- internal/handler/grpc/convert_test.go | 4 ++-- internal/handler/grpc/server.go | 6 +++--- internal/handler/grpc/server_test.go | 6 +++--- internal/handler/websocket/convert.go | 4 ++-- internal/handler/websocket/handler.go | 10 +++++----- internal/handler/websocket/nip11.go | 4 ++-- internal/nostr/example_test.go | 2 +- internal/nostr/relay.go | 2 +- internal/nostr/relay_test.go | 2 +- internal/storage/deletions.go | 2 +- internal/storage/deletions_test.go | 2 +- internal/storage/events.go | 2 +- internal/storage/events_test.go | 2 +- internal/storage/query.go | 2 +- internal/storage/query_test.go | 2 +- internal/subscription/manager.go | 2 +- internal/subscription/manager_test.go | 2 +- proto/nostr/v1/nostr.proto | 2 +- 29 files changed, 54 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 18bef37..5034797 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# nostr-grpc +# muxstr A high-performance Nostr relay with gRPC and WebSocket support. diff --git a/api/nostr/v1/nostr.pb.go b/api/nostr/v1/nostr.pb.go index 04aa0fe..8e7390a 100644 --- a/api/nostr/v1/nostr.pb.go +++ b/api/nostr/v1/nostr.pb.go @@ -1310,9 +1310,9 @@ const file_nostr_v1_nostr_proto_rawDesc = "" + "\bGetStats\x12\x0f.nostr.v1.Empty\x1a\x14.nostr.v1.RelayStats\x12;\n" + "\x0eGetConnections\x12\x0f.nostr.v1.Empty\x1a\x18.nostr.v1.ConnectionList\x125\n" + "\fBanPublicKey\x12\x14.nostr.v1.BanRequest\x1a\x0f.nostr.v1.Empty\x129\n" + - "\x0eGetStorageInfo\x12\x0f.nostr.v1.Empty\x1a\x16.nostr.v1.StorageStatsB\x89\x01\n" + + "\x0eGetStorageInfo\x12\x0f.nostr.v1.Empty\x1a\x16.nostr.v1.StorageStatsB\x85\x01\n" + "\fcom.nostr.v1B\n" + - "NostrProtoP\x01Z,northwest.io/nostr-grpc/api/nostr/v1;nostrv1\xa2\x02\x03NXX\xaa\x02\bNostr.V1\xca\x02\bNostr\\V1\xe2\x02\x14Nostr\\V1\\GPBMetadata\xea\x02\tNostr::V1b\x06proto3" + "NostrProtoP\x01Z(northwest.io/muxstr/api/nostr/v1;nostrv1\xa2\x02\x03NXX\xaa\x02\bNostr.V1\xca\x02\bNostr\\V1\xe2\x02\x14Nostr\\V1\\GPBMetadata\xea\x02\tNostr::V1b\x06proto3" var ( file_nostr_v1_nostr_proto_rawDescOnce sync.Once diff --git a/api/nostr/v1/nostrv1connect/nostr.connect.go b/api/nostr/v1/nostrv1connect/nostr.connect.go index fd98039..5ec7d95 100644 --- a/api/nostr/v1/nostrv1connect/nostr.connect.go +++ b/api/nostr/v1/nostrv1connect/nostr.connect.go @@ -9,7 +9,7 @@ import ( context "context" errors "errors" http "net/http" - v1 "northwest.io/nostr-grpc/api/nostr/v1" + v1 "northwest.io/muxstr/api/nostr/v1" strings "strings" ) diff --git a/buf.gen.yaml b/buf.gen.yaml index 01fea00..fa908bf 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -3,7 +3,7 @@ managed: enabled: true override: - file_option: go_package_prefix - value: northwest.io/nostr-grpc/api + value: northwest.io/muxstr/api plugins: - remote: buf.build/protocolbuffers/go out: api diff --git a/cmd/relay/main.go b/cmd/relay/main.go index 8f879b2..3a1eeef 100644 --- a/cmd/relay/main.go +++ b/cmd/relay/main.go @@ -16,13 +16,13 @@ import ( "golang.org/x/net/http2/h2c" "google.golang.org/grpc" - pb "northwest.io/nostr-grpc/api/nostr/v1" - "northwest.io/nostr-grpc/api/nostr/v1/nostrv1connect" - connecthandler "northwest.io/nostr-grpc/internal/handler/connect" - grpchandler "northwest.io/nostr-grpc/internal/handler/grpc" - wshandler "northwest.io/nostr-grpc/internal/handler/websocket" - "northwest.io/nostr-grpc/internal/storage" - "northwest.io/nostr-grpc/internal/subscription" + pb "northwest.io/muxstr/api/nostr/v1" + "northwest.io/muxstr/api/nostr/v1/nostrv1connect" + connecthandler "northwest.io/muxstr/internal/handler/connect" + grpchandler "northwest.io/muxstr/internal/handler/grpc" + wshandler "northwest.io/muxstr/internal/handler/websocket" + "northwest.io/muxstr/internal/storage" + "northwest.io/muxstr/internal/subscription" ) func main() { diff --git a/cmd/testclient/main.go b/cmd/testclient/main.go index 85f9917..8a7390a 100644 --- a/cmd/testclient/main.go +++ b/cmd/testclient/main.go @@ -14,8 +14,8 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" - pb "northwest.io/nostr-grpc/api/nostr/v1" - "northwest.io/nostr-grpc/internal/nostr" + pb "northwest.io/muxstr/api/nostr/v1" + "northwest.io/muxstr/internal/nostr" ) func main() { diff --git a/examples/basic/main.go b/examples/basic/main.go index 4f2d10d..29d58a6 100644 --- a/examples/basic/main.go +++ b/examples/basic/main.go @@ -6,7 +6,7 @@ import ( "os" "time" - "northwest.io/nostr-grpc/internal/nostr" + "northwest.io/muxstr/internal/nostr" ) // Example_basic demonstrates basic usage of the nostr library. diff --git a/go.mod b/go.mod index a291cec..c69f481 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,18 @@ -module northwest.io/nostr-grpc +module northwest.io/muxstr go 1.24.0 require ( + connectrpc.com/connect v1.19.1 github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/klauspost/compress v1.18.4 + golang.org/x/net v0.50.0 google.golang.org/grpc v1.79.1 google.golang.org/protobuf v1.36.11 modernc.org/sqlite v1.45.0 ) require ( - connectrpc.com/connect v1.19.1 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect @@ -21,7 +22,6 @@ require ( github.com/ncruces/go-strftime v1.0.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect - golang.org/x/net v0.50.0 // indirect golang.org/x/sys v0.41.0 // indirect golang.org/x/text v0.34.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect diff --git a/go.sum b/go.sum index 79c1ebe..67140e8 100644 --- a/go.sum +++ b/go.sum @@ -50,27 +50,19 @@ go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6 go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 h1:mgKeJMpvi0yx/sU5GsxQ7p6s2wtOnGAHZWCHUM4KGzY= golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= -golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk= -golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc= golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= -golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= -golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= -golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= -golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= +golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= diff --git a/internal/handler/connect/handler.go b/internal/handler/connect/handler.go index f33e4fc..7687154 100644 --- a/internal/handler/connect/handler.go +++ b/internal/handler/connect/handler.go @@ -6,9 +6,9 @@ import ( "connectrpc.com/connect" "google.golang.org/grpc/metadata" - pb "northwest.io/nostr-grpc/api/nostr/v1" - "northwest.io/nostr-grpc/api/nostr/v1/nostrv1connect" - grpchandler "northwest.io/nostr-grpc/internal/handler/grpc" + pb "northwest.io/muxstr/api/nostr/v1" + "northwest.io/muxstr/api/nostr/v1/nostrv1connect" + grpchandler "northwest.io/muxstr/internal/handler/grpc" ) type Handler struct { diff --git a/internal/handler/grpc/convert.go b/internal/handler/grpc/convert.go index 19505cd..db6935e 100644 --- a/internal/handler/grpc/convert.go +++ b/internal/handler/grpc/convert.go @@ -1,8 +1,8 @@ package grpc import ( - pb "northwest.io/nostr-grpc/api/nostr/v1" - "northwest.io/nostr-grpc/internal/nostr" + pb "northwest.io/muxstr/api/nostr/v1" + "northwest.io/muxstr/internal/nostr" ) func NostrToPB(n *nostr.Event) *pb.Event { diff --git a/internal/handler/grpc/convert_test.go b/internal/handler/grpc/convert_test.go index 6da2d89..e9116ef 100644 --- a/internal/handler/grpc/convert_test.go +++ b/internal/handler/grpc/convert_test.go @@ -3,8 +3,8 @@ package grpc import ( "testing" - pb "northwest.io/nostr-grpc/api/nostr/v1" - "northwest.io/nostr-grpc/internal/nostr" + pb "northwest.io/muxstr/api/nostr/v1" + "northwest.io/muxstr/internal/nostr" ) func TestNostrToPB(t *testing.T) { diff --git a/internal/handler/grpc/server.go b/internal/handler/grpc/server.go index 4d6e700..c5eb0d2 100644 --- a/internal/handler/grpc/server.go +++ b/internal/handler/grpc/server.go @@ -5,9 +5,9 @@ import ( "crypto/rand" "fmt" - pb "northwest.io/nostr-grpc/api/nostr/v1" - "northwest.io/nostr-grpc/internal/storage" - "northwest.io/nostr-grpc/internal/subscription" + pb "northwest.io/muxstr/api/nostr/v1" + "northwest.io/muxstr/internal/storage" + "northwest.io/muxstr/internal/subscription" ) type EventStore interface { diff --git a/internal/handler/grpc/server_test.go b/internal/handler/grpc/server_test.go index 12dde92..d589445 100644 --- a/internal/handler/grpc/server_test.go +++ b/internal/handler/grpc/server_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - pb "northwest.io/nostr-grpc/api/nostr/v1" - "northwest.io/nostr-grpc/internal/nostr" - "northwest.io/nostr-grpc/internal/storage" + pb "northwest.io/muxstr/api/nostr/v1" + "northwest.io/muxstr/internal/nostr" + "northwest.io/muxstr/internal/storage" ) func TestPublishEvent(t *testing.T) { diff --git a/internal/handler/websocket/convert.go b/internal/handler/websocket/convert.go index 0458ee4..1d006f9 100644 --- a/internal/handler/websocket/convert.go +++ b/internal/handler/websocket/convert.go @@ -1,8 +1,8 @@ package websocket import ( - pb "northwest.io/nostr-grpc/api/nostr/v1" - "northwest.io/nostr-grpc/internal/nostr" + pb "northwest.io/muxstr/api/nostr/v1" + "northwest.io/muxstr/internal/nostr" ) func NostrToPB(n *nostr.Event) *pb.Event { diff --git a/internal/handler/websocket/handler.go b/internal/handler/websocket/handler.go index c285df6..f8a7fbd 100644 --- a/internal/handler/websocket/handler.go +++ b/internal/handler/websocket/handler.go @@ -7,11 +7,11 @@ import ( "log" "net/http" - pb "northwest.io/nostr-grpc/api/nostr/v1" - "northwest.io/nostr-grpc/internal/nostr" - "northwest.io/nostr-grpc/internal/storage" - "northwest.io/nostr-grpc/internal/subscription" - "northwest.io/nostr-grpc/internal/websocket" + pb "northwest.io/muxstr/api/nostr/v1" + "northwest.io/muxstr/internal/nostr" + "northwest.io/muxstr/internal/storage" + "northwest.io/muxstr/internal/subscription" + "northwest.io/muxstr/internal/websocket" ) type EventStore interface { diff --git a/internal/handler/websocket/nip11.go b/internal/handler/websocket/nip11.go index a5bb9ca..8de95a2 100644 --- a/internal/handler/websocket/nip11.go +++ b/internal/handler/websocket/nip11.go @@ -32,10 +32,10 @@ type Limits struct { func (h *Handler) ServeNIP11(w http.ResponseWriter, r *http.Request) { info := RelayInfo{ - Name: "nostr-grpc relay", + Name: "muxstr relay", Description: "High-performance Nostr relay with gRPC, Connect, and WebSocket support", SupportedNIPs: []int{1, 9, 11}, - Software: "northwest.io/nostr-grpc", + Software: "northwest.io/muxstr", Version: "0.1.0", Limitation: &Limits{ MaxMessageLength: 65536, diff --git a/internal/nostr/example_test.go b/internal/nostr/example_test.go index 80acd21..7031c65 100644 --- a/internal/nostr/example_test.go +++ b/internal/nostr/example_test.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "northwest.io/nostr-grpc/internal/nostr" + "northwest.io/muxstr/internal/nostr" ) // Example_basic demonstrates basic usage of the nostr library. diff --git a/internal/nostr/relay.go b/internal/nostr/relay.go index 2b156e0..189fb93 100644 --- a/internal/nostr/relay.go +++ b/internal/nostr/relay.go @@ -6,7 +6,7 @@ import ( "fmt" "sync" - "northwest.io/nostr-grpc/internal/websocket" + "northwest.io/muxstr/internal/websocket" ) // Relay represents a connection to a Nostr relay. diff --git a/internal/nostr/relay_test.go b/internal/nostr/relay_test.go index 02bd8e5..7b40653 100644 --- a/internal/nostr/relay_test.go +++ b/internal/nostr/relay_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "northwest.io/nostr-grpc/internal/websocket" + "northwest.io/muxstr/internal/websocket" ) // mockRelay creates a test WebSocket server that echoes messages diff --git a/internal/storage/deletions.go b/internal/storage/deletions.go index c16b96b..3999d2c 100644 --- a/internal/storage/deletions.go +++ b/internal/storage/deletions.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - pb "northwest.io/nostr-grpc/api/nostr/v1" + pb "northwest.io/muxstr/api/nostr/v1" ) const KindDeletion = 5 diff --git a/internal/storage/deletions_test.go b/internal/storage/deletions_test.go index 71fa477..fe82d86 100644 --- a/internal/storage/deletions_test.go +++ b/internal/storage/deletions_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - pb "northwest.io/nostr-grpc/api/nostr/v1" + pb "northwest.io/muxstr/api/nostr/v1" ) func TestProcessDeletion(t *testing.T) { diff --git a/internal/storage/events.go b/internal/storage/events.go index d74fc7e..836f795 100644 --- a/internal/storage/events.go +++ b/internal/storage/events.go @@ -10,7 +10,7 @@ import ( "github.com/klauspost/compress/zstd" "google.golang.org/protobuf/proto" - pb "northwest.io/nostr-grpc/api/nostr/v1" + pb "northwest.io/muxstr/api/nostr/v1" ) var ( diff --git a/internal/storage/events_test.go b/internal/storage/events_test.go index 4393404..0c30281 100644 --- a/internal/storage/events_test.go +++ b/internal/storage/events_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - pb "northwest.io/nostr-grpc/api/nostr/v1" + pb "northwest.io/muxstr/api/nostr/v1" ) func TestStoreEvent(t *testing.T) { diff --git a/internal/storage/query.go b/internal/storage/query.go index 29a2a4c..e756f8f 100644 --- a/internal/storage/query.go +++ b/internal/storage/query.go @@ -7,7 +7,7 @@ import ( "google.golang.org/protobuf/proto" - pb "northwest.io/nostr-grpc/api/nostr/v1" + pb "northwest.io/muxstr/api/nostr/v1" ) type QueryOptions struct { diff --git a/internal/storage/query_test.go b/internal/storage/query_test.go index b1f2fc7..cdff0ec 100644 --- a/internal/storage/query_test.go +++ b/internal/storage/query_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - pb "northwest.io/nostr-grpc/api/nostr/v1" + pb "northwest.io/muxstr/api/nostr/v1" ) func setupTestEvents(t *testing.T, store *Storage) { diff --git a/internal/subscription/manager.go b/internal/subscription/manager.go index 0e737d8..6347018 100644 --- a/internal/subscription/manager.go +++ b/internal/subscription/manager.go @@ -3,7 +3,7 @@ package subscription import ( "sync" - pb "northwest.io/nostr-grpc/api/nostr/v1" + pb "northwest.io/muxstr/api/nostr/v1" ) type Subscription struct { diff --git a/internal/subscription/manager_test.go b/internal/subscription/manager_test.go index d816fcd..5e09919 100644 --- a/internal/subscription/manager_test.go +++ b/internal/subscription/manager_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - pb "northwest.io/nostr-grpc/api/nostr/v1" + pb "northwest.io/muxstr/api/nostr/v1" ) func TestManagerAddRemove(t *testing.T) { diff --git a/proto/nostr/v1/nostr.proto b/proto/nostr/v1/nostr.proto index 7e8eacb..e91b89a 100644 --- a/proto/nostr/v1/nostr.proto +++ b/proto/nostr/v1/nostr.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package nostr.v1; -option go_package = "northwest.io/nostr-grpc/api/nostr/v1;nostrv1"; +option go_package = "northwest.io/muxstr/api/nostr/v1;nostrv1"; // Core Nostr event as defined in NIP-01 message Event { -- cgit v1.2.3