Workaround to fix Daedalus "connecting to network" and syncing issue

Hi!

By default Daedalus wallet tries to connect to IOG relay servers - relays-new.cardano-mainnet.iohk.io
Sometimes this connections attempt could take for a while and once it is established the synchronization of the blockchain could be slow as well.
So a workaround can be to change the relay server address to any other public relay address available on the decentralized network. Daedalus wallet actually a passive node on the network which can connect to several relay nodes.
More info about Cardano relay nodes can be found here:
https://docs.cardano.org/getting-started/operating-a-stake-pool/node-connectivity

The list of the relay nodes where Daedalus wallet tries to connect is stored in the topology file. The default content is the following:

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

more info about topology file: cardano-node/understanding-config-files.md at master · input-output-hk/cardano-node · GitHub

So this file can be modified by extending the list with more relay node addresses. The list of the available relay nodes can be found here:
https://explorer.cardano-mainnet.iohk.io/relays/topology.json
An example of the list:

{
  "Producers": [
    {
      "addr": "127.0.0.1",
      "port": 3002,
      "continent": "Europe",
      "state": "IE"
    },
    {
      "addr": "relay1.myrelay.com",
      "port": 3001,
      "continent": "Asia",
      "state": "JP"
    },
   ...

So first just find a node adddress with the closest location to you. Then make sure that the node is available with a simple port check. Here is a good online site to check the port status - Open Port Check Tool - Test Port Forwarding on Your Router
Example of an open port - means available:
open

Example of a closed port - means currently not available:
closed

Once you have an available node just put the address of it into the topology file.

The default topology file location on Windows is:
c:\Program Files\Daedalus Mainnet

The default topology file location on Linux is:
~/.daedalus/nix/store/XXX-node-cfg-files/topology.yaml
where XXX is series of characters but to find out what is that you can search for the file with find ~/ -name "topology.yaml"

The default topology file location on Mac is:
/Applications/Daedalus Mainnet.app/Contents/Resources/topology.yaml
(use Finder and go /Applications/Daedalus Mainnet.app then right click and show content)

So open the file with your favorite editor (Notepad, nano) and extend the list (or replace the default address) Note that “continent” and “state” keys should be replaced with “valency”:

{
  "Producers": [
    {
      "addr": "relays-new.cardano-mainnet.iohk.io",
      "port": 3001,
      "valency": 1
    },
    {
      "addr": "127.0.0.1",
      "port": 3002,
      "valency": 1
    },
    {
      "addr": "relay1.myrelay.com",
      "port": 3001,
      "valency": 1
    }
  ]
}

more about nested array json format can be found here: JSON Structures | JSON tutorial | w3resource

So once the file is updated just restart the wallet and hope it will connect and sync quicker with the newly defined relay node.

Troubleshooting

4 Likes

Just as I was troubleshooting this topic on a Daedalus Windows instance today, having a hard time starting up. I used to run it under Linux, which seemed much more reliable. First I checked if the IOHK relays were OK, but the network side seems all right.

IOHK side looks sufficiently available, running over 8 instances located in separate AWS regions. A quick test shows all are up, but the response may be another story…

$ nslookup relays-new.cardano-mainnet.iohk.io

Non-authoritative answer:
Name:   relays-new.cardano-mainnet.iohk.io
Address: 3.132.200.230
Name:   relays-new.cardano-mainnet.iohk.io
Address: 18.180.136.78
Name:   relays-new.cardano-mainnet.iohk.io
Address: 54.241.71.219
Name:   relays-new.cardano-mainnet.iohk.io
Address: 52.14.186.237
Name:   relays-new.cardano-mainnet.iohk.io
Address: 54.176.246.181
Name:   relays-new.cardano-mainnet.iohk.io
Address: 3.23.246.240
Name:   relays-new.cardano-mainnet.iohk.io
Address: 18.136.216.144
Name:   relays-new.cardano-mainnet.iohk.io
Address: 204.236.161.163

$ host -t A relays-new.cardano-mainnet.iohk.io | awk '{print $NF}' | xargs -e nping -c 1 -p 3001 |grep Success
TCP connection attempts: 8 | Successful connections: 8 | Failed: 0 (0.00%)

Your instructions for adding additional (local) nodes were perfect. Thanks for sharing! Cheers!

1 Like

In case you want to check which nodes are the closest to you in terms of TTL, you’ll find at least two Python scripts cited on

P2P deployment on mainnet should eliminate the need for a topology.json file, however that can be useful in the meantime.

1 Like