Skip to content

TL;DR Nostr Relay Tutorial

  • Nostr is decentralized social media protocol
  • To learn how to use it check out Nostr 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

Get relay metadata Nostr NIP 11

Works like a charm


curl \
    -H "Accept: application/nostr+json" \
    http://localhost:7000 | jq

Sources