Updated the Production node by mistake in the Topology section

Hi, I have made a mistake by updating my Production node in the " Configuring Network Topology" section. I opened my topology file in the Production node and I see this:

 "resultcode": "402", "datetime":"2023-04-24 18:11:21", "clientIp": "PRODUCTION NODE ADDRESS", "iptype": 4, "msg": "IP is not (yet) allowed to fetch this list",  "Producers": [   { "addr": "PRODUCTION NODE ADDRESS", "port": 6000, "valency": 1 } ,
  { "addr": "relays-new.cardano-mainnet.iohk.io", "port": 3001, "valency": 2 } , { "addr": "relays-new.cardano-mainnet.iohk.io", "port": 3001, "valency": 2 } ]  }

shall I go ahead and change it to: 
{

"Producers": [

{

"addr": "RELAY NODE ADDRESS",

"port": 6000,

"valency": 1

}

appreceate any help available… My node is up and running and my stake pool is fully registered almost near minting blocks!

]

}

I ran this on PRODUCTION NODE by mistake:

###
cat > $NODE_HOME/topologyUpdater.sh << EOF
#!/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}/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}" = "764824073" ]] && 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
EOF

AND THIS ONE:

cd $NODE_HOME
chmod +x topologyUpdater.sh
./topologyUpdater.sh

AND THIS ONE:

cat > $NODE_HOME/relay-topology_pull.sh << EOF
#!/bin/bash
BLOCKPRODUCING_IP=
BLOCKPRODUCING_PORT=6000
curl -s -o $NODE_HOME/topology.json “https://api.clio.one/htopology/v1/fetch/?max=20&customPeers=\${BLOCKPRODUCING_IP}:\${BLOCKPRODUCING_PORT}:1|relays-new.cardano-mainnet.iohk.io:3001:2
EOF

AND THIS ONE:

chmod +x relay-topology_pull.sh
./relay-topology_pull.sh

THANKFULLY I DIDN’T RUN THIS ONE:!!

cat > $NODE_HOME/crontab-fragment.txt << EOF
33 * * * * ${NODE_HOME}/topologyUpdater.sh
EOF
crontab -l | cat - ${NODE_HOME}/crontab-fragment.txt > ${NODE_HOME}/crontab.txt && crontab ${NODE_HOME}/crontab.txt
rm ${NODE_HOME}/crontab-fragment.txt

Not a big issue… rewrite ur topology file only with your relays (restart the not if its the case) and thats all
u can also check if u added some task on crontab

crontab -e

I thought I need to change the topology on my Production Node and not the relay! Since I should have ran all these on the relays and the relays look like they are good with these new commands that I ran later. However the Production Topology.json looks so off!

my tmp/crontab.v24gH%/crontab on Production Node has nothing but comments and I believe its all fine

the crontab on Relay looks like this:

33 * * * * /home/cardano/cardano-my-node/topologyUpdater.sh

1 Like

The topology.json on Production Node looks like this:

“resultcode”: “402”, “datetime”:“2023-04-24 18:11:21”, “clientIp”: “PRODUCTION NODE ADDRESS”, “iptype”: 4, “msg”: “IP is not (yet) allowed to fetch this list”, “Producers”: [ { “addr”: “PRODUCTION NODE ADDRESS”, “port”: 6000, “valency”: 1 } ,
{ “addr”: “relays-new.cardano-mainnet.iohk.io”, “port”: 3001, “valency”: 2 } , { “addr”: “relays-new.cardano-mainnet.iohk.io”, “port”: 3001, “valency”: 2 } ] }

Shouldn’t it be like:

{
“Producers”: [
{
“addr”: “RELAY NODE ADDRESS”,
“port”: 6000,
“valency”: 1
}

what is the syntax that I can check to see if my Production Node sees my Relay Node(s) and vise versa

Yes, I told u above to rewrite back the topology file

what is the syntax that I can check to see if my Production Node sees my Relay Node(s) and vise versa

Inside glive press P and u should see the Relay IP as IN (i) and OUT (o) peer

1 Like

Thanks I got it now! at first I thought you mentioned to change the topology of “Relays” so I got confused. I changed it.

also found the info in the ./gLiveView thanks a lot.

Appreciated it.

Cheers

1 Like