nostream/README.md
Ricardo Arturo Cabral Mejía 7718e5fd9f
Update README.md
2022-11-08 23:52:24 -05:00

3.8 KiB

nostr-ts-relay

nostr-ts-relay logo

GitHub issues GitHub stars GitHub forks GitHub license 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.

A sample settings file is included at the project root under the name settings.sample.json. Feel free to copy it to ~/.nostr/settings.json if you would like to have a settings file before running the relay first.

See CONFIGURATION.md for a detailed explanation of each environment variable and setting.

Dev Channel

For development discussions, please use the Nostr Typescript Relay Dev Channel.

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

License

This project is MIT licensed.