0

I am following along with the new Official IOG Cardano Node Course:

https://cardano-course.gitbook.io/cardano-course/

I am stuck at Video 3 at 6 minutes and 8 seconds in.

https://youtu.be/YlUljmlCPYs?t=368

I started with a new WSL setup with Ubuntu 22.04. I used the nix setup method shown in video 2. There was no indication of any problems. Then I ran the following command to start the node.

js@LAPTOP-NGQPLDGT:~/preview$ cardano-node run --topology topology.json --database-path db --socket-path node.socket --port 3001 --config config.json

This produced the following error message:

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"}

It should work if I followed the directions exactly because I used the topology file that was supplied with the course. I am reporting the issue here because if I followed the directions accurately then there is an issue with the course materials which must be fixed. I am curious to know if there is anyone else using Windows Subsystem for Linux setup with Ubuntu 22.04 who has followed video 2 in the series and what was the result? Any ideas? Much thanks.

The following is the contents of the topology file. It was retrieved using the following command as per course instructions found at this link here.

wget https://book.world.dev.cardano.org/environments/preview/topology.json

{
  "localRoots": [
    {
      "accessPoints": [],
      "advertise": false,
      "valency": 1
    }
  ],
  "publicRoots": [
    {
      "accessPoints": [
        {
          "address": "preview-node.world.dev.cardano.org",
          "port": 30002
        }
      ],
      "advertise": false
    }
  ],
  "useLedgerAfterSlot": 322000
}

2 Answers 2

1

This appears to be your topology file. You're probably running the p2p enabled config, but using the old topology format. Edit config.json and set "EnableP2P": false, or remove the parameter totally. If that's not enabled, post your topology file (hiding your IPs), so we can look at it. Your p2p local roots needs to look like the following:

  "localRoots": [{
    "accessPoints": [
      {"address": "your blockproducer/relay IP or domain name", "port": 6000}
    ],
    "advertise": false,
    "valency": 1
  },{
   "accessPoints": [
     {"address": "if you have a second relay", "port": 6000}
   ],
   "advertise": false,
   "valency": 1
  }],

If you're certain P2P is not enabled in your config, then you could try the old format (and by old I mean about 2 weeks old now and is still used by the majority).

{
  "Producers": [
    {
      "addr": "BP/Relay IP or domain name",
      "port": 6000,
      "valency": 1
    },
    {
      "addr": "If you have a second",
      "port": 6000,
      "valency": 1
    }
  ]
}
2
  • Thanks @PREEB, I didn't see anything about EnableP2P. I posted the contents of the topology file in the body of my original question. Thanks for having a look. Apr 8, 2023 at 20:21
  • @JohnShearing I updated my answer above. Looks like you're using the "preview" version of the config.json, which in fact does have "EnableP2P": true,
    – PREEB
    Apr 9, 2023 at 12:16
0

Ultimately the following text in the topology.json file worked when setting EnableP2P": false in the config.json file all as @PREEB suggested.

{
  "Producers": [
    {
      "addr": "preview-node.world.dev.cardano.org",
      "port": 30002,
      "valency": 1
    }
  ]
}

The URL to use was found here and it had to be pasted into a file of the format suggested by @PREEB

So I followed the directions in the course correctly but the file topology.json file I was directed to use was not correct and the P2P setting in the config.json file was set to true when it must be set to false.

I hope this can be corrected in the documentation so that others will not have the same problem when working through the course. Otherwise I am really enjoying the course and learning a lot.

I see the GitHub repository is here. I will reach out to the creator.

Much thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.