clone

nostr relays on demand at <name>.bind.ws: claim one with your key, pay in zaps past the free allowance

dependabot/npm_and_yarn/npm-f01a459b0f
bindws / relay-templates / README.md
README.md 3.6K source

Relay templates

A relay does not have to do everything. Names are cheap, so pick the template for the job and give each job its own name. The console offers these as presets, in this order; each is also a file you can apply from a script or copy as the start of your own.

Template Choose it when
default you want a plain relay: anyone writes, anyone reads, everything kept. Feature settings stay as they are.
outbox it is where your own public notes and articles live, for the world to read.
inbox it is where people reach you: replies, reactions, zaps and reports, kept 90 days.
private only you write and only your devices or a trusted few read: drafts, wallets, app data.
chat a group of members talks here: messages and the group's chat, directory hidden.
media it is a file host and nothing else: members upload, anyone fetches.
search you want a searchable copy of another relay's prose, refreshed every six hours. Needs a source.
articles long-form only, yours or mirrored daily from a source.
dm it is a drop box for private messages: anyone leaves a gift wrap, only members read.
quiet it should cost nothing and announce nothing: members only, every optional feature off, switched on one at a time as needed.
site it hosts NIP-5A static websites: members publish manifests and files, with mirroring on.
marmot anyone can publish Marmot KeyPackages and opaque group messages; gift wraps keep their recipient checks.
grasp it hosts GRASP Git repositories: admitted members publish repository state and related events, with reads open.
marmot-members members publish Marmot transport, with authenticated group writes and member limits; encrypted messages stay publicly readable.
home one name is your home on nostr: members write, anyone reads, sites, files and Git on, with notes, blog, bookmarks, sites, repos and a private photo library one click away.

Each file says more in its comment: what the template does, which Haven relay it mirrors, and why its kinds are what they are.

The files

A template is a relay configuration ($schema names the copy served at https://bind.ws/relay-config.schema.json, the same file as ../relay-config.schema.json) with a template block for the title and the blurb, and the rules sections only: policy, kinds, retention, and connections, the app shortcuts the Connect fold shows, each naming a file in ../connection-templates/ with who may see it (Connection templates). People, bans and addresses are never in a template, and a section a template leaves out is left alone when it is applied. Default resets the write, read, directory, kind and retention rules; it leaves feature settings and the shortcuts alone. Applying Default after Quiet keeps the features switched off. It is a rules reset, not a full relay reset.

The number in the file name is the order the console shows them in.

npm run build:templates folds the folder into src/gen/templates.ts, which the relay serves as its presets; npm run typecheck checks every file here against the schema and the relay's parser, fails when the generated module is stale, and fails when a file is missing from the table above.

To try one on a relay without applying it, from the repository root:

npm run relay plan relay-templates/10-quiet.jsonc wss://<name>.bind.ws