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,