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"

  • Why are you binding to 0.0.0.0? – Anonymous Feb 12 at 9:46
  • Im testing, will that cause an issue ? – BKCapri Feb 12 at 14:25
  • 1
    What is the curl command that you are using? – Andrew Chow Feb 12 at 15:35
  • Ive used this 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' also swapped it with the Ip still no reply. – BKCapri Feb 12 at 16:04
  • 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 your bitcoind` responded on the RPC port just didn't do anything because it was called incorrectly. – PW Kad Feb 14 at 0:52
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'
  • No luck Note: Unnecessary use of -X or --request, POST is already inferred. – BKCapri Feb 15 at 5:58
  • Yeah was just updating the call you posted in the comment section with the approriate URL. – PW Kad Feb 15 at 15:48

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.