nostream/README.md
2022-10-19 09:35:44 -04:00

2.5 KiB

nostr-ts-relay

Coverage Status Build status

This is a nostr relay, written in Typescript.

This implementation is production-ready. See below for supported features.

The project master repository is available on GitHub.

Features

NIPs with a relay-specific implementation are listed here.

  • NIP-01: Basic protocol flow description
  • NIP-02: Contact list and petnames
  • NIP-03: OpenTimestams Attestations for Events
  • NIP-04: Encrypted Direct Message
  • NIP-09: Event deletion
  • NIP-11: Relay information document
  • NIP-12: Generic tag queries
  • NIP-13: Proof of Work
  • NIP-15: End of Stored Events Notice
  • NIP-16: Event Treatment
  • NIP-22: Event created_at Limits
  • NIP-26: Delegated Event Signing (DRAFT)

Requirements

  • PostgreSQL
  • Node
  • Typescript
  • Docker (optional, version 20 or higher)

Quick Start (Docker)

npm run docker:compose:up

Quick Start (Standalone)

Set the following environment variables:

DB_HOST=localhost
DB_PORT=5432
DB_NAME=nostr_ts_relay
DB_USER=postgres
DB_PASSWORD=postgres

Create nostr_ts_relay database:

$ psql -h $DB_HOST -p $DB_PORT -U $DB_USER -W
postgres=# create database nostr_ts_relay;
postgres=# quit

Install dependencies:

npm install -g knex
npm install

Run migrations:

npm run db:migrate

Create ~/.nostr folder:

mkdir ~/.nostr

To start in development mode:

npm run dev

Or, start in production mode:

npm run start

Configuration

You can change the default folder by setting the NOSTR_CONFIG_DIR environment variable to a different path.

Run nostr-ts-relay using one of the quick-start guides at least once and ~/.nostr/settings.json will be created. Any changes made to the settings file will be read on the next start.

Dev Channel

For development discussions, please feel free to use the Nostr Telegram Channel.

License

This project is MIT licensed.