Skip to content

Commit

Permalink
Rename kyt to checker
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrasinskis committed Dec 10, 2024
1 parent 014a37c commit f5d1b82
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions bin/dfx-ckbtc-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ clap.define short=m long=mode desc="Canister install mode." variable=DFX_MODE de
source "$(clap.build)"

# TODO: Consider using ./bin/dfx-token-deploy for the ledger and index
# canisters. KYT and minter are custom canisters, so they still need to be done
# canisters. CHECKER and minter are custom canisters, so they still need to be done
# here.

: Check preconditions. This is always run.
Expand All @@ -41,23 +41,23 @@ source "$(clap.build)"
deploy_ckbtc() {
# We create some canisters ahead of time because we need to know their IDs
# before deploying. Remaining canisters will be created when deployed.
dfx canister create "${LOCAL_PREFIX}kyt" --network "$DFX_NETWORK" || echo "${LOCAL_PREFIX}kyt canister already exists"
dfx canister create "${LOCAL_PREFIX}checker" --network "$DFX_NETWORK" || echo "${LOCAL_PREFIX}checker canister already exists"
dfx canister create "${LOCAL_PREFIX}ledger" --network "$DFX_NETWORK" || echo "${LOCAL_PREFIX}ledger canister already exists"
dfx canister create "${LOCAL_PREFIX}minter" --network "$DFX_NETWORK" || echo "${LOCAL_PREFIX}minter canister already exists"

KYT_ID="$(dfx canister id "${LOCAL_PREFIX}kyt" --network "$DFX_NETWORK")"
echo "$KYT_ID"
CHECKER_ID="$(dfx canister id "${LOCAL_PREFIX}checker" --network "$DFX_NETWORK")"
echo "$CHECKER_ID"
MINTERID="$(dfx canister id "${LOCAL_PREFIX}minter" --network "$DFX_NETWORK")"
echo "$MINTERID"
LEDGERID="$(dfx canister id "${LOCAL_PREFIX}ledger" --network "$DFX_NETWORK")"
echo "$LEDGERID"

# echo "Step 1: deploying kyt canister..."
# echo "Step 1: deploying checker canister..."
DFX_IDENTITY_PRINCIPAL="$(dfx identity get-principal)"
dfx deploy "${LOCAL_PREFIX}kyt" --network "$DFX_NETWORK" --argument "(variant {
dfx deploy "${LOCAL_PREFIX}checker" --network "$DFX_NETWORK" --argument "(variant {
InitArg = record {
btc_network = variant { mainnet };
kyt_mode = variant { AcceptAll };
checker_mode = variant { AcceptAll };
}
})" --mode="${DFX_MODE}" ${DFX_YES:+--yes} --upgrade-unchanged

Expand All @@ -71,8 +71,8 @@ deploy_ckbtc() {
max_time_in_queue_nanos = 10_000_000_000;
min_confirmations = opt 12;
mode = variant { GeneralAvailability };
kyt_fee = opt 13_333;
kyt_principal = opt principal \"$KYT_ID\";
checker_fee = opt 13_333;
checker_principal = opt principal \"$CHECKER_ID\";
}
})" --mode="${DFX_MODE}" ${DFX_YES:+--yes} --upgrade-unchanged

Expand Down Expand Up @@ -122,7 +122,7 @@ deploy_ckbtc() {
}

check_ckbtc_deployment() {
for canister in kyt ledger minter index; do
for canister in checker ledger minter index; do
: "Verify that the deployed canister matches the local wasm"
dfx-canister-check-wasm-hash --canister "${LOCAL_PREFIX}$canister" --network "$DFX_NETWORK"
done
Expand Down
4 changes: 2 additions & 2 deletions bin/dfx-ckbtc-deploy.test
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ PATH="$SOURCE_DIR:$PATH"
dfx start --clean --background
git checkout dfx.json
dfx-ckbtc-import
dfx canister create "ckbtc_kyt" --no-wallet
dfx canister create "ckbtc_checker" --no-wallet
dfx canister create "ckbtc_ledger" --no-wallet
dfx canister create "ckbtc_minter" --no-wallet
error_log="$(mktemp ,test_log.XXXXXXXX)"
if dfx-ckbtc-deploy --check 2>"$error_log"; then
echo "ERROR: Should fail if ckbtc canisters have the incorrect or no hash"
fi
grep 'ERROR: Deployed ckbtc_kyt hash does not match.' "$error_log" || {
grep 'ERROR: Deployed ckbtc_checker hash does not match.' "$error_log" || {
echo "ERROR: The check should complain about missing canisters."
echo "Actual error output:"
sed 's/^/ /g' "$error_log"
Expand Down
10 changes: 5 additions & 5 deletions bin/dfx-ckbtc-import
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ clap.define long=candid_dir desc="Where to store the imported candid files" vari
source "$(clap.build)"

# TODO: Consider using ./bin/dfx-token-import for the ledger and index
# canisters. KYT and minter are custom canisters, so they still need to be done
# canisters. CHECKER and minter are custom canisters, so they still need to be done
# here.

# Imports wasm, candid and populate dfx.json
Expand All @@ -40,7 +40,7 @@ ckbtc_import() {
WASM_DIR="${WASM_DIR:-}" \
CANDID_DIR="${CANDID_DIR:-}" \
jq -s '{canisters:
{ "\(env.LOCAL_PREFIX)kyt" : { build: "true", candid: "\(env.CANDID_DIR)/\(env.LOCAL_PREFIX)kyt.did", wasm: "\(env.WASM_DIR)/\(env.LOCAL_PREFIX)kyt.wasm", type: "custom", remote: { id: {mainnet: "pjihx-aaaaa-aaaar-qaaka-cai"} }}
{ "\(env.LOCAL_PREFIX)checker" : { build: "true", candid: "\(env.CANDID_DIR)/\(env.LOCAL_PREFIX)checker.did", wasm: "\(env.WASM_DIR)/\(env.LOCAL_PREFIX)checker.wasm", type: "custom", remote: { id: {mainnet: "pjihx-aaaaa-aaaar-qaaka-cai"} }}
, "\(env.LOCAL_PREFIX)ledger": { build: "true", candid: "\(env.CANDID_DIR)/\(env.LOCAL_PREFIX)ledger.did", wasm: "\(env.WASM_DIR)/\(env.LOCAL_PREFIX)ledger.wasm", type: "custom", remote: { id: {mainnet: "mxzaz-hqaaa-aaaar-qaada-cai"} }}
, "\(env.LOCAL_PREFIX)minter": { build: "true", candid: "\(env.CANDID_DIR)/\(env.LOCAL_PREFIX)minter.did", wasm: "\(env.WASM_DIR)/\(env.LOCAL_PREFIX)minter.wasm", type: "custom", remote: { id: {} }}
, "\(env.LOCAL_PREFIX)index" : { build: "true", candid: "\(env.CANDID_DIR)/\(env.LOCAL_PREFIX)index.did", wasm: "\(env.WASM_DIR)/\(env.LOCAL_PREFIX)index.wasm", type: "custom", remote: { id: {mainnet: "n5wcd-faaaa-aaaar-qaaea-cai"} }}
Expand All @@ -58,7 +58,7 @@ ckbtc_import() {
echo "Getting $local_path from $url..."
curl -fsSL "$url" | gunzip >"${local_path}"
}
get_wasm ic-btc-kyt.wasm "${LOCAL_PREFIX}kyt"
get_wasm ic-btc-checker.wasm "${LOCAL_PREFIX}checker"
get_wasm ic-ckbtc-minter.wasm "${LOCAL_PREFIX}minter"
get_wasm ic-icrc1-ledger.wasm "${LOCAL_PREFIX}ledger"
get_wasm ic-icrc1-index-ng.wasm "${LOCAL_PREFIX}index"
Expand All @@ -74,7 +74,7 @@ ckbtc_import() {
echo "Getting $local_path from $url..."
curl -sSLf --retry 5 "$url" -o "$local_path"
}
get_did rs/bitcoin/kyt/btc_kyt_canister.did "${LOCAL_PREFIX}kyt"
get_did rs/bitcoin/checker/btc_checker_canister.did "${LOCAL_PREFIX}checker"
get_did rs/bitcoin/ckbtc/minter/ckbtc_minter.did "${LOCAL_PREFIX}minter"
get_did rs/ledger_suite/icrc1/ledger/ledger.did "${LOCAL_PREFIX}ledger"
get_did rs/ledger_suite/icrc1/index-ng/index-ng.did "${LOCAL_PREFIX}index"
Expand All @@ -85,7 +85,7 @@ ckbtc_import() {
# Checks whether ckbtc canisters have already been installed.
ckbtc_import_check() {
: Verify that all file are present and correct
for canister in kyt minter ledger index; do
for canister in checker minter ledger index; do
: "Check that the config is in dfx.json:"
canister_config="$(n="$LOCAL_PREFIX$canister" jq '.canisters[env.n]' dfx.json)"
[[ "$canister_config" != "null" ]] || {
Expand Down
2 changes: 1 addition & 1 deletion bin/dfx-software-ic-latest
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function downloads_exist() {
"binaries/x86_64-linux/ic-admin.gz" \
"binaries/x86_64-linux/sns.gz" \
"canisters/bitcoin-mock-canister.wasm.gz" \
"canisters/ic-btc-kyt.wasm.gz" \
"canisters/ic-btc-checker.wasm.gz" \
"canisters/ic-ckbtc-minter.wasm.gz" \
"canisters/ic-icrc1-index-ng-u256.wasm.gz" \
"canisters/ic-icrc1-index-ng.wasm.gz" \
Expand Down

0 comments on commit f5d1b82

Please sign in to comment.