Updating the topology.json on producer node

My second relay node runs without any issue. Do I need to stop or restart the producer node and update the topology.json?
Do I need to assign the same port number as the first relay?

My second relay node runs without any issue. Do I need to stop or restart the producer node and update the topology.json?

First modify the topology file and then restart the producer

Do I need to assign the same port number as the first relay?

U can choose what port do u want but should
match the cnode port set in env file of the relay

1 Like

Hi Alex,

I’ve just check on my the producer node that the incoming peer after 15 hours uptime is still 0. Is it okay? Shall the peers Out/In show 2/2?

Screenshot from 2021-05-10 14-32-46

My UFW firewall is active and the port 3001 is open on the both relays and the producer node. On the relay node I don’t see any issue.

So, u started the Producer with cnode port =X

  • in the Producer u don’t need to open the 3001 port
  • open the port X only for ur relays

sudo ufw allow proto tcp from Relay1_IP to any port X
sudo ufw allow proto tcp from Relay2_IP to any port X

sudo ufw reload

restart the producer

Cheera,

PS: u should see 2/2 peers (ur both relays)

My both relays shows 2/2 peers or even with more incoming. Processed TX and Mempool TX/Bytes show soem values.
However, on my producer node LiveView shows 2/0 for the peer status, processed TX: 0 Mempool TX/Bytes: 0/0.

All telnet connections from both sides work. I use the docke image from Docker Hub. Thus, I don’t use cnode.

Ok, go to one of ur relay and type

nano topologyUpdater.sh

Show me the output

The utilized docker image doesn’t provide the topologyUpdater.sh. I can printout the binary result of the last couple hours using this command docker exec -it relay tail /opt/cardano/logs/topologyUpdateResult :

{ "resultcode": "204", "datetime":"2021-05-11 06:20:54", "clientIp": "xxx.x.x.x", "iptype": 4, "msg": "glad you're staying with us" }
{ "resultcode": "204", "datetime":"2021-05-11 07:20:55", "clientIp": "xxx.x.x.x", "iptype": 4, "msg": "glad you're staying with us" }
{ "resultcode": "204", "datetime":"2021-05-11 08:20:56", "clientIp": "xxx.x.x.x", "iptype": 4, "msg": "glad you're staying with us" }
{ "resultcode": "204", "datetime":"2021-05-11 09:20:57", "clientIp": "xxx.x.x.x", "iptype": 4, "msg": "glad you're staying with us" }

@tomdx could you give me a hint why peers out/in on a producer node shows 2/0?

The log is fine, if u go to scripts folder… do u have there the topologyUpdater script?

I can find the script under /usr/local/bin/topologyUpdate in the docker image. The content can be found also in this Github repo: nessus-cardano/topologyUpdate at 1e8105ada4988201d4227e90c90dccdcb7f06fab · tdiesler/nessus-cardano · GitHub

Here u must add the Producer IP and port

default is like this

#CUSTOM_PEERS=“None”

U need to modify:

CUSTOM_PEERS=“Producer_IP:port”

then restart the Relay

PS: don’t forget to delete # from the begining of the line

You can look at the updated topology like this …

docker exec -it relay cat /var/cardano/config/mainnet-topology.json
{ "resultcode": "201", "networkMagic": "764824073", "ipType":4, "requestedIpVersion":"4", "Producers": [
  { "addr": "[YourBlockProducerIP]", "port": [YourBlockProducerPort], "valency": 1 } ,
  { "addr": "144.91.91.34", "port": 6000, "valency": 1, "distance":0,  "continent":"EU",  "country":"DE",  "region":"BY" },
  { "addr": "relays.digitalfortress.online", "port": 3001, "valency": 1, "distance":128,  "continent":"EU",  "country":"DE",  "region":"BY" },
  { "addr": "178.18.245.206", "port": 6000, "valency": 1, "distance":258,  "continent":"EU",  "country":"DE",  "region":"BW" },
  { "addr": "93.49.244.83", "port": 6000, "valency": 1, "distance":345,  "continent":"EU",  "country":"IT",  "region":"25" },
  { "addr": "2.56.212.7", "port": 17171, "valency": 1, "distance":643,  "continent":"EU",  "country":"NL",  "region":"FL" },
  { "addr": "3.11.145.217", "port": 3001, "valency": 1, "distance":912,  "continent":"EU",  "country":"GB",  "region":"ENG" },
  { "addr": "63.33.26.176", "port": 6000, "valency": 1, "distance":1378,  "continent":"EU",  "country":"IE",  "region":"L" },
  { "addr": "134.209.26.2", "port": 3001, "valency": 1, "distance":6208,  "continent":"NA",  "country":"GB",  "region":"MA" },
  { "addr": "97.107.140.119", "port": 3001, "valency": 1, "distance":6491,  "continent":"NA",  "country":"US",  "region":"NJ" },
  { "addr": "54.204.210.174", "port": 3001, "valency": 1, "distance":6826,  "continent":"NA",  "country":"US",  "region":"VA" },
  { "addr": "108.89.228.2", "port": 9883, "valency": 1, "distance":7658,  "continent":"NA",  "country":"US",  "region":"GA" },
  { "addr": "75.119.137.131", "port": 6100, "valency": 1, "distance":7966,  "continent":"NA",  "country":"DE",  "region":"FL" },
  { "addr": "35.227.182.37", "port": 6000, "valency": 1, "distance":8620,  "continent":"NA",  "country":"US",  "region":"OR" },
  { "addr": "relay1.adacore.io", "port": 6000, "valency": 1, "distance":9367,  "continent":"AS",  "country":"JP",  "region":"14" },
  { "addr": "163.44.155.1", "port": 6000, "valency": 1, "distance":10045,  "continent":"AS",  "country":"SG",  "region":"01" }
] }

For your relay you would want to define CARDANO_CUSTOM_PEERS as documented here.

$ docker run --detach \
    --name=relay \
    --restart=always \
    -p 3001:3001 \
    -e CARDANO_UPDATE_TOPOLOGY=true \
    -e CARDANO_PUBLIC_IP="relay01.astorpool.net" \
    -e CARDANO_CUSTOM_PEERS="bprod.ip.or.dns.name:3001" \
    -e CARDANO_TOPOLOGY="/var/cardano/config/mainnet-topology.json" \
    -v cardano-relay-config:/var/cardano/config  \
    -v /mnt/disks/data00:/opt/cardano/data \
    nessusio/cardano-node run

You would not want to hack into the container and change files there - unless you really know what you’re doing.

1 Like

@Alexd1985 , @tomdx ,
I did already start my docker image with the parameter -e CARDANO_CUSTOM_PEERS="CORE_IP:CORE_PORT" \

docker exec -it relay cat /var/cardano/config/mainnet-topology.json shows this result

{
  "Producers": [
    {
      "addr": "relays-new.cardano-mainnet.iohk.io",
      "port": 3001,
      "valency": 2
    },
    {
      "addr": "<CORE_IP>",
      "port": <CORE_PORT>,
      "valency": 1
    },
  ]
}

The only difference what I see is that the entry "resultcode": "201", "networkMagic": "764824073", "ipType":4, "requestedIpVersion":"4", is missing.

This is how I start the relay node:

docker run -d --rm --name=relay -p <RELAY_PORT>:<RELAY_PORT> \
-e CARDANO_UPDATE_TOPOLOGY=true \
-e CARDANO_CUSTOM_PEERS="$CORE_IP:<CORE_PORT>" \
-v $HOME/cardano/data:/opt/cardano/data \
-v $HOME/cardano/ipc:/opt/cardano/ipc \
-v $HOME/cardano/config:/var/cardano/config \
nessusio/cardano-node run

I also see this line:
-e CARDANO_PUBLIC_IP=“relay01.astorpool.net” \

but @tomdx can confirm, he is the master of docker

Ok, when the relay node starts it should look like this …

Running the cardano node ...
Generating /var/cardano/config/mainnet-topology.json ...
CARDANO_CONFIG=/opt/cardano/config/mainnet-config.json
CARDANO_TOPOLOGY=/var/cardano/config/mainnet-topology.json
CARDANO_BIND_ADDR=0.0.0.0
CARDANO_PORT=3001
CARDANO_DATABASE_PATH=/opt/cardano/data
CARDANO_SOCKET_PATH=/opt/cardano/ipc/node.socket
CARDANO_LOG_DIR=/opt/cardano/logs
CARDANO_PUBLIC_IP=
CARDANO_CUSTOM_PEERS=193.xxx.xxx.xxx:3001
CARDANO_UPDATE_TOPOLOGY=true
CARDANO_BLOCK_PRODUCER=false
cardano-node run --config /opt/cardano/config/mainnet-config.json --topology /var/cardano/config/mainnet-topology.json --database-path /opt/cardano/data --socket-path /opt/cardano/ipc/node.socket --host-addr 0.0.0.0 --port 3001
Topology update: 27 * * * * root topologyUpdate
Initially waiting for 10 minutes ...

This has the custom peers configured and topology updates enabled. Next, you can check the topology update results, as you have done already. Next, you can verify that the wanted custom peers are really part of the updated topology.

If all of that is true, the relay should make a connection to your block producer. For the BP you would want to have a static topology with a connection to the relay

1 Like

That’s it! my CARDANO_TOPOLOGY is assigned to the /opt/ folder instead of the /var/ folder:

Running the cardano node ...
CARDANO_CONFIG=/opt/cardano/config/mainnet-config.json
CARDANO_TOPOLOGY=/opt/cardano/config/mainnet-topology.json
CARDANO_BIND_ADDR=0.0.0.0
CARDANO_PORT=3001
CARDANO_DATABASE_PATH=/opt/cardano/data
CARDANO_SOCKET_PATH=/opt/cardano/ipc/node.socket
CARDANO_LOG_DIR=/opt/cardano/logs
CARDANO_PUBLIC_IP=

Starting the docker run using -e CARDANO_TOPOLOGY="/var/cardano/config/mainnet-topology.json" solve the peers issue what I had. Now, on my producer node I see 2/2 for my peers!
I see also some value for the Processed TX and the Mempool TX/Bytes.

I was not aware that if I use the custom configuration. I need to assigned the docker volume and the environment variable, as documented in Github . I assigned only the volume, but not the environment variable so that the node runs with the configuration from the /opt/ folder.

Many thanks @tomdx and @Alexd1985 for your support!

1 Like

You are welcome, anytime!

1 Like

Why is there still no way to notify cardano to reread the topology file? Restarting it is destructive, and sets off monitoring every time, since it loses peers and takes time to catch up.