Connecting a node via a hostname defined in /etc/hosts?

0 votes

For development I'm trying to use a docker cluster to have a master node and several slave nodes. The master node starts perfectly and is running (on port 7447).

On the slave nodes connecting also runs perfectly when using: 

multichaind dockerchain@

I've got no real indication on the IP address of the master node but docker-compose exposes in /etc/hosts on the slave nodes:    masternode

So i've tried running "multichaind dockerchain@masternode:7447", but it gives me


mchn: Could not establish connection with seed node - timeout


Error: Couldn't connect to the seed node masternode on port 7447 - please check multichaind is running at that address and that your firewall settings allow incoming connections.

Now strangely enough, if i first connect using the IP address, then the masternode version works as well.

What am I missing here?

asked Dec 30, 2015 by Roderik

1 Answer

+1 vote

Thanks for reporting this - it's a bug in that we don't permit hostname lookups for seed node addresses, and will be fixed in alpha 15 (alpha 14 is in pre-release checks).

FYI once you're connected to a node you don't need to enter it at all on subsequent calls to multichaind so the  masternode parameter in subsequent calls is not doing anything, which explains why it works :)

answered Dec 30, 2015 by MultiChain
worked around it for now by using:

ip=`getent hosts masternode | awk -F' ' '{print $1}'`
multichaind dockerchain@$ip:7447 -printtoconsole