Cardano Node Sync stuck

Hi I noticed my node sync is out on --mainnet and I noticed that when I run cardano-cli query tip --mainnet its stuck on the same block !

    "epoch": 154,
    "hash": "43732b25542df0652fc3095075f78e044830f300942b0464635dbaa315e1c46b",
    "slot": 36416289,
    "block": 2885555,
    "era": "Alonzo",
    "syncProgress": "49.17"

My version is cardano-cli 1.31.0

Although I ran this to check the cardano-db-sync and got not found could that be the issue or something else. please help if you can as i need to run transactions for minting native assets asap preferably.

cardano-db-sync --version
command not found: cardano-db-sync




type sudo systemctl status cardano-node
and journalctl -e -f -u cardano-node (do u see any errors?)
don’t u have glive on your node?

cardano-cli does not need cardano-db-sync to operate correctly.

Use the systemctl status command from @Alexd1985 to find out why the node is not progressing.

Hi Alex I am running on Mac OS shell
I can run testnet and I left it for about 4 hours until it was 100% synced

cardano-cli query tip --testnet-magic 1097911063
    "epoch": 180,
    "hash": "49c1f9d0d462d0941d9b964f4c57da16edea3dc484df450aad72e35967027ecd",
    "slot": 47707686,
    "block": 3234223,
    "era": "Alonzo",
    "syncProgress": "100.00"

Its just on Mainnet its stuck any other ideas ?

I can only run one or other node at a time on my machine

yes, you need to check why on mainnet the node is not syncing.

did u replaced all files for tesnet with mainnet files? (mainnet-topology, mainnet-config, etc)
what guide did u followed to install the node?

Used this guide

Not sure I replaced all of them only the db number I downloaded them all testnet and mainnet into same folder as they had different names ?

Please tell me what i should of done ?

How did u started the node? Can u share the script?

@mattmco All this other stuff you are posting is next to useless. You need to post the cardano-node logs.

Hi yes of course

cardano-node run --config $HOME/cardano-src/cardano-node/mainnet-config.json --database-path $HOME/cardano-src/cardano-node/db/ --socket-path $HOME/cardano-src/cardano-node/db/node.socket --host-addr --port 1337 --topology $HOME/cardano-src/cardano-node/mainnet-topology.json

Do you use the same database path for your testnet experiments?

That could (would?) be bad, since the databases of both have totally different content.

replace with and try to start the node again

1 Like

Hi ok will give that a go any explanation ?

Hi Ok what is the better practise ?

I would use --database-path $HOME/cardano-src/cardano-node/testnet-db/ for testnet and --database-path $HOME/cardano-src/cardano-node/mainnet-db/ for mainnet or something like that.

1 Like

Yes good logic I like that !

Do I need to populate the both database again I remember doing something with that

In How to run cardano-node | Cardano Developer Portal it only says that the directories should exist. mkdir $HOME/cardano-src/cardano-node/testnet-db for testnet and mkdir $HOME/cardano-src/cardano-node/mainnet-db for mainnet should be enough.

You can tell all kinds of servers (it’s not just cardano-node-specific), on which Internet addresses to answer requests. is the local loopback interface, so with that the server will only answer requests from the current machine. most often means “bind on every available interface”, so that it will answer on the local loopback, on the address given to your ethernet port, on the address given to your wifi connection, …

For relays and block producers, it’s pretty important to have them open on all interfaces, since they want and need incoming connections (although the original design said that they should work with only outgoing connections, but SPOs say they don’t). For this to really work, the router also has to be configured to forward requests to the right machine inside the network. Normally, they don’t. They wouldn’t even know if Cardano requests should go to your computer, the TV or the Playstation.

If you just use the node to mint some tokens (or as the backend of a wallet or something like that), you would not need the node to answer external requests and --host-addr is probably okay. (Your router wouldn’t be configured in the way described above, anyway.)

cardano-cli doesn’t use the TCP/IP interface, when talking to cardano-node, but it uses a Unix socket – a special file on the file system that behaves a bit like a connection over the network. That’s what you tell it to open with --socket-path $HOME/cardano-src/cardano-node/db/node.socket (by the way, if we distinguish mainnet and testnet db folders, we should probably just put that one level up or so) and tell cardano-cli to find with export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/db/node.socket" (has to also be adapted, when you put it somewhere else).

1 Like

Ok you lost me a bit here what do I need to do folder structure wise ?

Above, I suggested that it’s perhaps not a good idea to have the databases of testnet and mainnet in the same folder and that may well be the cause of your problems.

If we do not use $HOME/cardano-src/cardano-node/db/ anymore, but separate $HOME/cardano-src/cardano-node/mainnet-db/ and $HOME/cardano-src/cardano-node/testnet-db/, then you will probably want to delete the whole $HOME/cardano-src/cardano-node/db/ to keep it tidy and also, because each of these folders eats up several GiB.

But then the socket shouldn’t be configured in that directory, also.

  • You could configure cardano-node with --socket-path $HOME/cardano-src/cardano-node/testnet-db/node.socket if you are running testnet and with --socket-path $HOME/cardano-src/cardano-node/mainnet-db/node.socket if you are running mainnet. That would especially be necessary if you want to run both at the same time (and your machine is powerful enough for that craziness).
  • You could also choose --socket-path $HOME/cardano-src/cardano-node/node.socket and put it outside the database folder and use the same socket for testnet and mainnet. Should be totally fine, as long as both are not running at the same time.

In any case, cardano-cli needs to know, where the node is. Therefore, all walkthroughs that I have seen contain something like export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/db/node.socket" somewhere near the beginning. Whatever you have decided above needs to be reflected there.

  • If you distinguish mainnet and testnet, it needs to be export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/testnet-db/node.socket" before you can do something with a running testnet node and export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/mainnet-db/node.socket" to connect to a running mainnet node.
  • If you decide that the socket should be the same and put it one level up, it would be export CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/cardano-node/node.socket" in both cases.

Perhaps, some guide told you to put in .bashrc, .zshrc or something like that. Then the easiest way would be the “same socket for mainnet and testnet” choice and just edit it there (and remember that it only takes effect for newly started shells after the change).

1 Like