topologyUpdater not working / unexpected token

Hi guys not able to make this topologyUpdater work Guide: How to build a Cardano Stake Pool - CoinCashew

I have created a topologyUpdater.sh file
Copied everything outside the cut command and pasted it in the topologyUpdater.sh file

added permission chmod +x topologyUpdater.sh

but when i try to run ./topologyUpdater.sh I get this error
./topologyUpdater.sh: line 11: syntax error near unexpected token (' ./topologyUpdater.sh: line 11: NETWORKID=$(jq -r .networkId $GENESIS_JSON)’

This is the command on line 11:
NWMAGIC=$(jq -r .networkMagic < $GENESIS_JSON)

Any idea where could be the problem?

Hi!

What I can see is that the env file contains such lines, like:

NETWORKID=$(jq -r .networkId ${GENESIS_JSON})
MAGIC=$(jq -r .protocolMagicId < ${GENESIS_JSON})

env file is called at the beginning of the topologyUpdater.sh, so please share the first 12 lines of the topologyUpdater.sh

After-all I have decided to follow the official guide here guild-operators/topologyupdater.md at alpha · cardano-community/guild-operators · GitHub

cd ~cnode/scripts
curl -s -o topologyUpdater.sh https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/topologyUpdater.sh
curl -s -o env https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/env
chmod 750 topologyUpdater.sh
./topologyUpdater.sh

I have configured the env file to match the files in the relay node
nano env

I have double-checked the topologyUpdater.sh file as well but I did not changed anything.
nano topologyUpdater.sh

But when I run ./topologyUpdater.sh I get
ERROR: Could not parse ~/cnode/config/mainnet-config.json file in JSON format, please double-check the syntax of your config, or simply download it from guild-operators
repository!

When I run command
find -iname mainnet-config.json

First I thought I have accidentally added a bracket or modified the mainnet-config.json so I have redownloaded it from the official guide and renamed the old one to old_ mainnet-config.json but still the ERROR is the same.

So I think the problem is in the path I guess … because when I change the path in ENV to random file that does not exist ~/cnode/config/mhhainnet-config.json the ERROR is the same.

I have already tested this file paths with the same result:
CONFIG="${CNODE_HOME}/cnode/config/mainnet-config.json"
CONFIG="~/cnode/config/mainnet-config.json"
CONFIG="/cnode/config/mainnet-config.json"
CONFIG="./cnode/config/mainnet-config.json"
CONFIG="/home/config/mainnet-config.json"

Every time the same ERROR occurs Could not parse /home/config/mainnet-config.json file in JSON format, please double-check the syntax of your config, or simply download it from guild-operators repository!

Sorry I think this is trivial problem, but do you have any idea what am I doing wrong?

OK I think I found the problem with help of Lauris from Stakepool247

The problem was in the PATH
I typed in the terminal cd && pwd && whoami and found out the full path should be:
CNODE_HOME="/home/marek_kalina/cnode"
CONFIG="/home/marek_kalina/cnode/config/mainnet-config.json"

And finally received message with no ERROR but this instead:
{ “resultcode”: “201”, “datetime”:“2021-03-26 10:27:07”, “clientIp”: “35.184.159.170”, “iptype”: 4, “msg”: “nice to meet you” }

Hallelujah :pray:
Now lets move on to the cron jobs