Topology updater script topologyUpdater.sh

When you run the topology updater script after that you add the relays and producers on the #CUSTOM_PEERS="None" , the script update the topology yaml file with the custom entries and as well added many public IPs like :

    {
      "addr": "51.103.134.253",
      "port": 6000,
      "valency": 1,
      "distance": 2,
      "continent": "EU",
      "country": "CH",
      "region": "ZH"
    },
    {
      "addr": "161.97.137.114",
      "port": 6000,
      "valency": 1,
      "distance": 245,
      "continent": "EU",
      "country": "DE",
      "region": "BY"
    },
    {
      "addr": "65.21.58.4",
      "port": 6001,
      "valency": 1,
      "distance": 255,
      "continent": "EU",
      "country": "DE",
      "region": "BY"
    },
    {
      "addr": "209.250.239.195",
      "port": 6000,
      "valency": 1,
      "distance": 305,
      "continent": "EU",
      "country": "DE",
      "region": "HE"
    },

Is this normal to have other IPs? how the relay can select my producer inside this list? it will be really good to know how the relay works to select the product from this long list of nodes. I could not fund answer online.

Hi!

The topology file basically a list of remote nodes (relays, producers) where the node will tries to connect - to all the nodes listed in the file.

So you are fine, topologyUpdater will extend the your custom peers and that is how it should work.

As an alternative you can use topolgyUpdater.py from
https://github.com/Josef3110/stakepool_python_tools

It uses a JSON configuration file and adds some error handling. In a future version (already in the making) it will also be able to send email if something goes wrong. If you have problems with the python script you can contact me directly.

Thank you for your reply. @laplasz @jf3110
I am interested to know how things works under the hood, let say I have two vms one relay and one producer, the relay has the topology with public IPs and my producer IP, let’s assume that my relay got selected to build a block. how the relay will select my producer from the topology file?

so the relay is just responsible to keep the producer in sync. So once the producer connects to your relay it can sync the blockchain via the relay. And also the scheduling. So because of the producer is in sync it knows when to produce a block.

1 Like

AFAIK, for the relay the block producer is just another node connecting. It’s the block producer which figures out that it’s the one with being the leader for the specific block. The minted block is then sent from the block producer via the relay to the other relays.

1 Like

Now I understand, so to check that the producer can produce blocks in the assumed case one relay one producer, the producer should look like this:
image.
right? and to make sure that the relay and producer are in sync running the following command in both vms:
CARDANO_NODE_SOCKET_PATH=/opt/cardano/cnode/sockets/node0.socket cardano-cli query tip --mainnet
correct ?

Yes, correct!:wink:

Not quite true. You need to compare your tips - both must be the same with the real tip of the blockchain. Only if it all matches, you are sure ok.

Ok, I can get the tip for the relay and the producer but how can get the one of the blockchain?

from 1.26.1 the output of cardano-cli query tip --mainnet

$ cardano-cli query tip --mainnet
{
    "epoch": 261,
    "hash": "81bc4dee50b6385a1d2fc235753c7af223e4ecf3bcb54633eea62d1d57d7283e",
    "slot": 27451256,
    "block": 5619862
}

the rest is is the same as in the linked post.

When I run the ./topologyUpdater.sh, the message said “seems out of sync”,
what should I do? I rebooted and restart the node a couple times already…

image

Could you please check the output of cardano-cli query tip --mainnet?

You need to let your node sync to 100% from your current 7%. It will take a few hours.

It doesn’t take this long , normally it take about an hour or so, now it has been 4 hours
still only 9% sync

I got the following for query tip
ubuntu@ip-172-31-31-40:~/cardano-my-node$ cardano-cli query tip --mainnet
{
“epoch”: null,
“hash”: “7abd7c76f36fd614aad5851af9986eae3f35eb564565a78cd6d5b81414c175c5”,
“slot”: 3174962,
“block”: 3173425,
“era”: “Byron”
}