Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
9fa02b0
docs: add a Star History section to the README
chappie-daemon Nov 18, 2026
470d3f9
docs: split the README into a landing page and reference guides
chappie-daemon Nov 18, 2026
6306b7a
docs: restore the standalone database and Redis steps in CONTRIBUTING
chappie-daemon Nov 18, 2026
8c1a1b5
docs: correct payment settings paths and drop dead links
chappie-daemon Nov 18, 2026
e0d1981
docs: point migrations at the database the relay uses
chappie-daemon Nov 18, 2026
baa32db
docs: state how the importer actually writes a batch
chappie-daemon Nov 18, 2026
4f0f53d
docs: correct the admission sum, the nodeless default and the knex fa…
chappie-daemon Nov 18, 2026
c8a7fbb
docs: make the standalone database and Redis steps run as written
chappie-daemon Nov 18, 2026
c550dd0
docs: warn before the shared Redis step and keep the password across …
chappie-daemon Nov 18, 2026
ac5859d
docs: forward NWC_URL in compose and name the importer's replaceable …
chappie-daemon Nov 18, 2026
2c0ef77
docs: unset DB_URI before the standalone integration tests
chappie-daemon Nov 18, 2026
acc3814
docs: scope the LNURL provider claim to the callback path Nostream re…
chappie-daemon Nov 18, 2026
ec21c0e
docs: export the Redis and secret settings, and refine the importer's…
chappie-daemon Nov 18, 2026
5d0a2d1
docs: say a request to vanish does not apply to an import
chappie-daemon Nov 18, 2026
a5682b4
docs: shadow DB_URI with an empty export for the standalone integrati…
chappie-daemon Nov 18, 2026
8896c78
docs: give Compose deployments a way to apply a payment setting change
chappie-daemon Nov 18, 2026
9305f70
docs: name the user that must run recreate-relay
chappie-daemon Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/split-readme-into-guides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'nostream': patch
---

docs: split the README into a landing page and reference guides

The README had grown to 731 lines and carried a full payments walkthrough, an operations manual and a duplicate of the standalone setup steps. It is now 264 lines: what the relay is, the supported NIPs, requirements, the Docker quick start, and a table pointing at the guide for each task. The payments and operations material moved to `docs/PAYMENTS.md` and `docs/OPERATIONS.md` verbatim, and the standalone setup points at the development quick start in `CONTRIBUTING.md` instead of repeating it. `docs/SETUP.md` now links its payments pointer at the new file. The moved instructions were then checked against the code: the importer write semantics, the admission-fee sum, the knex fallback database name, the LNURL `/callback` convention, and the standalone database and Redis steps. `docker-compose.yml` now forwards `NWC_URL`, and `.env.example` names it correctly.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ DB_USER=nostr_ts_relay
DB_PASSWORD=nostr_ts_relay
# Alternatively, use a URI:
# DB_URI=postgresql://nostr_ts_relay:nostr_ts_relay@localhost:5432/nostr_ts_relay
# Migrations (knexfile.js) read DATABASE_URI from the environment; the relay reads DB_URI or DB_*.
# knex does not load this file, so export DATABASE_URI in the shell that runs `pnpm db:migrate`,
# pointing it at the same database, or the schema is created somewhere the relay never opens.
# DATABASE_URI=postgresql://nostr_ts_relay:nostr_ts_relay@localhost:5432/nostr_ts_relay

# --- DB POOL TUNING (Optional) ---
# DB_MIN_POOL_SIZE=0
Expand Down Expand Up @@ -64,7 +68,7 @@ WORKER_COUNT=2 # Defaults to CPU count. Use 1 or 2 for local testing.
# NODELESS_WEBHOOK_SECRET=
# OPENNODE_API_KEY=
# LNBITS_API_KEY=
# ALBY_NWC_URL=nostr+walletconnect://<wallet-service-pubkey>?relay=<wss-relay-url>&secret=<secret>
# NWC_URL=nostr+walletconnect://<wallet-service-pubkey>?relay=<wss-relay-url>&secret=<secret>

# --- READ REPLICAS (Optional) ---
# READ_REPLICA_ENABLED=false
Expand Down
78 changes: 55 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,39 +68,68 @@ pnpm run cli -- start

### Development Quick Start (Standalone)

Set the required environment variables (or copy `.env.example` to `.env` and edit it):
Set and export the required environment variables (or copy `.env.example` to `.env` and edit it):

```
DB_URI="postgresql://postgres:postgres@localhost:5432/nostr_ts_relay_test"
DB_USER=postgres
export DB_URI="postgresql://postgres:postgres@localhost:5432/nostr_ts_relay"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
export DATABASE_URI="$DB_URI"
export DB_USER=postgres
```

or:

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

`DATABASE_URI` is not a duplicate of `DB_URI`: the relay reads `.env` and `DB_URI`, while `pnpm db:migrate` reads `DATABASE_URI` from the exported environment and otherwise falls back to the `DB_*` variables with `nostream` as the database name. Two traps follow: knex does not load `.env`, so a `DATABASE_URI` written there alone never reaches the migration; and migrating with only `DB_URI` set writes the schema into a database the relay never opens. Keep the two in step. The integration suite uses its own `nostr_ts_relay_test` database (see the tests section below).

```
REDIS_URI="redis://default:nostr_ts_relay@localhost:6379"
export REDIS_URI="redis://default:nostr_ts_relay@localhost:6379"

REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_USER=default
REDIS_PASSWORD=nostr_ts_relay
export REDIS_HOST=localhost
export REDIS_PORT=6379
export REDIS_USER=default
export REDIS_PASSWORD=nostr_ts_relay
```

Generate a long random secret and set `SECRET`:

```
SECRET=aaabbbccc...dddeeefff
export SECRET=aaabbbccc...dddeeefff
# Secret shortened for brevity
```

Create the database the relay will use, with the connection values you just set
(`localhost:5432`, user `postgres`, database `nostr_ts_relay`):
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

```
$ psql -h localhost -p 5432 -U postgres -W
postgres=# create database nostr_ts_relay;
postgres=# quit
```

`.env.example` ships `DB_NAME=nostr_ts_relay` and `DB_USER=nostr_ts_relay`. If you copy that file instead of the block above, the relay connects as the `nostr_ts_relay` role, which the commands here never create: either set `DB_USER=postgres` in `.env`, or create that role and make it the database owner.

The next step sets a server-wide Redis password, so read this first: on a Redis instance another application also uses, either run a dedicated instance for the relay, or leave the password alone, drop the `REDIS_URI` line above and put the existing credentials in `REDIS_*`. `REDIS_URI` takes precedence over the `REDIS_*` variables, so leaving it in place would send the relay to a password that no longer exists.

Set the Redis password the default configuration expects, and verify it:

```
$ redis-cli
127.0.0.1:6379> CONFIG SET requirepass "nostr_ts_relay"
OK
127.0.0.1:6379> AUTH nostr_ts_relay
Ok
127.0.0.1:6379> quit
```

`CONFIG SET` lasts only until Redis restarts. On a dedicated instance, put `requirepass nostr_ts_relay` in the server's configuration file as well, so the password survives a restart.

Run migrations (at least once and after pulling new changes):

```
Expand Down Expand Up @@ -211,22 +240,25 @@ Change to the project's directory:
cd /path/to/nostream
```

Set the following environment variables:
The relay prefers `DB_URI` over `DB_*`, and the CLI starts with `node --env-file-if-exists=.env`, which fills in a variable that is not already set. So a `DB_URI` left in `.env` by the quick start, or exported in this shell, silently points the tests at the development database: they write their fixtures there and delete them again, and the run proves nothing about a clean schema. Use whichever form matches how you configure the relay:

```
DB_URI="postgresql://postgres:postgres@localhost:5432/nostr_ts_relay_test"
export DB_URI="postgresql://postgres:postgres@localhost:5432/nostr_ts_relay_test"

or

DB_HOST=localhost
DB_PORT=5432
DB_NAME=nostr_ts_relay_test
DB_USER=postgres
DB_PASSWORD=postgres
DB_MIN_POOL_SIZE=1
DB_MAX_POOL_SIZE=2
export DB_URI=''
export DB_HOST=localhost
export DB_PORT=5432
export DB_NAME=nostr_ts_relay_test
export DB_USER=postgres
export DB_PASSWORD=postgres
export DB_MIN_POOL_SIZE=1
export DB_MAX_POOL_SIZE=2
```

The empty `DB_URI` is deliberate: `--env-file-if-exists` does not overwrite a variable that already exists, so an empty value stops `.env` from supplying the development database, and the client treats it as unset.

Run the integration tests:

```
Expand Down
Loading
Loading