How to communicate with the web service #28596

issue Hossein-Teimouri openend this issue on October 5, 2023
  1. Hossein-Teimouri commented at 1:35 pm on October 5, 2023: none

    I am currently connecting to my bitcoin node via the command line for example :

    0bitcoin-cli -named -rpcuser=admin -rpcpassword=1475963-test -rpcport=8332 -rpcwallet=test-01 sendtoaddress address=DMvWAyQUNJeeKr6xJpeXybVYZLi9nT2oze amount=0.1
    

    And now I want to do this through the web service

    0curl --user admin:1475963-test --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendtoaddress", "params": ["DMvWAyQUNJeeKr6xJpeXybVYZLi9nT2oze ", 0.1] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    

    -How should I use -rpcwallet with web service(curl)?

  2. pinheadmz commented at 3:55 pm on October 12, 2023: member

    The wallet name is part of the endpoint URL.

    You may have seen an error message like this:

    0Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).
    

    and so your solution is going to look like this:

    0$ curl u:p@127.0.0.1:18443/wallet/test-01 --data '{"method":"getbalance"}'
    1{"result":0.00000000,"error":null,"id":null}
    
  3. maflcko added the label Questions and Help on Oct 13, 2023
  4. maflcko added the label Wallet on Oct 13, 2023
  5. maflcko added the label RPC/REST/ZMQ on Oct 13, 2023
  6. maflcko commented at 2:15 pm on October 13, 2023: member

    See also doc/JSON-RPC-interface.md.

    I guess it could also be mentioned in each RPC example that accepts a wallet context?

  7. fanquake commented at 11:57 am on October 23, 2023: member
    @Hossein-Teimouri Any followup here? Otherwise I think this can be closed.
  8. pinheadmz commented at 7:46 pm on November 8, 2023: member
    Closing for now, @Hossein-Teimouri feel free to add comments if you are still having trouble. Or ask a question on https://bitcoin.stackexchange.com/
  9. pinheadmz closed this on Nov 8, 2023


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: 2024-06-29 07:13 UTC

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