goNDK is a NOSTR Development Kit in Golang
- well-engineered framework of NOSTR types, funcs and interfaces
- 95%+ test coverage, for rapid prototyping and production-ready solutions at scale
- help NOSTR development in Go to be high-quality, fast, easy and fun
- initial type build underway, commenced Easter 2024
-
Event{}
-
Identity{}
WIP -
Client{}
,RelayManager{}
,Subscription{}
,SubscriptionFilter{}
-
Relay{}
,Transport{}
,ClientManager{}
, -
Outbox{}
,Inbox{}
make lint # golangci-lint
make test # unit tests
make cover # 95%+ coverage
make generate # code generation (easyjson)
make docker.build
make docker.lint
make docker.test
make docker.cover
make docker.shell
go get github.com/niallyoung/goNDK@latest
import (
"github.com/niallyoung/goNDK/event"
)
// unmarshal an incoming JSON serialised Event
var event event.Event
err := json.Unmarshal([]byte(`{"kind": 1, "content": "...", ... }`), &event)
// create and sign a new event
e := event.NewEvent(1, "hello world!", event.Tags(nil), nil, nil, nil, nil)
err := e.Sign(privateKey.Key.String()) // Sign an Event
// serialization
text := e.String()
bytes := e.Serialize()
// validation
err := e.Validate()
ok, err := e.ValidateSignature()
import (
"github.com/niallyoung/goNDK/identity"
)
i := identity.NewIdentity(pubkey, npub)
err := i.Validate()
Built upon, around and inspired by:
MIT License Copyright (c) 2024 Niall Young [email protected]