TopologyUpdater Crontab not running since update

Also make sure that you using the latest topologyUpdater as @jeremyisme suggested

1 Like

I am using this version -
https://raw.githubusercontent.com/cardano-community/guild-operators/alpha/scripts/cnode-helper-scripts/topologyUpdater.sh

I copied it from here two days ago

My link shows “Alpha” and yours shows “Master” should I switch them?

yes - correct.
that error was came from the env file, itself - so now you should be fine - if the path is correct what you provided in the env

1 Like

By the way, that version of topologyUpdater is only useful if you used CN Tools to install your nodes. I used the coincashew tutorial and they use a simpler version of topologyupdater but does the same thing. Either way, you shouldn’t need to call cardano-cli for your hourly crontab job.

Awesome! hopefully, this works and things start running :grinning:. Do you believe this will fix the output I am seeing in poolvet? I don’t know if this is what it is supposed to look like, I believe @jeremyisme had recently mentioned he was in a similar situation-

I also used the CoinCashew guide, but I think the reason I switched versions was because it was giving me troubles

lets wait and see you dont have errors during execution of topologyUpdater

1 Like

The latest output is -

“Could not parse /mainnet-config.json file in JSON format, please double-check the syntax of your config, or simply download it from guild-operators repository!”

these lines in env file also needs to be commented out and updated with the actual value

CNODE_HOME="${HOME}/haskell/"                        # Override default CNODE_HOME path (defaults to /opt/cardano/cnode)
CNODE_PORT=3001                                         # Set node port
CONFIG="${CNODE_HOME}/../config.json"               # Override automatic detection of node config path
SOCKET="${CNODE_HOME}/storage/node.socket"            # Override automatic detection of path to socket
TOPOLOGY="${CNODE_HOME}/configs/mainnet-topology_new.json"           # Override default topology.json path
LOG_DIR="${CNODE_HOME}/logs"                           # Folder where your logs will be sent to (must pre-exist)
DB_DIR="${CNODE_HOME}/storage"                              # Folder to store the cardano-node blockchain db
1 Like

Thank you! I will make the necessary changes and let you know :+1:

1 Like

If you’ve switched from the coincashew version of topologyupdater to the CNtools one then you’ll have a fair bit of work to do, as all the paths and variables are a bit different. So you may have some other fundamental changes to make to your install.

1 Like

Ultimately I ended up having to copy the updated script from Coin Cashew and reset the crontab, and now pool vet looks right-

The only issues that still plague my pool are a missing “in” peer on my producer and both nodes just show 0/0 in mempool TX.

check this thread

1 Like

As i mentioned above I ended up changing back to the coin cashew topologyUpdater.sh so for now the thread you mentioned won’t apply. Now everything looks good except for the “in” peer category, I feel like it must be a small setting somewhere.

image

Here is a copy of the most up to date version on coin cashew-

#!/bin/bash

shellcheck disable=SC2086,SC2034

USERNAME=$(whoami)

CNODE_PORT=6000 # must match your relay node port as set in the startup command

CNODE_HOSTNAME=“CHANGE ME” # optional. must resolve to the IP you are requesting from

CNODE_BIN="/usr/local/bin"

CNODE_HOME=$NODE_HOME

CNODE_LOG_DIR="${CNODE_HOME}/logs"

GENESIS_JSON="${CNODE_HOME}/${NODE_CONFIG}-shelley-genesis.json"

NETWORKID=$(jq -r .networkId $GENESIS_JSON)

CNODE_VALENCY=1 # optional for multi-IP hostnames

NWMAGIC=$(jq -r .networkMagic < $GENESIS_JSON)

[[ “${NETWORKID}” = “Mainnet” ]] && HASH_IDENTIFIER="–mainnet" || HASH_IDENTIFIER="–testnet-magic ${NWMAGIC}"

[[ “${NWMAGIC}” = “1097911063” ]] && NETWORK_IDENTIFIER="–mainnet" || NETWORK_IDENTIFIER="–testnet-magic ${NWMAGIC}"

export PATH="${CNODE_BIN}:${PATH}"

export CARDANO_NODE_SOCKET_PATH="${CNODE_HOME}/db/socket"

blockNo=$(/usr/local/bin/cardano-cli query tip ${NETWORK_IDENTIFIER} | jq -r .block )

Note:

if you run your node in IPv4/IPv6 dual stack network configuration and want announced the

IPv4 address only please add the -4 parameter to the curl command below (curl -4 -s …)

if [ “${CNODE_HOSTNAME}” != “CHANGE ME” ]; then

T_HOSTNAME="&hostname=${CNODE_HOSTNAME}"

else

T_HOSTNAME=’’

fi

if [ ! -d ${CNODE_LOG_DIR} ]; then

mkdir -p ${CNODE_LOG_DIR};

fi

curl -s “https://api.clio.one/htopology/v1/?port=${CNODE_PORT}&blockNo=${blockNo}&valency=${CNODE_VALENCY}&magic=${NWMAGIC}${T_HOSTNAME}” | tee -a $CNODE_LOG_DIR/topologyUpdater_lastresult.json

You’ll need to have you node running for a few hours for it to show up in the topology.json file which will let other nodes find you when they update their own topology files.

1 Like

You can use the cntools version of topologyUpdater
Make a simple script
touch WrapperScript.sh
set executable chmod +x …
inside you set the required variables with export VARIABLENAME=value
export ANOTHERRVARIABLE=value2
fullpathtoyourcntoolsUpdater/topologyUpdater.sh
In your cron change the command from the updater to your Wrapper.
How to find out which variables you need to export? Start without any, let cron run the script and check for errors. Depending on your setup they’ll be in your email or logs. If I remember there are only 2 variables needed, the path to socket and path to the db.

1 Like

I finally have things up and running the way they should. I did some work with @Alexd1985 last night
here and he was able to help me determine the no “In” peers problem (port issues).

2 Likes

I did run that yesterday when I updated. I just don’t understand why its not running hourly. I am tempted to revert to the previous version and see if it will work

Check the services for topology updater

  • cnode-tu-push.service : pushes a node alive message to Topology Updater API
  • cnode-tu-push.timer : schedules the push service to execute once every hour
  • cnode-tu-fetch.service : fetches a fresh topology file before cnode.service file is started/restarted
  • cnode-tu-restart.service : handles the restart of cardano-node(cnode.sh)
  • cnode-tu-restart.timer : schedules the cardano-node restart service, default every 24h

sudo systemctl status cnode-tu-push.timer

try to execute the script manually first and check whether it went smoothly or not