Oddbean new post about | logout
 # To run a relay in 3 lines

## Prerequsites

Install docker

## Install nostr-rs-relay

sudo docker pull scsibug/nostr-rs-relay

## Run relay

mkdir data

sudo docker run -it -p 4100:8080   --mount src=$(pwd)/data,target=/usr/src/app/db,type=bind   scsibug/nostr-rs-relay:latest

## Result

Relay will be running on port 4100 and events will be in ./data

## Testing

echo '["REQ","sub",{}]' | websocat -n ws://localhost:4100

Requires websocat, and some events 
 Or you can do it in 2 lines ;-) :


pip install nostr-relay   
nostr-relay serve 
 Nice!  Although I got:

> ModuleNotFoundError: No module named 'sqlalchemy.ext.asyncio' 
 OK worked on ubuntu 22.04, not ubuntu 20.04, I probably had an old pip 
 Now the problem is: "ERROR r2d2: unable to open database file: /usr/src/app/db/nostr.db" 
 Sounds like the container can't write to your data folder on the host. 
 Directions on https://sr.ht/~gheartsfield/nostr-rs-relay/ demonstrate how to make a mounted directory writeable w/ podman. 
 Or you can YOLO it and try "chmod 777 data". 
 It works. TY! 
 Awesome! 
 Locally works fine using noscl. Now tring make it works over internet...
 
 It´s working now locally. One more thing...how connect from internet to my relay? 
 Make sure your pwd (present working directory) is where you want the data folder to be on your host system sounds like you didn’t have permissions 
 Changed permissions and... Works! TY! 
 Signal 🔊 #[1] 
 You are the king of markdown