Skip to content

Commit

Permalink
Add dfx deps default init args (#2662)
Browse files Browse the repository at this point in the history
This PR adds default init args for the dfx deps feature. The arg
will disable the captcha, as it is not needed in dev environments.
  • Loading branch information
Frederik Rothenberger authored Oct 18, 2024
1 parent 974f972 commit 14cbf0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,15 @@ function build_canister() {
asset_name="internet_identity_dev.wasm.gz"
wasm_url="https://github.com/dfinity/internet-identity/releases/download/$release/$asset_name"
wasm_hash_url="https://github.com/dfinity/internet-identity/releases/download/$release/$asset_name.sha256"
# init_arg that disables the captcha, appropriate for the dev build
init_arg="(opt record { captcha_config = opt record { max_unsolved_captchas= 50:nat64; captcha_trigger = variant {Static = variant {CaptchaDisabled}}}})"
init_guide="Use '(null)' for sensible defaults. See the candid interface for more details."
metadata_json=$(echo '{}' | jq -cMr \
--arg wasm_url "$wasm_url" \
--arg wasm_hash_url "$wasm_hash_url" \
--arg init_arg "$init_arg" \
--arg init_guide "$init_guide" \
'. | .pullable = { wasm_url: $wasm_url, wasm_hash_url: $wasm_hash_url, dependencies: [], init_guide: $init_guide} ')
'. | .pullable = { wasm_url: $wasm_url, wasm_hash_url: $wasm_hash_url, dependencies: [], init_arg: $init_arg, init_guide: $init_guide} ')
ic-wasm "$canister.wasm" -o "$canister.wasm" metadata dfx -d "$metadata_json" -v public
fi

Expand Down

0 comments on commit 14cbf0f

Please sign in to comment.