RPC getblockfrompeer returns an error with bitcoin-cli #24943

issue mbh86 openend this issue on April 22, 2022
  1. mbh86 commented at 8:03 am on April 22, 2022: none

    I encounter an error with new command getblockfrompeer.

    0bitcoin-cli getblockfrompeer "000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf" 0
    1error code: -1
    2error message:
    3JSON value is not an integer as expected
    

    It’s working with curl:

    0curl -v --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockfrompeer", "params": ["000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf", 0] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    

    I use the version bitcoin-core-23.0/test.rc5/bitcoin-23.0rc5-arm64-apple-darwin.dmg

  2. mbh86 added the label Bug on Apr 22, 2022
  3. jonatack commented at 10:36 am on April 22, 2022: member

    @mbh86

    A couple possible issues:

    • maybe you didn’t run the CLI command from the right directory (e.g. I can reproduce your issue by running it in v0.18 client side with v23 running server side, whereas with v23 you should see “Block already downloaded”); you can check the bitcoind version of the directory you’re in by running bitcoin-cli -version
    • the error message itself isn’t ideal for a bitcoin-cli call; #24944 improves that and adds test coverage for invalid arguments
  4. MarcoFalke commented at 11:20 am on April 22, 2022: member
    What is bitcoin-cli -version?
  5. MarcoFalke removed the label Bug on Apr 22, 2022
  6. MarcoFalke added the label Questions and Help on Apr 22, 2022
  7. mbh86 commented at 11:35 am on April 22, 2022: none

    Hi @jonatack, Thanks a lot for your feedback and helpful info!

    Yes you are right, I have the wrong version of bitcoind:

    0$ bitcoin-cli -version
    1Bitcoin Core RPC client version v22.0.0
    

    It seems there are no bitcoin-cli built in the dmg file. So either I have to configure & build it for v23 for now or wait for official release with homebrew for example.

  8. achow101 deleted a comment on Apr 27, 2022
  9. MarcoFalke commented at 6:35 am on April 27, 2022: member
    Can this be closed, given that we have no influence over homebrew?
  10. MarcoFalke closed this on Apr 27, 2022

  11. fanquake commented at 6:47 am on April 27, 2022: member

    over homebrew?

    Looks like it has been bumped to 23.0 there now in any case: https://github.com/Homebrew/homebrew-core/pull/100174.

  12. mbh86 commented at 8:13 am on April 27, 2022: none
    Thanks @fanquake and all of you, solved as expected :)
  13. DrahtBot locked this on Apr 27, 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-07-05 22:12 UTC

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