Skip to main content
The Deno 2 Release Candidate is here
Learn more

Nostring

WIP

A simple pure Nostr relay written in Deno.

Features

  • Can deployed on Deno Deploy
  • Internal forward events by BroadcastChannel(Only on Deno Deploy)
  • Multi data store provider(WIP)
    • PostgreSQL
  • Programmable
  • Supported NIPs
    • 01 02 04 09 11 12 15 16 20 26 28 33 40 56

Requirements

  • Deno ^1.30.0
  • PostgreSQL 15 (Other database support is WIP)

Configure environments

All variables are optional.

  • DB_URL defaults postgres://localhost:5432/nostring
  • PORT defaults 9000
  • RELAY_NAME NIP-11 name field
  • RELAY_DESC NIP-11 description field
  • ADMIN_PUBKEY NIP-11 pubkey field
  • RELAY_CONTACT NIP-11 contact field
  • MIN_POW NIP-13 min pow

Usage

deno task start

Use as a library

// Your init code...
import { Application } from "https://deno.land/x/nostring/mod.ts"
const app = new Application({
  onConnect: (ws, req) => {},
  onEvent: (ev) => {},
  onAuth: (ev) => {},
});

// Serve
import { serve } from "https://deno.land/std/http/server.ts"

serve(app.getHandler())