RPC to multiple nodes

+1 vote
Dear all,

I am trying to set up a system in which I have different nodes all connected to one single chain. I have deployed the docker cluster provided by kunstmaan but I am facing the following problem. I can connect via JSON RPC only to the masternode. The slave nodes can connect to the masternode and publish tx on the chain but I cannot connect to them via RPC.

The problem is either:

1)I cannot connect to the slave node via RPC as the username and password I have specified are in the /root/.multichain/multichain.conf but NOT in the /root/.multichain/$CHAINNAME/multichain.conf

2)if I directly specify username and password and port via multichaind $CHAINNAME -rpcuser= -rpcpassword= etc then I gain connectivity to the slave node but for some strange reason I lose connectivity to the master. This means that if I try to do multichain-cli $CHAINNAME publish stream key1 data1 I got rpc wrong username and password.

I am stuck at this point and hope that you guys can help me a bit.
asked Dec 7, 2017 by anonymous

2 Answers

0 votes

Please search this Q&A forum for rpcallowip – by default nodes only accept incoming API requests from the same local host.

answered Dec 8, 2017 by MultiChain
I am using it as rpcallowip:0.0.0.0/0.0.0.0 as also specified by default in the kunstmaan docker-compose.yml.

The point is that it seems that either the slave node uses the RPC to communicate with the master node or with the user....not both. But I suppose this is not how it works, or should work.
Are both the two nodes running on the same computer, and trying to accept incoming API connections on the same port? If so that could be the problem and you can use the -rpcport runtime parameter to separate them.

In any event please note that nodes do not communicate with each other via RPC, just via the peer-to-peer protocol.
+2 votes
I have finally figured out that while the masternode used the "multichain create" before multichaind it was able to define the values within the multichain.conf.

The other nodes that directly executed multichaind (to connect to the masternode) had their multichain.conf overwritten. Hence what I had to do for those nodes has been to call the "multichain-cli $CHAINNAME stop" change the rpc config file and then run it again.

Now all the nodes can accept RPC rquests as configured in the compose file.

Thanks!
answered Dec 10, 2017 by 84matte84
OK, thanks for the update. We should fix that so that if you have already created a multichain.conf file for the chain, it is not overwritten the first time your node runs for that chain.
...