From 40e23184ad823d2f6c1cb86b8c217fc10ac11e7e Mon Sep 17 00:00:00 2001 From: Kent Bull Date: Tue, 14 May 2024 10:27:42 -0600 Subject: [PATCH] test: finish off rotate-out-and-in script --- .../demo/basic/multisig-rotate-out-and-in.sh | 311 +++++++++++++++--- .../demo/basic/multisig-rotation-in-third.sh | 15 +- scripts/demo/basic/stooges-join-rotate.sh | 4 +- src/keri/app/cli/commands/multisig/join.py | 21 +- 4 files changed, 290 insertions(+), 61 deletions(-) diff --git a/scripts/demo/basic/multisig-rotate-out-and-in.sh b/scripts/demo/basic/multisig-rotate-out-and-in.sh index 2d0d30725..711526344 100755 --- a/scripts/demo/basic/multisig-rotate-out-and-in.sh +++ b/scripts/demo/basic/multisig-rotate-out-and-in.sh @@ -1,8 +1,22 @@ #!/bin/bash -# Creates three AIDs, larry, moe, and curly. -# Then, creates a multisig AID, threestooges, with larry and moe. -# Later, curly is rotated into the threestooges AID. -# Finally, larry is rotated out of the threestooges AID. +# multisig-rotate-out-and-in.sh +# This file is self contained except for the keystore initialization config file. +# The inception configuration and multisig configuration files are included in the script +# as here docs. +# +# Required services: +# - KERI witness demo nodes running. +# Use the `kli witness demo` command +# - vLEI schema server running. +# Use the `vLEI-server -s ./schema/acdc -c ./samples/acdc/ -o ./samples/oobis/` command. + + +# This script creates four AIDs, larry, moe, curly, and alfred. +# Next, creates a multisig AID, threestooges, with larry and moe. +# curly is then rotated into the threestooges AID. +# larry is rotated out of the threestooges AID. +# alfred is rotated into the threestooges AID. + # Pull in colored text source "${KERI_SCRIPT_DIR}"/demo/basic/script-utils.sh @@ -11,12 +25,14 @@ source "${KERI_SCRIPT_DIR}"/demo/basic/script-utils.sh export LARRY=EKZYoeLcSpoBn7DdD0Rugk3xGy6in8zJvhJpMhZ23ETe export MOE=EJ__4LOcMfGRU0V65ywo9GgczMkqTZtgjmCKWU06MDQR export CURLY=EItXS2M_iaQvYRex9swUaCWLETsxFdQbQD0XZmbukKOV +export ALFRED=ECl8nwhRYub9Se_Caes40ex0vJXi9v84CaydEalEZgH3 # Witness prefix export WAN_WITNESS_PREFIX=BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha - -# Step 1/5 Create AIDs +echo +print_yellow "Step 1/9 Create AIDs larry, moe, curly, and alfred" +echo # store multisig-stooge.json as a variable read -r -d '' STOOGE_ICP_CONFIG_JSON << EOM @@ -31,7 +47,7 @@ read -r -d '' STOOGE_ICP_CONFIG_JSON << EOM } EOM -print_lcyan "Using AID config file:" +print_lcyan "Using temporary AID config file heredoc:" print_lcyan "${STOOGE_ICP_CONFIG_JSON}" # create temporary file to store json @@ -41,8 +57,9 @@ temp_icp_config=$(mktemp) echo "$STOOGE_ICP_CONFIG_JSON" > "$temp_icp_config" echo -print_yellow "Individual AID creation with file: ${KERI_DEMO_SCRIPT_DIR}/data/multisig-stooge.json" -# Larry Prefix EKZYoeLcSpoBn7DdD0Rugk3xGy6in8zJvhJpMhZ23ETe +print_yellow "Individual AID creation with temp config file." +print_green "larry: ${LARRY}" +# larry Prefix EKZYoeLcSpoBn7DdD0Rugk3xGy6in8zJvhJpMhZ23ETe kli init --name larry \ --salt 0ACDEyMzQ1Njc4OWxtbm9aBc \ --passcode "DoB26Fj4x9LboAFWJra17O" \ @@ -52,7 +69,8 @@ kli incept --name larry --alias larry \ --passcode "DoB26Fj4x9LboAFWJra17O" \ --file "${temp_icp_config}" -# Moe Prefix EJ__4LOcMfGRU0V65ywo9GgczMkqTZtgjmCKWU06MDQR +# moe Prefix EJ__4LOcMfGRU0V65ywo9GgczMkqTZtgjmCKWU06MDQR +print_green "moe: ${MOE}" kli init --name moe \ --salt 0ACDEyMzQ1Njc4OWdoaWpsaw \ --passcode "DoB26Fj4x9LboAFWJra17O" \ @@ -62,7 +80,8 @@ kli incept --name moe --alias moe \ --passcode "DoB26Fj4x9LboAFWJra17O" \ --file "${temp_icp_config}" -# Curly Prefix EItXS2M_iaQvYRex9swUaCWLETsxFdQbQD0XZmbukKOV +# curly Prefix EItXS2M_iaQvYRex9swUaCWLETsxFdQbQD0XZmbukKOV +print_green "curly: ${CURLY}" kli init --name curly \ --salt 0ACDEyMzQ1Njc4OWdoaWpsaw \ --passcode "DoB26Fj4x9LboAFWJra17O" \ @@ -73,41 +92,82 @@ kli incept --name curly --alias curly \ --file "${temp_icp_config}" echo +# alfred Prefix EItXS2M_iaQvYRex9swUaCWLETsxFdQbQD0XZmbukKOV +print_green "alfred: ${ALFRED}" +kli init --name alfred \ + --salt 0ACDEyMzQ1Njc4OWdoaWpsaw \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --config-dir "${KERI_SCRIPT_DIR}" \ + --config-file demo-witness-oobis +kli incept --name alfred --alias alfred \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --file "${temp_icp_config}" +echo + rm "$temp_icp_config" +echo +print_yellow "Step 2/9 Add contacts with OOBIs using 'wan' as the witness" +echo -# Step 2/5 Add contacts with OOBIs echo -print_yellow "Resolve OOBIs" +print_yellow "Resolve OOBIs between all participants (8 total)" +print_yellow "larry -> {moe, curly, alfred}" kli oobi resolve --name larry --oobi-alias moe \ --passcode "DoB26Fj4x9LboAFWJra17O" \ - --oobi http://127.0.0.1:5642/oobi/$MOE/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha + --oobi http://127.0.0.1:5642/oobi/$MOE/witness/$WAN_WITNESS_PREFIX kli oobi resolve --name larry --oobi-alias curly \ --passcode "DoB26Fj4x9LboAFWJra17O" \ - --oobi http://127.0.0.1:5642/oobi/$CURLY/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha + --oobi http://127.0.0.1:5642/oobi/$CURLY/witness/$WAN_WITNESS_PREFIX +kli oobi resolve --name larry --oobi-alias alfred \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --oobi http://127.0.0.1:5642/oobi/$ALFRED/witness/$WAN_WITNESS_PREFIX +print_yellow "moe -> {larry, curly, alfred}" kli oobi resolve --name moe --oobi-alias larry \ --passcode "DoB26Fj4x9LboAFWJra17O" \ - --oobi http://127.0.0.1:5642/oobi/$LARRY/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha + --oobi http://127.0.0.1:5642/oobi/$LARRY/witness/$WAN_WITNESS_PREFIX kli oobi resolve --name moe --oobi-alias curly \ --passcode "DoB26Fj4x9LboAFWJra17O" \ - --oobi http://127.0.0.1:5642/oobi/$CURLY/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha + --oobi http://127.0.0.1:5642/oobi/$CURLY/witness/$WAN_WITNESS_PREFIX +kli oobi resolve --name moe --oobi-alias alfred \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --oobi http://127.0.0.1:5642/oobi/$ALFRED/witness/$WAN_WITNESS_PREFIX +print_yellow "curly -> {larry, moe, alfred}" kli oobi resolve --name curly --oobi-alias larry \ --passcode "DoB26Fj4x9LboAFWJra17O" \ - --oobi http://127.0.0.1:5642/oobi/$LARRY/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha + --oobi http://127.0.0.1:5642/oobi/$LARRY/witness/$WAN_WITNESS_PREFIX kli oobi resolve --name curly --oobi-alias moe \ --passcode "DoB26Fj4x9LboAFWJra17O" \ - --oobi http://127.0.0.1:5642/oobi/$MOE/witness/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha + --oobi http://127.0.0.1:5642/oobi/$MOE/witness/$WAN_WITNESS_PREFIX +kli oobi resolve --name curly --oobi-alias alfred \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --oobi http://127.0.0.1:5642/oobi/$ALFRED/witness/$WAN_WITNESS_PREFIX + +print_yellow "alfred -> {larry, moe, curly}" +kli oobi resolve --name alfred --oobi-alias larry \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --oobi http://127.0.0.1:5642/oobi/$LARRY/witness/$WAN_WITNESS_PREFIX +kli oobi resolve --name alfred --oobi-alias moe \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --oobi http://127.0.0.1:5642/oobi/$MOE/witness/$WAN_WITNESS_PREFIX +kli oobi resolve --name alfred --oobi-alias curly \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --oobi http://127.0.0.1:5642/oobi/$CURLY/witness/$WAN_WITNESS_PREFIX + echo -# Step 3/5 Create multisig AID echo -print_yellow "Multisig Inception for alias: threestooges with Larry and Moe" -print_yellow "Multisig Inception with file: ${KERI_DEMO_SCRIPT_DIR}/data/multisig-two-stooges.json" +print_yellow "Step 3/9 Create multisig AID with larry and moe as participants" +echo + +echo +print_yellow "Multisig Inception for alias: threestooges with larry and moe" # store multisig-two-stooges.json as a variable +print_yellow "Multisig Inception temp config file." read -r -d '' MULTISIG_ICP_CONFIG_JSON << EOM { "aids": [ @@ -122,7 +182,7 @@ read -r -d '' MULTISIG_ICP_CONFIG_JSON << EOM } EOM -print_lcyan "Using multisig config file:" +print_lcyan "Using temporary multisig config file as heredoc:" print_lcyan "${MULTISIG_ICP_CONFIG_JSON}" # create temporary file to store json @@ -132,69 +192,103 @@ temp_multisig_config=$(mktemp) echo "$MULTISIG_ICP_CONFIG_JSON" > "$temp_multisig_config" # Follow commands run in parallel -print_yellow "Multisig Inception for Larry: ${LARRY}" +print_yellow "Multisig Inception from larry: ${LARRY}" kli multisig incept --name larry --alias larry \ --passcode "DoB26Fj4x9LboAFWJra17O" \ --group "threestooges" \ - --file "${KERI_DEMO_SCRIPT_DIR}/data/multisig-two-stooges.json" & + --file "${temp_multisig_config}" & pid=$! PID_LIST+=" $pid" sleep 1 echo -print_yellow "Multisig Inception for Moe: ${MOE}" +print_yellow "Multisig Inception from moe: ${MOE}" kli multisig incept --name moe --alias moe \ --passcode "DoB26Fj4x9LboAFWJra17O" \ --group "threestooges" \ - --file "${KERI_DEMO_SCRIPT_DIR}/data/multisig-two-stooges.json" & + --file "${temp_multisig_config}" & pid=$! PID_LIST+=" $pid" sleep 1 echo -print_yellow "Multisig Inception - wait" +print_yellow "Multisig Inception {larry, moe} - wait for signatures" echo wait $PID_LIST rm "$temp_multisig_config" # Check status for larry -print_yellow "Check multisig status for Larry" +print_yellow "Check multisig status for larry" kli status --name larry --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" -# Step 4/5 rotate each individual keystore - required prior to performing rotation echo -print_yellow "Rotate each individual keystore" -kli rotate --name larry --alias larry --passcode "DoB26Fj4x9LboAFWJra17O" -kli rotate --name moe --alias moe --passcode "DoB26Fj4x9LboAFWJra17O" -kli rotate --name curly --alias curly --passcode "DoB26Fj4x9LboAFWJra17O" +print_yellow "Step 4/9 rotate each individual keystore and update keystate - required prior to performing rotation" +echo + +function rotate_individual_aids() { + echo + print_yellow "Rotate each individual keystore" + kli rotate --name larry --alias larry --passcode "DoB26Fj4x9LboAFWJra17O" + kli rotate --name moe --alias moe --passcode "DoB26Fj4x9LboAFWJra17O" + kli rotate --name curly --alias curly --passcode "DoB26Fj4x9LboAFWJra17O" + kli rotate --name alfred --alias alfred --passcode "DoB26Fj4x9LboAFWJra17O" +} + +function query_keystate_all_participants() { + echo + print_yellow "Pull key state in from other multisig group participant identifiers" + print_yellow "larry -> {moe, curly, alfred}" + kli query --name larry --alias larry --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $MOE + kli query --name larry --alias larry --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $CURLY + kli query --name larry --alias larry --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $ALFRED + + print_yellow "moe -> {larry, curly, alfred}" + kli query --name moe --alias moe --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $LARRY + kli query --name moe --alias moe --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $CURLY + kli query --name moe --alias moe --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $ALFRED + + print_yellow "curly -> {larry, moe, alfred}" + kli query --name curly --alias curly --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $LARRY + kli query --name curly --alias curly --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $MOE + kli query --name curly --alias curly --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $ALFRED + + print_yellow "alfred -> {larry, moe, curly}" + kli query --name alfred --alias alfred --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $LARRY + kli query --name alfred --alias alfred --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $MOE + kli query --name alfred --alias alfred --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $CURLY + + echo +} +rotate_individual_aids +query_keystate_all_participants -# Step 5/5 Pull the latest keystate so each participant knows each other participant's key state echo -print_yellow "Pull key state in from other multisig group participant identifiers" -kli query --name larry --alias larry --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $MOE -kli query --name larry --alias larry --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $CURLY -kli query --name moe --alias moe --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $LARRY -kli query --name moe --alias moe --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $CURLY -kli query --name curly --alias curly --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $LARRY -kli query --name curly --alias curly --passcode "DoB26Fj4x9LboAFWJra17O" --prefix $MOE +print_yellow "Step 5/9 Rotate curly into the threestooges AID" echo +MULTISIG_AID=EGRRbB0Heh3rbyfCnf7vdbYWbKwWASZboMrMtAnGkDDA -# Step 6/6 Rotate Curly into the threestooges AID +# Tell curly about the new multisig AID with OOBI resolve +print_yellow "Resolve threestooges multisig OOBI for curly" +kli oobi resolve --name curly --oobi-alias threestooges \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --oobi http://127.0.0.1:5642/oobi/$MULTISIG_AID/witness/$WAN_WITNESS_PREFIX echo + print_yellow "Multisig rotation with alias: threestooges" PID_LIST="" -print_yellow "Larry rotates - curly in" +print_yellow "larry proposes rotation - bring curly in" kli multisig rotate --name larry --alias "threestooges" \ --passcode "DoB26Fj4x9LboAFWJra17O" \ - --isith '["1/2", "1/2"]' \ + --isith '["1/3", "1/3", "1/3"]' \ --smids $LARRY \ --smids $MOE \ + --smids $CURLY \ --nsith '["1/3", "1/3", "1/3"]' \ --rmids $LARRY \ --rmids $MOE \ @@ -203,23 +297,69 @@ pid=$! PID_LIST+=" $pid" sleep 1 -print_yellow "Moe rotates - curly in" -kli multisig rotate --name moe --alias "threestooges" \ +print_lcyan "Run: " +print_green " kli multisig join --name moe --passcode \"DoB26Fj4x9LboAFWJra17O\" --alias threestooges" +print_lcyan "and: " +print_green " kli multisig join --name curly --passcode \"DoB26Fj4x9LboAFWJra17O\" --alias threestooges" +print_lcyan "in a terminal from 'keripy/scripts/demo' that has run 'source ./demo-scripts.sh'" +print_lcyan "and then delete any non-rotation notifications." +print_lcyan "Then join the multisig rotation proposed by larry" + +echo +print_yellow "Multisig rotation threestooges - wait for signatures" +wait $PID_LIST +read -r -p "Press enter to continue after moe and curly join" + + +# Check status of multisig AIDs +# Check status for larry +kli status --name larry --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" +# Check status for moe +kli status --name moe --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" +# Check status for curly +kli status --name curly --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" + +echo +print_yellow "Step 6/9 rotate each individual keystore and update keystate - required prior to rotating larry out" +echo + +rotate_individual_aids +query_keystate_all_participants + + +echo +print_yellow "Step 7/9 Rotate larry out of the threestooges AID" +echo + +echo +print_yellow "Multisig Rotate - larry out - alias: threestooges" + +PID_LIST="" + +kli multisig rotate --name larry --alias threestooges \ --passcode "DoB26Fj4x9LboAFWJra17O" \ - --isith '["1/2", "1/2"]' \ --smids $LARRY \ --smids $MOE \ - --nsith '["1/3", "1/3", "1/3"]' \ - --rmids $LARRY \ + --smids $CURLY \ + --isith '["1/3", "1/3", "1/3"]' \ --rmids $MOE \ - --rmids $CURLY & + --rmids $CURLY \ + --nsith '["1/2", "1/2"]' & pid=$! PID_LIST+=" $pid" -sleep 1 + +print_lcyan "Run: " +print_green " kli multisig join --name moe --passcode \"DoB26Fj4x9LboAFWJra17O\" --alias threestooges" +print_lcyan "and: " +print_green " kli multisig join --name curly --passcode \"DoB26Fj4x9LboAFWJra17O\" --alias threestooges" +print_lcyan "in a terminal from 'keripy/scripts/demo' that has run 'source ./demo-scripts.sh'" +print_lcyan "and then delete any non-rotation notifications." +print_lcyan "Then join the multisig rotation proposed by larry" echo -print_yellow "Multisig rotation ${ALIAS} - wait" +print_yellow "Multisig rotation - larry out - alias: threestooges - wait for signatures" wait $PID_LIST +read -r -p "Press enter to continue after moe and curly join" # Check status for larry kli status --name larry --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" @@ -228,4 +368,67 @@ kli status --name moe --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" # Check status for curly kli status --name curly --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" -print_green "Multisig rotation - complete" \ No newline at end of file + +echo +print_yellow "Step 8/9 rotate each individual keystore and update keystate - required prior to rotating alfred in" +echo + +rotate_individual_aids +query_keystate_all_participants + + +echo +print_yellow "Step 9/9 Rotate alfred into the threestooges AID" +echo + +# Tell curly about the new multisig AID with OOBI resolve +print_yellow "Resolev threestooges multisig OOBI for curly" +kli oobi resolve --name alfred --oobi-alias threestooges \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --oobi http://127.0.0.1:5642/oobi/$MULTISIG_AID/witness/$WAN_WITNESS_PREFIX +echo + +print_yellow "Multisig rotation with alias: threestooges" + +PID_LIST="" + +print_yellow "moe proposes rotation - bring curly in" +kli multisig rotate --name moe --alias "threestooges" \ + --passcode "DoB26Fj4x9LboAFWJra17O" \ + --isith '["1/3", "1/3", "1/3"]' \ + --smids $MOE \ + --smids $CURLY \ + --smids $ALFRED \ + --nsith '["1/3", "1/3", "1/3"]' \ + --rmids $MOE \ + --rmids $CURLY \ + --rmids $ALFRED & +pid=$! +PID_LIST+=" $pid" +sleep 1 + +print_lcyan "Run: " +print_green " kli multisig join --name curly --passcode \"DoB26Fj4x9LboAFWJra17O\" --alias threestooges" +print_lcyan "and: " +print_green " kli multisig join --name alfred --passcode \"DoB26Fj4x9LboAFWJra17O\" --alias threestooges" +print_lcyan "in a terminal from 'keripy/scripts/demo' that has run 'source ./demo-scripts.sh'" +print_lcyan "and then delete any non-rotation notifications." +print_lcyan "Then join the multisig rotation proposed by larry" + +echo +print_yellow "Multisig rotation threestooges - wait for signatures" +wait $PID_LIST +read -r -p "Press enter to continue after curly and alfred join" + + +# Check status of multisig AIDs +# Check status for moe +kli status --name moe --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" +# Check status for curly +kli status --name curly --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" +# Check status for alfred +kli status --name alfred --alias threestooges --passcode "DoB26Fj4x9LboAFWJra17O" + +echo +print_green "Multisig rotation - complete" +echo \ No newline at end of file diff --git a/scripts/demo/basic/multisig-rotation-in-third.sh b/scripts/demo/basic/multisig-rotation-in-third.sh index 55d384a43..6e06628d5 100755 --- a/scripts/demo/basic/multisig-rotation-in-third.sh +++ b/scripts/demo/basic/multisig-rotation-in-third.sh @@ -3,13 +3,15 @@ # WITNESSES # To run the following scripts, open another console window and run: # $ kli witness demo - +MS1=EKYLUMmNPZeEs77Zvclf0bSN5IN-mLfLpx2ySb-HDlk4 kli init --name multisig1 --salt 0ACDEyMzQ1Njc4OWxtbm9aBc --nopasscode --config-dir "${KERI_SCRIPT_DIR}" --config-file demo-witness-oobis kli incept --name multisig1 --alias multisig1 --file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-1-sample.json +MS2=EJccSRTfXYF6wrUVuenAIHzwcx3hJugeiJsEKmndi5q1 kli init --name multisig2 --salt 0ACDEyMzQ1Njc4OWdoaWpsaw --nopasscode --config-dir "${KERI_SCRIPT_DIR}" --config-file demo-witness-oobis kli incept --name multisig2 --alias multisig2 --file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-2-sample.json +MS3=ENkjt7khEI5edCMw5qugagbJw1QvGnQEtcewxb0FnU9U kli init --name multisig3 --salt 0ACDEyMzQ1Njc4OWdoaWpsaw --nopasscode --config-dir "${KERI_SCRIPT_DIR}" --config-file demo-witness-oobis kli incept --name multisig3 --alias multisig3 --file ${KERI_DEMO_SCRIPT_DIR}/data/multisig-3-sample.json @@ -32,6 +34,17 @@ wait $PID_LIST kli status --name multisig1 --alias multisig +kli rotate --name multisig1 --alias multisig1 +kli rotate --name multisig2 --alias multisig2 +kli rotate --name multisig3 --alias multisig3 + +kli query --name multisig1 --alias multisig1 --prefix $MS2 +kli query --name multisig1 --alias multisig1 --prefix $MS3 +kli query --name multisig2 --alias multisig2 --prefix $MS1 +kli query --name multisig2 --alias multisig2 --prefix $MS3 +kli query --name multisig3 --alias multisig3 --prefix $MS1 +kli query --name multisig3 --alias multisig3 --prefix $MS2 + PID_LIST="" kli multisig rotate --name multisig1 --alias multisig --smids EKYLUMmNPZeEs77Zvclf0bSN5IN-mLfLpx2ySb-HDlk4 --smids EJccSRTfXYF6wrUVuenAIHzwcx3hJugeiJsEKmndi5q1 --smids ENkjt7khEI5edCMw5qugagbJw1QvGnQEtcewxb0FnU9U --isith '["1/3", "1/3", "1/3"]' --nsith '["1/2", "1/2", "1/2"]' --rmids EKYLUMmNPZeEs77Zvclf0bSN5IN-mLfLpx2ySb-HDlk4 --rmids EJccSRTfXYF6wrUVuenAIHzwcx3hJugeiJsEKmndi5q1 --rmids ENkjt7khEI5edCMw5qugagbJw1QvGnQEtcewxb0FnU9U & diff --git a/scripts/demo/basic/stooges-join-rotate.sh b/scripts/demo/basic/stooges-join-rotate.sh index 7f3dc6e29..1f0023f80 100755 --- a/scripts/demo/basic/stooges-join-rotate.sh +++ b/scripts/demo/basic/stooges-join-rotate.sh @@ -670,5 +670,5 @@ main_two_stooges_rotate_in_and_out() { } #main_three_stooges -#main_two_stooges_rotate_in_and_out_join -main_two_stooges_rotate_in_and_out \ No newline at end of file +main_two_stooges_rotate_in_and_out_join +#main_two_stooges_rotate_in_and_out \ No newline at end of file diff --git a/src/keri/app/cli/commands/multisig/join.py b/src/keri/app/cli/commands/multisig/join.py index 908f92fe2..806f81f9a 100644 --- a/src/keri/app/cli/commands/multisig/join.py +++ b/src/keri/app/cli/commands/multisig/join.py @@ -25,6 +25,7 @@ parser.add_argument('--name', '-n', help='keystore name and file location of KERI keystore', required=True) parser.add_argument('--base', '-b', help='additional optional prefix to file location of KERI keystore', required=False, default="") +parser.add_argument('--alias', '-a', help='human readable alias for the local identifier prefix', required=True) parser.add_argument('--passcode', '-p', help='22 character encryption passcode for keystore (is not saved)', dest="bran", default=None) # passcode => bran parser.add_argument("--auto", "-Y", help="auto approve any delegation request non-interactively", action="store_true") @@ -41,8 +42,9 @@ def confirm(args): base = args.base bran = args.bran auto = args.auto + alias = args.alias - confirmDoer = ConfirmDoer(name=name, base=base, bran=bran, auto=auto) + confirmDoer = ConfirmDoer(name=name, base=base, bran=bran, alias=alias, auto=auto) doers = [confirmDoer] return doers @@ -53,7 +55,7 @@ class ConfirmDoer(doing.DoDoer): """ - def __init__(self, name, base, bran, auto=False): + def __init__(self, name, base, bran, alias, auto=False): """ Create doer for polling for group multisig events and either approve automatically or prompt user Parameters: @@ -62,6 +64,7 @@ def __init__(self, name, base, bran, auto=False): bran (str): passcode to unlock keystore """ + self.alias = alias self.hby = existing.setupHby(name=name, base=base, bran=bran) self.rgy = credentialing.Regery(hby=self.hby, name=name, base=base) self.hbyDoer = habbing.HaberyDoer(habery=self.hby) # setup doer @@ -196,7 +199,12 @@ def incept(self, attrs): if approve: if self.auto: - alias = "multisig" + alias = self.alias + elif self.alias: + alias = self.alias + if self.hby.habByName(alias) is not None: + print(f"AID alias {alias} is already in use, please try again") + raise ValueError(f"AID alias {alias} is already in use, please try again") else: while True: alias = input(f"\nEnter alias for new AID: ") @@ -393,7 +401,12 @@ def rotate(self, attrs): ghab = self.hby.habs[pre] else: if self.auto: - alias = "multisig" + alias = self.alias + elif self.alias: + alias = self.alias + if self.hby.habByName(alias) is not None: + print(f"AID alias {alias} is already in use, please try again") + raise ValueError(f"AID alias {alias} is already in use, please try again") else: while True: alias = input(f"\nEnter alias for new AID: ")