Node Discovery

+2 votes
Guys

Do you have any more information on how nodes discover peers either via other connected peers or using addnode?

For context we are running multiChain nodes within Kubernetes and we need to ensure nodes don't get orphaned from each other on a restart which can cause the nodes to be assigned new IP addresses.  Because of the way Kubernetes works, we can fix the DNS names of the nodes and we experimented with added these across each node using the addnode api call, but these don't seem to persist across restarts.

At the minute we might need to execute addnode at startup of each node, but wanted to check if this was expected behaviour of addnode and any more information on how peer discovery works and any guidelines you might have to ensure the network remains connected across node restarts and changes of node IP addresses?

 

Cheers

Marty
asked Jun 21, 2018 by marty

1 Answer

+1 vote

MultiChain doesn't remember nodes by domain name, only by IP address.

So if your node IP addresses are constantly changing, you could run the risk of losing connections. I would say your best bet is to have one or two nodes with fixed IP addresses, which nodes will always find when they start up. Those fixed nodes can then ensure that all the other nodes find each other.

Your other option of course is to use addnode command to pass a hostname, or indeed the addnode runtime parameter (which can also be fixed in the multichain.conf file for that node).

answered Jun 22, 2018 by MultiChain
...