Home

Awesome

What is PyRelay?

PyRelay is a python implementation of a NOSTR Relay, using asyncio. Don't know whats NOSTR is? check it out here.

Quick start

Installing

PyRelay require python 3.11. I suggest setting up virtual env before running locally.

Install using git

git clone https://github.com/johnny423/pyrelay
cd pyrelay

Run with docker compose

docker compose up

Install Locally

Install dependencies, without dev dependencies

pip install -r requirements.txt

If you have trouble with installing secp256k1 try executing

On fedora python-devel should be installed

# dnf install python-devel
pip install wheel

then

python setup.py bdist_wheel 

and rerun

pip install -r requirements.txt

Run the server locally

python ./pyrelay/relay/server.py

Developer Setup

Download and install the latest version of git.

Configure git with your username and email.

git config --global user.name 'your name'
git config --global user.email 'your email'

Make sure you have a GitHub account.

Clone the repository locally.

git clone https://github.com/johnny423/pyrelay
cd pyrelay

Install dependencies, include dev dependencies

pip install -r requirements.txt -r requirements-dev.txt -r requirements-test.txt

Install pre-commit

pre-commit install

Then, before committing, make sure Run git hooks is checked.

Running tests

You can run the tests with the scripts

./scripts/test.sh

Support status

Check the NIPs in here

Supported NIPs

supportedNIPdescription
VNIP-01Basic protocol flow description
VNIP-02Contact List and Petnames
XNIP-03OpenTimestamps Attestations for Events
VNIP-04Encrypted Direct Message
VNIP-05Mapping Nostr keys to DNS-based internet identifiers
VNIP-06Basic key derivation from mnemonic seed phrase
VNIP-07window.nostr capability for web browsers
XNIP-08Handling Mentions
VNIP-09Event Deletion
XNIP-10Conventions for clients' use of e and p tags in text events.
XNIP-11Relay Information Document
VNIP-12Generic Tag Queries
XNIP-13Proof of Work
XNIP-14Subject tag in text events.
VNIP-15End of Stored Events Notice
XNIP-16Event Treatment
XNIP-18Reposts
XNIP-19bech32-encoded entities
VNIP-20Command Results
XNIP-22Event created_at Limits
XNIP-25Reactions
XNIP-26Delegated Event Signing
XNIP-28Public Chat
XNIP-33Parameterized Replaceable Events
XNIP-36Sensitive Content
XNIP-40Expiration Timestamp