Confusion in testing RPC and curl #28382

issue zzylmt opened this issue on September 1, 2023
  1. zzylmt commented at 5:02 AM on September 1, 2023: none

    Please forgive the ignorance of a beginner.

    I started a test network (bitcoind -testnet rpcuser=zz)

    When I runbitcoin-cli -testnet getbestblockhash, everything works fine and I get the correct message, but when I run curl --user zz --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbestblockhash", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:18332/

    And I can't get any feedback.

    Can anyone help me with the reason for this?

    Is curltest necessary to change "id":"curltest" if I am starting the main network (bitcoind rpcuser=zz)?

    Should I follow the port shown at https://developer.bitcoin.org/reference/rpc/getbestblockhash.html for the run, or should it depend on what I'm running on?

  2. maflcko commented at 7:00 AM on September 1, 2023: member

    You'll have to pass the cookie password from the .cookie file, or create an rpcauth user-password pair via the rpcauth.py helper script. See also the help bitcoind -help (-rpcauth and -rpccookiefile)

  3. maflcko commented at 7:01 AM on September 1, 2023: member

    Usually the issue tracker is used to track technical issues related to the Bitcoin Core code base. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange or the #bitcoin IRC channel on Libera Chat.

  4. maflcko closed this on Sep 1, 2023

  5. bitcoin locked this on Aug 31, 2024
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 09:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me