diff --git a/rust/basic_bitcoin/README.md b/rust/basic_bitcoin/README.md index 437a42715..edb6d2f2c 100644 --- a/rust/basic_bitcoin/README.md +++ b/rust/basic_bitcoin/README.md @@ -219,7 +219,9 @@ reflected in your current balance. You can also get a range of Bitcoin block headers by using the `get_block_headers` endpoint on your canister. -Make the call using the command line. Be sure to replace `10` with your desired start height: +In the Candid UI, write the desired start height and optionally end height, and click on "Call": + +Alternatively, make the call using the command line. Be sure to replace `10` with your desired start height: ```bash dfx canister --network=ic call basic_bitcoin get_block_headers "(10: nat32)" diff --git a/rust/basic_bitcoin/dfx.json b/rust/basic_bitcoin/dfx.json index 40ccfeb2e..9246f49ad 100644 --- a/rust/basic_bitcoin/dfx.json +++ b/rust/basic_bitcoin/dfx.json @@ -11,14 +11,7 @@ { "name": "candid:service" } - ], - "specified_id": "om77v-qqaaa-aaaap-ahmrq-cai", - "remote": { - "id": { - "ic": "om77v-qqaaa-aaaap-ahmrq-cai", - "playground": "om77v-qqaaa-aaaap-ahmrq-cai" - } - } + ] } }, "defaults": { @@ -34,4 +27,4 @@ "args": "" } } -} +} \ No newline at end of file diff --git a/rust/basic_bitcoin/src/basic_bitcoin/build.sh b/rust/basic_bitcoin/src/basic_bitcoin/build.sh index 4ecc823a6..19dd5f885 100755 --- a/rust/basic_bitcoin/src/basic_bitcoin/build.sh +++ b/rust/basic_bitcoin/src/basic_bitcoin/build.sh @@ -2,6 +2,7 @@ set -euo pipefail TARGET="wasm32-unknown-unknown" +CANISTER="basic_bitcoin" SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" pushd $SCRIPT_DIR @@ -16,5 +17,12 @@ else cargo build --target $TARGET --release fi +cargo install ic-wasm --version 0.2.0 --root ./ + +./bin/ic-wasm \ + "$SCRIPT_DIR/../../target/$TARGET/release/$CANISTER.wasm" \ + -o "$SCRIPT_DIR/../../target/$TARGET/release/$CANISTER.wasm" \ + metadata candid:service -f "$SCRIPT_DIR/basic_bitcoin.did" -v public + popd