0

Hi I'm new to rpc curl cmds and having some issues connecting to my regtest node. I'm getting "empty reply from server" which makes me think it is connecting but something is misconfigured.

Looking through various threads here I found similar things but nothing that quite fit the bill, but apologies if this is something that has already been covered.

bitcoin.conf settings

# Options only for regtest
[regtest]
# datadir
datadir=/mnt/mydisk/regtest
# Listen for incoming connections on non-default port.(default: 8333 or testnet: 18333)
port=18444
# RPC allow all IPS (shouldn't have this on mainnet)
rpcallowip=0.0.0.0/0
# RPC bind IP
#rpcbind=192.168.86.30
# RPC port(default:8332 or testnet:18332)
rpcport=18443

my curl cmd returns

curl: (52) Empty reply from server

curl cmd

 curl --user xxxuser:xxxcookie --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;'  http://192.168.86.30:18444/

I'm also seeing this in the debug.log but not sure what it means or how to fix

UPnP: ExternalIPAddress = XX.XXX.XX.XXX
AddLocal(XX.XXX.XX.XXX:18444,3)
AddPortMapping(18444, 18444, 192.168.86.30) failed with code 718 (ConflictInMappingEntry)
UPNP_DeletePortMapping() returned: 606

Also worth noting I have another regtest node and the 2 nodes are connected without issue.

Any help appreciated.

0

You are defining RPC port 18443 and attempting to connect to 18444 in your example.

There's no situation where you should attempt to rpcallowip to anything but localhost, don't get used to doing that or making systems which require it. There is no situation in which this is safe to do, even regtest can cause damage to your system.

6
  • when I change the curl cmd to IP:18443 I get connection refused curl: (7) Failed to connect to 192.168.86.30 port 18443: Connection refused Feb 23 at 21:48
  • You will still be binding the RPC port to localhost irrespective of what the rpcallowip value is set to. The software doesn't make this easy because it's such a poor configuration option, you would have to change rpcbind as well.
    – Claris
    Feb 23 at 21:49
  • ok so I should change rpcallowip to this rpcallowip=127.0.0.1 ? and rpcbind to the local IP of my node? I originally had that but it looked like it was causing issues. should I also rpcallow my local node IP like here? link Feb 23 at 21:57
  • ok that got me connected thanks! this is my updated bitcoin.conf config which works [regtest] # Listen for incoming connections port=18444 # RPC allow all IP rpcallowip=127.0.0.1 rpcallowip=192.168.86.30/24 # RPC bind IP rpcbind=127.0.0.1 rpcbind=192.168.86.30 # RPC port rpcport=18443 Feb 23 at 22:06
  • sorry I know I already accepted this answer, but any insight into the debug.log ConflictInMapping errors? I'm still getting them Feb 23 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.