TL;DR Nostr Relay Tutorial
- Nostr is decentralized social media protocol
- To learn how to use it check out Nostr Client Tutorial
- Nostr uses photographically signed messages as a primitive not DNS
- Nostr messages spread via relays, servers that store nostr messages for nostr clients to read
Description
In this tutorial we we setup a public Nostr relay.
Requirements
- Git
- Docker-compose
- Nodejs + npm
Install
wget -O config.toml https://raw.githubusercontent.com/vdo/nostr-rs-relay-compose/main/config.toml
wget -O config.toml https://git.sr.ht/~gheartsfield/nostr-rs-relay/blob/HEAD/config.toml
mkdir data
sudo chown -R 1000 data
version: '3'
services:
nostr-rs-relay:
image: scsibug/nostr-rs-relay:latest
user: "1000:1000"
ports:
- "7000:8080"
volumes:
- "./config.toml:/usr/src/app/config.toml"
- "./data:/usr/src/app/db"
Tests
- Updating TOML file while the relay is running
- Doesn't change server settings
- White listing Public Keys
- Works
- Max Message Size
- Works and is tested
- Max messages per second
- Doesn't actually work
- DNS Identity Nostr NIP-05
- Works
- White list Nostr identity with DNS on Relay
- Dumping all messages from relay
- See nosdump
Get relay metadata Nostr NIP 11
Works like a charm
curl \
-H "Accept: application/nostr+json" \
http://localhost:7000 | jq