This relay software specializes in providing a Nostr relay to a team. This guide will help you set up and run the software on a Linux machine.
- Prerequisites
- Setting Environment Variables
- Running Docker
- Installing Go
- Compiling the Application
- Running the Application as a Service
- A Linux-based operating system
- Docker installed on your system
- Go installed on your system
-
Create a
.env
file in the root directory of your project. -
Add your environment variables to the
.env
file. For example:RELAY_NAME="Bitvora" RELAY_PUBKEY="8ad8f1f78c8e11966242e28a7ca15c936b23a999d5fb91bfe4e4472e2d6eaf55" RELAY_DESCRIPTION="Bitvora Team Relay" POSTGRES_USER=bitvora POSTGRES_PASSWORD=password POSTGRES_DB=relay POSTGRES_HOST=localhost POSTGRES_PORT=5437 TEAM_DOMAIN="bitvora.com"
- Run Docker Compose
docker-compose up -d
-
Clone the repository:
git clone https://github.com/bitvora/team-relay.git cd team-relay
-
Build the application:
go build -o team-relay
-
Create a systemd service file:
sudo nano /etc/systemd/system/team-relay.service
-
Add the following content to the service file: (update paths and usernames as needed)
[Unit] Description=Team Relay After=network.target [Service] ExecStart=/path/to/yourappname WorkingDirectory=/path/to/team-relay EnvironmentFile=/path/to/team-relay/.env Restart=always User=ubuntu [Install] WantedBy=multi-user.target
-
Reload the systemd daemon:
sudo systemctl daemon-reload
-
Enable and start the service:
sudo systemctl enable team-relay sudo systemctl start team-relay
-
Check the status of the service:
sudo systemctl status team-relay
Your team relay will be running at localhost:3334. Feel free to serve it with nginx or any other reverse proxy.