evaluationcopy / dogecoin-node

Dogecoin Core in a Docker container
MIT License
10 stars 5 forks source link

Unable to connect RPC server #3

Open kadnan opened 2 years ago

kadnan commented 2 years ago

@evaluationcopy

First of all thanks for this image.

I am trying to to connect Doge within PHP. I am getting the following error:

Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 52: Empty reply from server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://127.0.0.1:22556/ in

Why is it sending an empty response? I had not found a dogecoin.conf so I created one in the folder /root/.dogecoin with the following content only:

regtest=1
server=1
rpcuser=rpcuser
rpcpassword=regtest=1
rpcport=22556

And I am initiating the container as docker run -p 22556:22556 --name dogecoin_latest evaluationcopy/dogecoin-node:latest

What am I doing wrong here?

evaluationcopy commented 2 years ago

Your config file is using port 22556 as the rpc port.  Port 22556 is usually the dogecoin port and port 22555 is usually the rpc port.  

My docker image exposes port 22556, but not 22555.  The docker run command will have to be updated in order to expose port 22555..

Instead of running: docker run -p 22556:22556 --name dogecoin_latest evaluationcopy/dogecoin-node:latest

Try something like... docker run -p 22556:22556 -p 22555 --name dogecoin_latest evaluationcopy/dogecoin-node:latest

Of course update the dogecoin.conf to set the rpc port back to 22555.  I'll mention I didn't get to test out the command line above, it's possible more is needed to expose the port as the dockerfile I created exposes port 22556 only.