Topology file error

hi all, i am facing following error while running block producer node with configure topology file with producer address if I running with p2p conf it’s working fine I am using testnet-magic 2 /ubuntu on VM.
cardano-node: FatalError {fatalErrorMessage = “Cardano.Node.Run.handleSimpleNodeP2P.readTopologyFile: Is your topology file formatted correctly? Expecting P2P Topology file format. The port and valency fields should be numerical. If you specified the correct topology file make sure that you correctly setup EnableP2P configuration flag. Error in $: key "LocalRoots" not found”}–shelley-kes-key: command not found

As u can see it is a problem with the topology file. correct the errors and should be fine

hi alex, there is only three line in topology file
1.addr= “192.168.1.13”
2.port=3001,
3.valency=1

what should i correct in there?

Probably this is the issue?

I don’t know how the topology for p2p shoul look but u can check this topic

This is my mainnet-topology.json file for my block producer running in P2P mode:

{
  "LocalRoots": {
    "groups": [
      {
        "localRoots": {
          "accessPoints": [
            {
              "address": "relays.terminada.io",
              "port": 2700
            }
          ],
          "advertise": false
        },
        "valency": 4
      }
    ]
  },
  "PublicRoots": []
}

I have an internal DNS server that resolves relays.terminada.io to 4 IP addresses. Also, I am using port 2700 instead of the more common 3001 for no particular reason.

Importantly for a block producer, “PublicRoots” is empty because I don’t want my block producer connecting to any outside relays, only my own. My logs show this at start up:

Oct 28 07:02:08 bprod1 cardano-node[554720]: Public Roots:
Oct 28 07:02:08 bprod1 cardano-node[554720]: Don’t use ledger to get root peers.

thanks alex i change “EnableP2P”: false, in config.json and now it’s not showing any error but running very slow

hi terminada , thanks for sharing this but as in training video’s they say your running node should connecting with some other node .do we run with our own only ?

Your block producer should only connect with your own relays. Your relays should be the ones to connect with other external nodes. It is set up this way for security so that it is not possible to connect with your block producer from outside except via one of your controlled relays first.

Here is what my mainnet-topology.json file looks like on one of my relays running P2P mode:

{
  "LocalRoots": {
    "groups": [
      {
        "localRoots": {
          "accessPoints": [
            {
              "address": "bp1.terminada.io",
              "port": 2700
            }
          ],
          "advertise": false
        },
        "valency": 1
      }
    ]
  },
  "PublicRoots": [
    {
      "publicRoots" : {
        "accessPoints": [
          {
            "address": "relays-new.cardano-mainnet.iohk.io",
            "port": 3001
          }
        ],
        "advertise": true
      },
      "valency": 1
    }
  ],
  "useLedgerAfterSlot": 0
}

bp1.terminada.io resolves internally on my network to my block producer.

Note that the relay does have PublicRoots set to any IOHK relay. It also has “useLedgerAfterSlot”: 0 which tells the node to get relay information from stake pool registration certificates stored on the chain from slot 0 onwards.

Also note that LocalRoots has only a record for my block producer. I don’t see any point in having my relays connect with each other. Instead my network has a star shaped topology with the block producer at the centre. My relays all connect with external nodes and the block producer.

I thought it a good idea to not advertise my localRoots since this is to my block producer. Whereas advertising about other external nodes (publicRoots) is a good idea because I believe this is used by the nodes to gossip about other relays for improved connections.

When I start this relay I see this in the logs:

Oct 28 08:04:19 relay1 cardano-node[617434]: Local Root Groups:
Oct 28 08:04:19 relay1 cardano-node[617434]: (1,[(RelayAccessDomain “bp1.terminada.io” 2700,DoNotAdvertisePeer)])
Oct 28 08:04:19 relay1 cardano-node[617434]: Public Roots:
Oct 28 08:04:19 relay1 cardano-node[617434]: RelayAccessDomain “relays-new.cardano-mainnet.iohk.io” 3001
Oct 28 08:04:19 relay1 cardano-node[617434]: Get root peers from the ledger after slot 0

When you run P2P mode on your relay you will see log messages like this about your connections:

Oct 28 08:12:46 relay1 cardano-node[617434]: [relay1:cardano.node.ConnectionMana
ger:Info:235] [2022-10-27 22:12:46.61 UTC] TrConnectionManagerCounters (Connecti
onManagerCounters {fullDuplexConns = 1, duplexConns = 2, unidirectionalConns = 6
5, inboundConns = 18, outboundConns = 50})

You can also check your incoming and outgoing connections with:

curl -s -H 'Accept: application/json' http:/localhost:12788 | jq '.cardano.node.metrics.connectionManager'

And you will get output like:

{
  "duplexConns": {
    "type": "g",
    "val": 4
  },
  "incomingConns": {
    "type": "g",
    "val": 17
  },
  "outgoingConns": {
    "type": "g",
    "val": 50
  },
  "prunableConns": {
    "type": "g",
    "val": 1
  },
  "unidirectionalConns": {
    "type": "g",
    "val": 62
  }
}

So there is no need for complex monitoring scripts just to check how things are running. :grinning:
And using only standard tools and built in interfaces increases understanding.

2 Likes