This is a Python 3.9+ implementation of a nostr relay.
- Stores data in LMDB, SQLite or Postgresql. See Storage
- Scalable to thousands of concurrent clients
- Dynamic allow/deny lists
- Configurable garbage collector
- Configurable event validators
- Full-text indexing
- Can serve as a NIP-05 identity provider
- Support for NIP-42 authentication
- Support for rate-limiting
- Supports more NIPs than any other relay implementation:
- NIP-01 – basic protocol
- NIP-02 – contact lists
- NIP-05 – verifying identity
- NIP-09 – deletion events
- NIP-11 – relay metadata
- NIP-12 – generic tags
- NIP-15 – EOSE
- NIP-20 – command results
- NIP-26 – delegated events
- NIP-33 – parameterized replaceable events
- NIP-40 – expiration events
- NIP-42 – authentication
- NIP-50 – full-text search
- NIP-65 – Relay lists
- Pluggable features, allowing you to use nostr_relay as a library for your own custom implementation
pip install nostr-relay
To run:
nostr-relay serve
to change the location of the database and other settings, create a yaml config file that looks like this:
and run with nostr-relay -c /path/to/config.yaml serve
Then add ws://127.0.0.1:6969
to your relay list.
(obviously, in production you should use a TLS certificate)
Visit the nostr-relay fossil repository for more information.