Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to provision dummy issuer with wallet #2500

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/canister-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ jobs:
./demos/vc_issuer/provision \
--ii-canister-id fgte5-ciaaa-aaaad-aaatq-cai \
--dfx-network ic \
--issuer-canister v2yvn-myaaa-aaaad-aad4q-cai
--issuer-canister v2yvn-myaaa-aaaad-aad4q-cai \
--wallet "$wallet"

- name: "Deploy archive"
run: scripts/deploy-archive --wasm archive.wasm.gz --canister-id fgte5-ciaaa-aaaad-aaatq-cai --network ic
Expand Down
17 changes: 16 additions & 1 deletion demos/vc_issuer/provision
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Options:
--issuer-canister CANISTER The canister to configure (name or canister ID), defaults to "issuer"
--issuer-derivation-origin URL The issuer's derivation origin, defaults to <issuer-canister-id>.icp0.io
--issuer-frontend-hostname URL The issuer's frontend hostname, defaults to issuer's derivation origin
--wallet CANISTER_ID Optional wallet canister ID to use to configure the issuer, if any.
EOF
}

Expand All @@ -35,6 +36,7 @@ EOF

II_CANISTER_ID=
DFX_NETWORK=
WALLET=

while [[ $# -gt 0 ]]
do
Expand Down Expand Up @@ -70,6 +72,11 @@ do
shift; # shift past --issuer-canister & value
shift;
;;
--wallet)
WALLET="${2:?missing value for '--wallet'}"
shift; # shift past --wallet & value
shift;
;;
*)
echo "ERROR: unknown argument $1"
usage
Expand Down Expand Up @@ -108,5 +115,13 @@ echo "Using II canister: $II_CANISTER_ID" >&2
echo "Using issuer derivation origin: $ISSUER_DERIVATION_ORIGIN" >&2
echo "Using issuer frontend_hostname: $ISSUER_FRONTEND_HOSTNAME" >&2

dfx canister call --network "$DFX_NETWORK" "$ISSUER_CANISTER" configure \
declare -a WALLET_ARG=( )

if [ "$WALLET" ]
then
echo "Using wallet: $WALLET" >&2
WALLET_ARG+=( "--wallet" "$WALLET")
fi

dfx canister call "${WALLET_ARG[@]}" --network "$DFX_NETWORK" "$ISSUER_CANISTER" configure \
'(record { idp_canister_ids = vec{ principal "'"$II_CANISTER_ID"'" }; ic_root_key_der = opt vec '"$rootkey_did"'; derivation_origin = "'"$ISSUER_DERIVATION_ORIGIN"'"; frontend_hostname = "'"$ISSUER_FRONTEND_HOSTNAME"'"})'
Loading