Cannot connect to JSON-RPC API

+1 vote
I was trying to call the JSON-RPC api, locally it was fine but over the network it would not connect.
asked Aug 15, 2015 by anonymous

1 Answer

0 votes

If you want to allow non-local RPC connections, use the rpcallowip parameter in the multichain.conf for your blockchain. More information here:

https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File

(MultiChain supports Bitcoin Core's parameters.) 

answered Aug 15, 2015 by MultiChain
Hello,

I tried doing so but still no luck. From network machine I am receiving forbidden as reply.


Node 1(server node) has multichain.conf file contents as
server=1
listen=1
rpctimeout=10
rpcconnect=127.0.0.1
rpcuser=multichainrpc
rpcpassword=my_complex_password
rpcallowip=10.0.0.100 // this is node 1
rpcallowip=10.0.1.100 // this is node 2

When I do RPC from same node (node1) it works fine. But if I use node2 for RPC I get forbidden.

The command I am using for RPC call is
curl --user multichainrpc --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddresses", "params": [] }' -H 'content-type: text/plain;' http://10.0.0.100:2652

my rpc port is 2652
...