Rnostr

A high-performance and scalable nostr relay written in Rust.

Features

NIPs

Usage

Prepare source and config

```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.

Build and run

```shell

Build

cargo build --release

Show help

./target/release/rnostr relay --help

Run with config hot reload

./target/release/rnostr relay -c ./config/rnostr.toml --watch

```

Docker

```shell

Create data dir

mkdir ./data

Build

docker build . -t rnostr/rnostr

Build in China need to configure the mirror.

docker build . -t rnostr/rnostr --build-arg BASE=mirror_cn

Run

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

Commands

rnostr provides other commands such as import and export.

```shell

./target/release/rnostr --help

Usage: rnostr

Commands:

import Import data from jsonl file

export Export data to jsonl file

bench Benchmark filter

relay Start nostr relay server

help Print this message or the help of the given subcommand(s)

Options:

-h, --help Print help

-V, --version Print version

```