Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When starting a node, the port is accessible from 127.0.0.1 interface but not from the public ip #7

Closed
snajjar opened this issue Sep 28, 2020 · 2 comments

Comments

@snajjar
Copy link

snajjar commented Sep 28, 2020

When starting the relay with the following commands (like in the readme):

docker network create -d bridge cardano
docker run -it \
    --restart=unless-stopped \
    --network=cardano \
    --name main-relay1 \
    -p 3000:3000 \
    -p 12798:12798 \
    -e NODE_PORT="3000" \
    -e NODE_NAME="relay1" \
    -e NODE_TOPOLOGY="<IP-address of block-producing node>:3000/1" \
    -e NODE_RELAY="True" \
    -e CARDANO_NETWORK="main" \
    -e PROMETHEUS_PORT="12798" \
    -v $PWD/config/:/config/ \
    arradev/cardano-node:latest --start

the 3000 port is open from the 127.0.0.1 interface

sam@block:~$ nmap 127.0.0.1 -p 3000
Starting Nmap 7.80 ( https://nmap.org ) at 2020-09-28 10:37 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00013s latency).

PORT     STATE SERVICE
3000/tcp open  ppp

Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds

but not from the outside (which make the registration step fail)

sam@block:~$ nmap <my-domain> -p 3000
Starting Nmap 7.80 ( https://nmap.org ) at 2020-09-28 10:39 UTC
Nmap scan report for <my-domain> (<my-ip>)
Host is up (0.000074s latency).

PORT     STATE  SERVICE
3000/tcp closed ppp

Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds

The docker network part seems right (I tried to run a simple http server) with the following and it works:

 docker run --name python_simplehttpserver -d -v /home/foo:/var/www:ro -p 80:8080 trinitronx/python-simplehttpserver

I also checked if my public ip was correctly resolved by ./scripts/function/get_public_ip and yes, it's the case. Any idea of what may be wrong here?

@snajjar
Copy link
Author

snajjar commented Sep 28, 2020

I also tried to run it with --net=host with no success. It seems that it's the cardano-node that is binded to localhost interface.

@abracadaniel
Copy link
Owner

Hi Snajjar,

Sorry for the slow response. I tend to forget to check the issues.

Make sure your HOST_ADDR environment variable is correct. It should match the IP of the node. Otherwise just set it to HOST_ADDR=0.0.0.0, then it will not depend on if you set it to the correct IP.

I'll update the examples to include it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants