Bitcoin curl no reply

0

Hi I have made a curl to my server but get no reply . What am a missing

 rpcuser=rpcusername
 rpcpassword=rpcpassword
 rpcauth=rpcusername:generatedkey
 daemon=1
 server=1
 rpcport=8332
 rpcbind=0.0.0.0:8332
 rpcallowip=0.0.0.0/0
 listen=1
 rpcconnect=0.0.0.0
 prune=10000

Whats strange is that it worked on another server. Why am I bot getting any reply. Bitcoin cli commands all work well . I get no reply not even the usual "empty reply"

BKCapri

Posted 2019-02-12T09:32:46.447

Reputation: 1

Why are you binding to 0.0.0.0?Anonymous 2019-02-12T09:46:42.010

Im testing, will that cause an issue ?BKCapri 2019-02-12T14:25:35.547

1What is the curl command that you are using?Andrew Chow 2019-02-12T15:35:37.040

Ive used this curl --digest -u rpcusername:rpcpassword -X POST http://127.0.0.1:8332/json_rpc -d "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"getwalletinfo\"}" -H 'Content-Type:application/json' also swapped it with the Ip still no reply.

BKCapri 2019-02-12T16:04:57.870

Are you sure the chain is fully synced? Also add curl -v the -v flag is verbose and will help you a bit more when debugging. Not an empty reply means that yourbitcoind` responded on the RPC port just didn't do anything because it was called incorrectly.PW Kad 2019-02-14T00:52:04.993

Answers

0

You are trying to call the RPC interface incorrectly. Your curl -

$ curl --digest -u rpcusername:rpcpassword -X POST 127.0.0.1:8332/json_rpc -d "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"getwalletinfo\"}" -H 'Content-Type:application/json'

has an incorrect path 127.0.0.1:8332/json_rpc you are posting to. You should create your curl request with the following path - 127.0.0.1:8332/.

Working example, printing verbosely with -v

$ curl -v --digest -u rpcusername:rpcpassword -X POST 127.0.0.1:8332/ -d "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"getwalletinfo\"}" -H 'Content-Type:application/json'

PW Kad

Posted 2019-02-12T09:32:46.447

Reputation: 141

No luck Note: Unnecessary use of -X or --request, POST is already inferred.BKCapri 2019-02-15T05:58:47.787

Yeah was just updating the call you posted in the comment section with the approriate URL.PW Kad 2019-02-15T15:48:08.730