Skip to content

Commit c636f95

Browse files
committed
Merge remote-tracking branch 'origin/main' into check-candid-compatibility
2 parents 9eb4746 + c021614 commit c636f95

File tree

5 files changed

+49
-9
lines changed

5 files changed

+49
-9
lines changed

dfx.json

+2
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@
283283
},
284284
"ckbtc_index": {
285285
"type": "custom",
286+
"build": "scripts/build.ckbtc_index.sh",
286287
"candid": "target/ic/ckbtc_index.did",
287288
"wasm": "target/ic/ckbtc_index.wasm",
289+
"init_arg_file": "target/ic/ckbtc_index.args.did",
288290
"specified_id": "mm444-5iaaa-aaaar-qaabq-cai",
289291
"remote": {
290292
"id": {

scripts/build.ckbtc_index.args.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
[[ "${1:-}" != "--help" ]] || {
3+
cat <<-EOF
4+
5+
Populates the ckbtc_index init args file.
6+
7+
# Prerequisites
8+
This is expected to be run via dfx, and in particular that
9+
environment variables provided by dfx are set.
10+
11+
EOF
12+
exit 0
13+
}
14+
set -euxo pipefail
15+
16+
: START populating the ckbtc_index install args file...
17+
ARGS_FILE="$(jq -re .canisters.ckbtc_index.init_arg_file dfx.json)"
18+
mkdir -p "$(dirname "$ARGS_FILE")"
19+
20+
cat <<EOF >"$ARGS_FILE"
21+
(opt variant {
22+
Init = record {
23+
ledger_id = principal \"$CANISTER_ID_CKBTC_LEDGER\";
24+
}
25+
})
26+
EOF
27+
: FINISH populating the ckbtc_index install args file.

scripts/build.ckbtc_index.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
[[ "${1:-}" != "--help" ]] || {
3+
cat <<-EOF
4+
5+
Assembles the ckbtc_index canister deploy artefacts.
6+
7+
# Prerequisites
8+
This is expected to be run by dfx. In particular,
9+
the code that creates the arguments uses environment
10+
variables set by dfx.
11+
12+
EOF
13+
exit 0
14+
}
15+
16+
set -euo pipefail
17+
18+
scripts/download.ckbtc.sh
19+
scripts/build.ckbtc_index.args.sh

scripts/deploy.ckbtc.sh

+1-5
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,7 @@ dfx deploy ckbtc_kyt --specified-id pvm5g-xaaaa-aaaar-qaaia-cai --network "$DFX_
6464
})"
6565

6666
echo "Step 5: deploy index canister..."
67-
dfx deploy ckbtc_index --specified-id mm444-5iaaa-aaaar-qaabq-cai --network "$DFX_NETWORK" --argument "(opt variant {
68-
Init = record {
69-
ledger_id = principal \"$LEDGERID\";
70-
}
71-
})"
67+
dfx deploy ckbtc_index --network "$DFX_NETWORK"
7268

7369
# Example to mint ckBTC
7470

scripts/deploy.sh

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ set -euxo pipefail
44
dfx canister create --all
55
dfx deploy backend
66
dfx deploy signer
7-
8-
mkdir -p ./target/ic
9-
10-
./scripts/download.icp.sh
117
dfx deploy icp_ledger
128
dfx deploy icp_index
139

0 commit comments

Comments
 (0)