examples icon indicating copy to clipboard operation
examples copied to clipboard

[Bug] basic_bitcoin example didn't work on dfx 0.17.0-0.18.0

Open bezrazli4n0 opened this issue 11 months ago • 0 comments

Overview

When building and deploying the basic_bitcoin canister to local bitcoin regtest node, calls to the get_balance and get_utxos functions return 0 in all cases, but bitcoin-cli returns correct values.

UPD. How to fix

Issue fixed with dfx argument --enable-bitcoin instead of --bitcoin-node, full command dfx start --clean --enable-bitcoin. Also required version is 0.17.0.

System

dfx: 0.17.0 os: Apple M1 Pro, Sonoma 14.4 rust(with basic_bitcoin toolchain override): rustc 1.68.0 (2c8cc3432 2023-03-06) rust: rustc 1.76.0 (07dca489a 2024-02-04)

Steps to reproduce

  1. Build with build.sh in basic_bitcoin src root.
  2. Start dfx node with bitcoin support: dfx start --clean --bitcoin-node 127.0.0.1:18443(optionally change ip:port to your bitcoin node)
  3. Deploy binary via Makefile(in basic_bitcoin root - dfx deploy basic_bitcoin --argument '(variant { regtest })')
  4. Fund some address with bitcoins(generatetoaddress RPC), then call dfx canister call basic_bitcoin get_utxos '("BITCOIN_ADDRESS")' to get utxos. In my case it returns 0, but actually bitcoin-cli returns correct values.

Screenshots

Example

image

image

image

bezrazli4n0 avatar Mar 13 '24 13:03 bezrazli4n0