A high-performance and scalable nostr relay written in Rust.
created_at
LimitsThe library nostr-relay implements a simple extension mechanism to intercept user messages for custom processing. rnostr is built on top of nostr-relay and implements several simple extensions. All extensions support configuration in the config file.
Provide metrics url for prometheus scrape
NIP-42 Authentication, ip, auth pubkey and event pubkey whitelist blacklist
Limit event write frequency.
NIP-45 count results.
When the query results are too large (millions) will trigger a slow query. setting.data.db_query_timeout
.
NIP-50 Keywords filter. nostr-db implement a simple exact match pattern, case-insensitive, time-sorted full-text search. No performance optimization for multi-word queries, so it's experimental.
It reduces write concurrency and makes space usage significantly larger. So it is suitable for use in private or paid relay.
Now we only index the content of kind: 1
note event.
```shell
git clone https://github.com/rnostr/rnostr.git cd rnostr mkdir config cp ./rnostr.example.toml ./config/rnostr.toml
```
Edit the ./config/rnostr.toml
, remember to modify network.host to 0.0.0.0
for public access.
```shell
cargo build --release
./target/release/rnostr relay --help
./target/release/rnostr relay -c ./config/rnostr.toml --watch
```
```shell
mkdir ./data
docker build . -t rnostr/rnostr
docker build . -t rnostr/rnostr --build-arg BASE=mirror_cn
docker run -it --rm -p 8080:8080 \ --user=$(id -u) \ -v $(pwd)/data:/rnostr/data \ -v $(pwd)/config:/rnostr/config \ --name rnostr rnostr/rnostr:latest
```
See docker compose example
rnostr provides other commands such as import and export.
```shell
./target/release/rnostr --help
```