Skip to content

Commit

Permalink
Merge pull request #961 from dfinity/Fix_build_script_on_basic_bitcoi…
Browse files Browse the repository at this point in the history
…n_example

chore: Fix broken build script for basic_bitcoin canister
  • Loading branch information
dragoljub-duric authored Sep 3, 2024
2 parents a41907a + e79533b commit b4e7e17
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion rust/basic_bitcoin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
11 changes: 2 additions & 9 deletions rust/basic_bitcoin/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -34,4 +27,4 @@
"args": ""
}
}
}
}
8 changes: 8 additions & 0 deletions rust/basic_bitcoin/src/basic_bitcoin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit b4e7e17

Please sign in to comment.