29 Comments
Dec 18, 2022·edited Dec 18, 2022Liked by André Neves

minor typo:

sudo certbot —nginx -d subdomain.mydomain.com

should be:

sudo certbot --nginx subdomain.mydomain.com

Expand full comment
Dec 19, 2022Liked by André Neves

Neither of these worked for me, I get "unrecognised arguments: subdomain.domain.com"

Expand full comment
author

You need to pass the `-d` for `domain`. The issue was on copy-pasting from my CLI it combined two dashes into a single longer dash.

sudo certbot --nginx -d subdomain.mydomain.com

That's the correct one. It's been fixed in the post as well.

Expand full comment

what would you say is the safe amount to dedicate for storage?

Expand full comment
author

Currently it's sub 1GB in data storage. I'd say anything in the 50GB will allow your relay to grow quite a bit before you need to worry? Not sure. New territory to be honest.

Expand full comment
Dec 18, 2022Liked by André Neves

what do you differently on the zbd relay that seems to be faring well with the spikes in volume?

Expand full comment
author

Likely just bigger specs? Not sure

Expand full comment

Great guide, thank you very much! I made it to the last step, but keep getting this error when I run npm run docker:compose:start

failed to solve: executor failed running [/bin/sh -c npm run build]: exit code: 2

Anyone else run into that issue?

Expand full comment

Could you elaborate a bit on *why* one might want to run their own relay? Does it offer certain advantages (e.g. security,…)? Or does it simply help the network scale?

Expand full comment

Why didn't you mention an AAA record? Is IPv6 not supported?

Expand full comment

Hi, its necessary a fix IP to run the node?

i am trying from my localhost server, with a dinamic IP.

Expand full comment

When I upload a file (jpeg/mp4) to my nostream relay, the file itself gets uploaded to a linode server somewhere. How do I have my file uploaded to my machine instead?

Expand full comment

```

$ npm run docker:compose:start

> nostream@1.25.2 docker:compose:start

> ./scripts/start

Creating folder /home/ubuntu/www/break-19.com/relay.break-19.com/scripts/../.nostr

Copying /home/ubuntu/www/break-19.com/relay.break-19.com/scripts/../resources/default-settings.yaml to /home/ubuntu/www/break-19.com/relay.break-19.com/scripts/../.

nostr/settings.yaml

unknown shorthand flag: 'f' in -f

See 'docker --help'.

Usage: docker [OPTIONS] COMMAND

```

your instructions is broked.

Expand full comment

Is the graphic at the top of the article a network diagram of all the current relays? Thanks

Expand full comment

would this work on a mac? not with the same cli commands ofcourse

Expand full comment

So if I copy pasta that code you posted into a container on my VM it would work? Sorry if its a dumb question No code dude here trying to learn!

Expand full comment
Feb 2, 2023·edited Feb 2, 2023

When I start the relay with "npm run docker:compose:start" I got following error message:

npm ERR! code ENOENT

npm ERR! syscall open

npm ERR! path /home/testuser/package.json

npm ERR! errno -2

npm ERR! enoent ENOENT: no such file or directory, open '/home/testuser/package.json'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

Just wondering why the error points to the package file in user home folder and not to the nostream folder.

############################################

When I start the relay in folder nostream I got following error message:

> nostream@1.19.0 docker:compose:start

> ./scripts/start

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.project%3Dnostream%22%3Atrue%7D%7D": dial unix /var/run/docker.sock: connect: permission denied

##################################################

..and with sudo "npm...:

> nostream@1.19.0 docker:compose:start

> ./scripts/start

WARNING: Error loading config file: /root/.docker/config.json: open /root/.docker/config.json: permission denied

unknown shorthand flag: 'f' in -f

Any idea? Thx.

Expand full comment

getting the exact same error.

Expand full comment

figured it out, just needed to add user to docker group

`sudo usermod -aG docker ${USER}`

Expand full comment

This worked for me.. THANK YOU.

Expand full comment

That didn't seem to work in my case. Even when I switch users away from root with 'su', after I run docker-compose:start I get:

npm ERR! code ENOENT

npm ERR! syscall open

npm ERR! path /root/package.json

npm ERR! errno -2

npm ERR! enoent ENOENT: no such file or directory, open '/root/package.json'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent

npm ERR! A complete log of this run can be found in:

npm ERR! /root/.npm/_logs/2023-02-22T23_24_17_093Z-debug-0.log

Expand full comment

dito, but now I get a PostgreSQL error:

FATAL: could not map anonymous shared memory: Cannot allocate memory

nostream-db | 2023-02-03 00:04:10.019 UTC [1] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 4438917120 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections

Looks like my VM doesn´t meet the required system requirements. But I can´t find any minimum requirements for a nostr relay.

Expand full comment
Jan 14, 2023·edited Jan 14, 2023

Not sure where to look for a more comprehensive log (the fragment below is copied from the screen ) for container db nor how to address the issue.

```

db | 2023-01-14 07:58:01.548 UTC [1] FATAL: could not map anonymous shared memory: Cannot allocate memory

db | 2023-01-14 07:58:01.548 UTC [1] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 4438917120 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.

db | 2023-01-14 07:58:01.549 UTC [1] LOG: database system is shut down

db exited with code 1

container for service "db" is unhealthy

```

ChatGPT has made some sensible suggestions but being a naïf at Docker, I don't think I'll take the risk without guidance, any gratefully received. Oh, except, get a bigger boat.

PS. ChatGPT was wrong about the triple back tick giving monospace format, but I left the intention in place.

Expand full comment

Do you know alternative without available static IP address? Something like no-ip.org that works for nostr...

Expand full comment

This is cool - thanks, minor suggestions:

1) Need "sudo apt update" after doing "# Setup `apt` Docker repository"

2) Need to cp not mv here: "mv settings.sample.json ~/.nostr/settings.json" because on startup it will error if $PWD/settings.sample.json doesn't exist since it uses it for [defaults](https://github.com/Cameri/nostream/blob/c150cb2be5a03043d079e4eb31b6393f7971954f/src/utils/settings.ts#L43)

Expand full comment

Also, everything seems to be working with my relay when I use only it with a client like https://astral.ninja but none of my posts seem to be seen by other clients - it's like it's not getting relayed somehow - any thoughts on how to debug that? I don't seen any obv error/warning messages from the docker logs on my relay.

Expand full comment