Multichain & Docker: peer discovery not working

+4 votes
Hi.

Is it possible to tell Multichain what ip and port it should exchange as endpoint information to other nodes?

The peer discovery and exchange does not work when running inside a docker container since it seems that the nodes exchange the wrong ip address and port that is not accessible form outside the container because the container ip != public ip and the container p2p port != the external mapped p2p port.

 

I can connect nodes manually but it seems they cannot share node information to get fully connected.

 

What is the parameter -externalip for example?

 

Greetings,

Alex
asked Mar 23, 2017 by Alexoid

1 Answer

0 votes

The externalip option should indeed fix this for you – please let us know how you get on.

answered Mar 24, 2017 by MultiChain
Hi.

But what about the port?
Multichain seems to only know about the docker internal port and propagate this one, but externally this is of course mapped to another port of the host system.

So there should also be some kind of setting like: -externalP2Pport otherwise maybe it shares the correct public ip, but the wrong internal port.
The request makes sense, but it's not possible to do this yet. We'll aim to provide a solution for this in the next release (beta 1, coming soon).
Hi.

Are there any news yet?

[EDIT]
Just red: "Allowed a port to be specified in the externalip runtime parameter"

Thanks, guys! :-)
Yes, sorry we forgot to mention it here. Let us know if it works for you.
Don't forget to change the help text of multichaind:
" -externalip=<ip>       Specify your own public address"

I assume it is called like:
-externalip=123.123.123.123:1234
Seems to work. The nodes running in docker get fully connected.
Great - thanks for the update.
Apologies for digging up this old thread.

I am facing about the same issue as well but mine is because of NAT. I have tried -externalip with IP address and port number but the peer node tries to re-establish the connection with the correct IP address but uses the mulithchain network port and not the port specified in -externalip.

Is there another switch that can be applied to multichaind for version 1.0.8?
You can use the addnode API command to connect to an explicit IP address and port number of another node.
...