Skip to content

Commit b4e7e17

Browse files
Merge pull request #961 from dfinity/Fix_build_script_on_basic_bitcoin_example
chore: Fix broken build script for basic_bitcoin canister
2 parents a41907a + e79533b commit b4e7e17

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

rust/basic_bitcoin/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ reflected in your current balance.
219219
You can also get a range of Bitcoin block headers by using the `get_block_headers`
220220
endpoint on your canister.
221221

222-
Make the call using the command line. Be sure to replace `10` with your desired start height:
222+
In the Candid UI, write the desired start height and optionally end height, and click on "Call":
223+
224+
Alternatively, make the call using the command line. Be sure to replace `10` with your desired start height:
223225

224226
```bash
225227
dfx canister --network=ic call basic_bitcoin get_block_headers "(10: nat32)"

rust/basic_bitcoin/dfx.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,7 @@
1111
{
1212
"name": "candid:service"
1313
}
14-
],
15-
"specified_id": "om77v-qqaaa-aaaap-ahmrq-cai",
16-
"remote": {
17-
"id": {
18-
"ic": "om77v-qqaaa-aaaap-ahmrq-cai",
19-
"playground": "om77v-qqaaa-aaaap-ahmrq-cai"
20-
}
21-
}
14+
]
2215
}
2316
},
2417
"defaults": {
@@ -34,4 +27,4 @@
3427
"args": ""
3528
}
3629
}
37-
}
30+
}

rust/basic_bitcoin/src/basic_bitcoin/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
TARGET="wasm32-unknown-unknown"
5+
CANISTER="basic_bitcoin"
56
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
67

78
pushd $SCRIPT_DIR
@@ -16,5 +17,12 @@ else
1617
cargo build --target $TARGET --release
1718
fi
1819

20+
cargo install ic-wasm --version 0.2.0 --root ./
21+
22+
./bin/ic-wasm \
23+
"$SCRIPT_DIR/../../target/$TARGET/release/$CANISTER.wasm" \
24+
-o "$SCRIPT_DIR/../../target/$TARGET/release/$CANISTER.wasm" \
25+
metadata candid:service -f "$SCRIPT_DIR/basic_bitcoin.did" -v public
26+
1927
popd
2028

0 commit comments

Comments
 (0)