Configuring Network Topology / How do i know if i have two nodes running on nr-server?

This is how my live view looks like, with two windows. in one of the windows i have 1 incoming & 50 outgoing connections. The other window have 0 incomming & 50 outgoing connections.

Is this right? See screenshot

In the bp-server topology file, it looks like this:

{
  "Producers": [
    {
      "addr": "x.x.x.x",
      "port": 6000,
      "valency": 1
    }
  ]
}

Best regards,

ok, for BP (other topic) is fine… now for relays you need to setup the topology updater script

but only this step:
Create the topologyUpdater.sh script which publishes your node information to a topology fetch list.

Ignore this step Updating Topology Files on a Relay NodeUpdating Topology Files on a Relay Node

(because u are running p2p) and you will not want to overwrite your topology file each time when the node is restarted

and I believe you should use inside topology file (Relays) "useLedgerAfterSlot": 0

Ok, i have changed the "useLedgerAfterSlot": 0 to 0.

This step: Create the topologyUpdater.sh script which publishes your node information to a topology fetch list.

-Where it says (change me) in this line below, should i set the IP of my bp-server there or nr-server?:

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


-Where it says “mainnet” & --mainnet & --testnet-magic in this line below, should i change or remove somethings?:

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


-Where it says --mainnet & --testnet-magic in this line below, should i change or remove somethings?:

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


Should i delete the lines in the end, where it says #Note:
#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 …)


command:

On relaynode1

cat > $NODE_HOME/topologyUpdater.sh << EOF
#!/bin/bash

shellcheck disable=SC2086,SC2034

USERNAME=$(cardano)
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

Best regards,

I am pretty sure i should put my relay Ip , where the command says Hostname.

The only question is, all the places where the command says “mainnet” or “–mainnet” & “–testnet-magic”, Should i alter them ?

Best regards,

Nope, u shouldn’t put the IP, is for DNS purpose… let it default… regarding the magic number I’m not sure if u need to do something… there are only mainnet and testnet available…. Just run the script and check the message received

1 Like

There was no msg, seems like it worked.

Best regards,

ok, then set the crontab to run each hour and wait for more hours (min 24) … if everything is fine you should see more IN peers

good day,

where do i set the crontab?

Best regards.

I gave u the link from coincashew above, there is also how to add the script to crontab

1 Like

Thank you, i missed that the first time. Now it is done without problem.

Best regards,

1 Like

Should i update Topology Files on a Relay Node, after 4h ?

Create relay-topology_pull.sh script which fetches your relay node buddies and updates your topology file. Update with your block producer’s IP address.

Best regards,

Good day,

I still have just one incoming connection on my relay, after more then 24h.
Where should i start to search for something fishy?

Best regards,