From f114cc2f16dfeff592497b0c09d98393742baff9 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Tue, 9 Jul 2024 10:27:16 -0500 Subject: [PATCH 01/10] Improve documentation --- example_sns_init.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/example_sns_init.yaml b/example_sns_init.yaml index b379715..065f85c 100644 --- a/example_sns_init.yaml +++ b/example_sns_init.yaml @@ -58,11 +58,11 @@ # ------------------------------------------------------------------------------ # Name of the SNS project. This may differ from the name of the associated -# token. Must be a string of max length = 255. +# token. Must be a string of at most 255 bytes. name: Rock Out # Description of the SNS project. -# Must be a string of max length = 2,000. +# Must be a string of at most 2,000 bytes. description: > A poem co-written with ChatGPT @@ -83,9 +83,9 @@ description: > # cropped to a circle. logo: logo.png -# URL to the dapp controlled by the SNS project. -# Must be a string from 10 to 512 bytes. -url: https://forum.dfinity.org/thread-where-this-sns-is-discussed +# URL that represents the SNS, usually a dapp controlled by the SNS project. +# Must be a string from 10 to 512 bytes, and the domain must be HTTPS. +url: https://mydapp.com # Metadata for the NNS proposal required to create the SNS. This data will be # shown only in the NNS proposal. @@ -93,9 +93,12 @@ NnsProposal: # The title of the NNS proposal. Must be a string of 4 to 256 bytes. title: "NNS Proposal to create an SNS named 'Rock Out'" - # The HTTPS address of additional content required to evaluate the NNS + # The HTTPS address of a forum post with additional context required to evaluate the NNS # proposal. - url: "https://forum.dfinity.org" + # This will go in the `url` field of the proposal. + # Must be a string of 10 to 2,048 bytes. + # The protocol must be HTTPS, and the domain must be forum.dfinity.org. + url: "https://forum.dfinity.org/thread-where-this-sns-is-discussed" # The description of the proposal. Must be a string of 10 to 2,000 bytes. summary: > From 12661ca657198c3ee78a4bea3ceb637fa7ef10b1 Mon Sep 17 00:00:00 2001 From: Arshavir Ter-Gabrielyan Date: Fri, 12 Jul 2024 18:22:29 +0200 Subject: [PATCH 02/10] Update example_sns_init.yaml --- example_sns_init.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example_sns_init.yaml b/example_sns_init.yaml index 065f85c..fbfc55e 100644 --- a/example_sns_init.yaml +++ b/example_sns_init.yaml @@ -399,7 +399,7 @@ Swap: # The minimum amount of ICP that each participant must contribute # to participate. This field is specified as a token. For instance, # "1 token". - minimum_participant_icp: 10 tokens + minimum_participant_icp: 100 tokens # The maximum amount of ICP that each participant may contribute # to participate. This field is specified as a token. For instance, @@ -432,7 +432,7 @@ Swap: # many neurons will be in each participant's neuron basket. Note that # the first neuron in each neuron basket will have zero dissolve delay. # This value should thus be greater than or equal to `2`. - events: 3 + events: 2 # The interval at which the schedule will be increased per event. The # first neuron in the basket will be unlocked with zero dissolve delay. From 695005c338e3d3f74c6ca13be41b1a5b653b520a Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Thu, 8 Aug 2024 10:34:49 -0500 Subject: [PATCH 03/10] Remove sns import --- deploy_sns.sh | 1 - propose_sns.sh | 1 - setup.sh | 1 - setup_locally.sh | 1 - 4 files changed, 4 deletions(-) diff --git a/deploy_sns.sh b/deploy_sns.sh index ae60605..82aecbe 100755 --- a/deploy_sns.sh +++ b/deploy_sns.sh @@ -24,7 +24,6 @@ ic-admin \ --summary "This proposal whitelists developer's principal to deploy SNS" ${DFX} nns import --network-mapping "${DX_NETWORK}=mainnet" -${DFX} sns import if [ "${CANISTER_TEST}" == "_test" ] then curl -L "https://raw.githubusercontent.com/dfinity/ic/${IC_COMMIT}/rs/nns/governance/canister/governance_test.did" -o ./candid/nns-governance.did diff --git a/propose_sns.sh b/propose_sns.sh index 4243d52..cae67c8 100755 --- a/propose_sns.sh +++ b/propose_sns.sh @@ -42,7 +42,6 @@ dfx canister \ qaa6y-5yaaa-aaaaa-aaafa-cai # SNS-W canister ${DFX} nns import --network-mapping "${DX_NETWORK}=mainnet" -${DFX} sns import if [ "${CANISTER_TEST}" == "_test" ] then curl -L "https://raw.githubusercontent.com/dfinity/ic/${IC_COMMIT}/rs/nns/governance/canister/governance_test.did" -o ./candid/nns-governance.did diff --git a/setup.sh b/setup.sh index 2548257..f5e6696 100755 --- a/setup.sh +++ b/setup.sh @@ -38,7 +38,6 @@ fi set -uo pipefail ${DFX} nns import --network-mapping "${DX_NETWORK}=mainnet" -${DFX} sns import if [ "${CANISTER_TEST}" == "_test" ] then curl -L "https://raw.githubusercontent.com/dfinity/ic/${IC_COMMIT}/rs/nns/governance/canister/governance_test.did" -o ./candid/nns-governance.did diff --git a/setup_locally.sh b/setup_locally.sh index 6bdbc41..784f9da 100755 --- a/setup_locally.sh +++ b/setup_locally.sh @@ -24,7 +24,6 @@ ${DFX} extension install nns --version ${DFX_NNS_VERSION} || true ${DFX} extension install sns --version ${DFX_SNS_VERSION} || true ${DFX} nns import -${DFX} sns import if [ "${CANISTER_TEST}" == "_test" ] then curl -L "https://raw.githubusercontent.com/dfinity/ic/${IC_COMMIT}/rs/nns/governance/canister/governance_test.did" -o ./candid/nns-governance.did From f60a2d9cf0338abbed7fcdd90f5454c85b95f3df Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Tue, 13 Aug 2024 11:08:00 -0500 Subject: [PATCH 04/10] set -x --- run_basic_scenario.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/run_basic_scenario.sh b/run_basic_scenario.sh index dcf7de0..a621c64 100755 --- a/run_basic_scenario.sh +++ b/run_basic_scenario.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -euo pipefail +set -x cd -- "$(dirname -- "${BASH_SOURCE[0]}")" From 6e4bfbba401b18d2da85aeb3b2503e6415300441 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Mon, 19 Aug 2024 11:36:47 -0500 Subject: [PATCH 05/10] add more logging --- run_basic_scenario.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/run_basic_scenario.sh b/run_basic_scenario.sh index a621c64..b3598cd 100755 --- a/run_basic_scenario.sh +++ b/run_basic_scenario.sh @@ -28,7 +28,27 @@ jq -r '.root_canister_id' -e sns_canister_ids.json jq -r '.swap_canister_id' -e sns_canister_ids.json # Assert the SNS swap lifecycle is in the OPEN state. -[ "$(./get_sns_swap_state.sh | ./bin/idl2json | jq -r '.swap[0].lifecycle')" == "2" ] && echo "OK" || exit 1 +( + # Run the command and capture the output + swap_state=$(./get_sns_swap_state.sh | ./bin/idl2json) + + # Extract the lifecycle value + lifecycle=$(echo "$swap_state" | jq -r '.swap[0].lifecycle') + + # Log the output and extracted lifecycle value + echo "Full output: ${swap_state}" + echo "Extracted lifecycle value: ${lifecycle}" + + # Check if the lifecycle is in the OPEN state (2) + if [ "${lifecycle}" == "2" ]; then + echo "OK - SNS swap lifecycle is in the OPEN state (2)" + else + echo "ERROR - SNS swap lifecycle is not in the OPEN state" + echo "Expected: 2 (OPEN state)" + echo "Actual: ${lifecycle}" + exit 1 + fi +) # Assert that the test canister is indeed registered. [ "$(./get_sns_canisters.sh | ./bin/idl2json | jq -r '.dapps[0]')" == "$(./bin/dfx canister id test)" ] && echo "OK" || exit 1 From 0ee7ebb53c5ae242ca614de23d563211e0eb2087 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Mon, 19 Aug 2024 11:51:46 -0500 Subject: [PATCH 06/10] don't specify non-existent candid in get_sns_swap_state.sh --- get_sns_swap_state.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/get_sns_swap_state.sh b/get_sns_swap_state.sh index 07cae49..03c8481 100755 --- a/get_sns_swap_state.sh +++ b/get_sns_swap_state.sh @@ -9,5 +9,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" dfx canister call \ --network "${NETWORK}" \ "${SNS_SWAP_CANISTER_ID}" \ - --candid candid/sns_swap.did \ get_state '(record {})' From fb6db23b72277d09d873b5b0585db18cc873c759 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Mon, 19 Aug 2024 12:07:55 -0500 Subject: [PATCH 07/10] I don't think we need to specify the candid --- add_hot_key.sh | 1 - developer_neuron_id.sh | 1 - execute_generic_functions_test.sh | 1 - get_all_sns_neurons.sh | 1 - get_last_sns_proposal.sh | 1 - get_sns_canisters.sh | 1 - get_sns_neuron.sh | 1 - get_sns_neurons.sh | 1 - get_sns_proposal.sh | 1 - list_sns_dev_neurons.sh | 5 +---- perform_neuron_operation.sh | 1 - register_dapp.sh | 1 - register_generic_functions_test.sh | 1 - run_basic_scenario.sh | 5 ++--- transfer_sns_treasury_funds.sh | 1 - update_sns_neuron.sh | 1 - upgrade_dapp.sh | 1 - vote_on_sns_proposal.sh | 1 - vote_with_developer_neurons.sh | 1 - vote_with_single_identity.sh | 1 - wait_for_canister_running.sh | 1 - 21 files changed, 3 insertions(+), 26 deletions(-) diff --git a/add_hot_key.sh b/add_hot_key.sh index 23624e6..530547b 100755 --- a/add_hot_key.sh +++ b/add_hot_key.sh @@ -20,7 +20,6 @@ HOTKEY_PRINCIPAL=$(dfx identity get-principal) export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${OWNER_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ diff --git a/developer_neuron_id.sh b/developer_neuron_id.sh index 359b28c..a4f3cca 100755 --- a/developer_neuron_id.sh +++ b/developer_neuron_id.sh @@ -9,7 +9,6 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" echo "$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ diff --git a/execute_generic_functions_test.sh b/execute_generic_functions_test.sh index be82d51..5c05986 100755 --- a/execute_generic_functions_test.sh +++ b/execute_generic_functions_test.sh @@ -11,7 +11,6 @@ export TEXT="${1:-Hoi}" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ diff --git a/get_all_sns_neurons.sh b/get_all_sns_neurons.sh index 8844fa5..ce73b00 100755 --- a/get_all_sns_neurons.sh +++ b/get_all_sns_neurons.sh @@ -9,5 +9,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = null; limit = 0})" diff --git a/get_last_sns_proposal.sh b/get_last_sns_proposal.sh index 96a5bd9..845b50a 100755 --- a/get_last_sns_proposal.sh +++ b/get_last_sns_proposal.sh @@ -9,5 +9,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_proposals '(record {include_reward_status = vec {}; limit = 1:nat32; exclude_type = vec {}; include_status = vec {};})' diff --git a/get_sns_canisters.sh b/get_sns_canisters.sh index 857ba5b..c588b27 100755 --- a/get_sns_canisters.sh +++ b/get_sns_canisters.sh @@ -9,5 +9,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" dfx canister \ --network "${NETWORK}" \ call "${SNS_ROOT_CANISTER_ID}" \ - --candid candid/sns_root.did \ list_sns_canisters '(record {})' diff --git a/get_sns_neuron.sh b/get_sns_neuron.sh index f19ae39..6c9780d 100755 --- a/get_sns_neuron.sh +++ b/get_sns_neuron.sh @@ -11,5 +11,4 @@ ID="${1}" dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ get_neuron "(record {neuron_id = opt record {id = blob \"${ID}\"};})" diff --git a/get_sns_neurons.sh b/get_sns_neurons.sh index a8cf73b..ade15d7 100755 --- a/get_sns_neurons.sh +++ b/get_sns_neurons.sh @@ -9,5 +9,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"$(dfx identity get-principal)\"; limit = 0})" diff --git a/get_sns_proposal.sh b/get_sns_proposal.sh index fef264f..575fbe6 100755 --- a/get_sns_proposal.sh +++ b/get_sns_proposal.sh @@ -11,5 +11,4 @@ export ID="${1:-1}" dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ get_proposal "(record {proposal_id = opt record {id = (${ID}:nat64)}})" diff --git a/list_sns_dev_neurons.sh b/list_sns_dev_neurons.sh index d3182b9..be98f88 100755 --- a/list_sns_dev_neurons.sh +++ b/list_sns_dev_neurons.sh @@ -15,7 +15,6 @@ for DEV_IDENT in "${HOME}"/.config/dfx/identity/dev-ident-*; do export NEURON_IDS="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" list_neurons \ - --candid candid/sns_governance.did \ "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})")" echo "Listing Developer Neurons for Identity ${DEV_IDENT}, Principal ${DX_PRINCIPAL}" echo "${NEURON_IDS}" @@ -26,9 +25,7 @@ CANISTER_DEV_NEURON=n2xex-iyaaa-aaaar-qaaeq-cai echo "Listing for ${CANISTER_DEV_NEURON}" dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${CANISTER_DEV_NEURON}\"; limit = 0})" + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${CANISTER_DEV_NEURON}\"; limit = 0})" # Switch back to the previous identity dfx identity use "${CURRENT_DX_IDENT}" diff --git a/perform_neuron_operation.sh b/perform_neuron_operation.sh index 7a8c41c..51f9d0f 100755 --- a/perform_neuron_operation.sh +++ b/perform_neuron_operation.sh @@ -9,7 +9,6 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ diff --git a/register_dapp.sh b/register_dapp.sh index 620a757..b85812b 100755 --- a/register_dapp.sh +++ b/register_dapp.sh @@ -14,7 +14,6 @@ dfx canister --network "${NETWORK}" update-settings --add-controller "${SNS_ROOT export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ diff --git a/register_generic_functions_test.sh b/register_generic_functions_test.sh index 352ea59..a550c52 100755 --- a/register_generic_functions_test.sh +++ b/register_generic_functions_test.sh @@ -9,7 +9,6 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ diff --git a/run_basic_scenario.sh b/run_basic_scenario.sh index b3598cd..c865aa0 100755 --- a/run_basic_scenario.sh +++ b/run_basic_scenario.sh @@ -36,12 +36,11 @@ jq -r '.swap_canister_id' -e sns_canister_ids.json lifecycle=$(echo "$swap_state" | jq -r '.swap[0].lifecycle') # Log the output and extracted lifecycle value - echo "Full output: ${swap_state}" - echo "Extracted lifecycle value: ${lifecycle}" + echo "swap_state: ${swap_state}" # Check if the lifecycle is in the OPEN state (2) if [ "${lifecycle}" == "2" ]; then - echo "OK - SNS swap lifecycle is in the OPEN state (2)" + echo "SNS swap lifecycle is in the OPEN state (2)!" else echo "ERROR - SNS swap lifecycle is not in the OPEN state" echo "Expected: 2 (OPEN state)" diff --git a/transfer_sns_treasury_funds.sh b/transfer_sns_treasury_funds.sh index de21e78..1ffbc68 100755 --- a/transfer_sns_treasury_funds.sh +++ b/transfer_sns_treasury_funds.sh @@ -12,7 +12,6 @@ export TO_PRINCIPAL="${2:-$DX_PRINCIPAL}" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ diff --git a/update_sns_neuron.sh b/update_sns_neuron.sh index b8e9f1f..95c43ea 100755 --- a/update_sns_neuron.sh +++ b/update_sns_neuron.sh @@ -11,5 +11,4 @@ ARG="${1}" dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ update_neuron "(${ARG})" diff --git a/upgrade_dapp.sh b/upgrade_dapp.sh index d69b025..d573f18 100755 --- a/upgrade_dapp.sh +++ b/upgrade_dapp.sh @@ -17,7 +17,6 @@ export ARG="${3:-()}" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ diff --git a/vote_on_sns_proposal.sh b/vote_on_sns_proposal.sh index 5cf9587..4acbac6 100755 --- a/vote_on_sns_proposal.sh +++ b/vote_on_sns_proposal.sh @@ -20,7 +20,6 @@ do export JSON="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})" \ | idl2json \ | jq -r ".neurons")" diff --git a/vote_with_developer_neurons.sh b/vote_with_developer_neurons.sh index 577a218..cf064de 100755 --- a/vote_with_developer_neurons.sh +++ b/vote_with_developer_neurons.sh @@ -18,7 +18,6 @@ for DEV_IDENT in "$HOME"/.config/dfx/identity/dev-ident-*; do export JSON="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})" \ | idl2json \ | jq -r ".neurons")" diff --git a/vote_with_single_identity.sh b/vote_with_single_identity.sh index c2357d7..99fbf35 100755 --- a/vote_with_single_identity.sh +++ b/vote_with_single_identity.sh @@ -18,7 +18,6 @@ export DX_PRINCIPAL="$(dfx identity get-principal)" export JSON="$(dfx canister \ --network "${NETWORK}" \ call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})" \ | idl2json \ | jq -r ".neurons")" diff --git a/wait_for_canister_running.sh b/wait_for_canister_running.sh index b8f6a73..7f934d0 100755 --- a/wait_for_canister_running.sh +++ b/wait_for_canister_running.sh @@ -11,7 +11,6 @@ export CID="${1}" while [ "$(./bin/dfx canister \ --network "${NETWORK}" \ call ${SNS_ROOT_CANISTER_ID} \ - --candid candid/sns_root.did \ canister_status "(record {canister_id=principal\"${CID}\"})" \ | ./bin/idl2json \ | jq -r '.status')" != "$(echo -e "{\n \"running\": null\n}")" ] From 1ba1e71dadf16d0446fd0d18fe1ea9fbbf2a8b80 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Mon, 19 Aug 2024 12:31:31 -0500 Subject: [PATCH 08/10] Revert "set -x" This reverts commit f60a2d9cf0338abbed7fcdd90f5454c85b95f3df. --- run_basic_scenario.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/run_basic_scenario.sh b/run_basic_scenario.sh index c865aa0..111c1d8 100755 --- a/run_basic_scenario.sh +++ b/run_basic_scenario.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -set -x cd -- "$(dirname -- "${BASH_SOURCE[0]}")" From e9c77f2325a1e53a12b2a05614b07487576491d2 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Wed, 18 Sep 2024 15:27:02 -0500 Subject: [PATCH 09/10] Upgrade DFX to 0.22.0 --- constants.sh | 19 +++++++++++++++++++ settings.sh | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/constants.sh b/constants.sh index 53c568a..5580f7b 100755 --- a/constants.sh +++ b/constants.sh @@ -128,6 +128,25 @@ if [[ "${TESTNET}" == "local" ]]; then then export REGISTRY_PATH="$(readlink -f "${REGISTRY}")" fi + # Determine the operating system + OS_TYPE="$(uname)" + if [[ "$OS_TYPE" == "Darwin" ]]; then + BASE_PATH="$HOME/Library/Application Support/org.dfinity.dfx/network/local" + elif [[ "$OS_TYPE" == "Linux" ]]; then + BASE_PATH="$HOME/.local/share/dfx/network/local" + else + echo "Unsupported OS type: $OS_TYPE" + exit 1 + fi + + # Find the ic_registry_local_store directory within the base path + REGISTRY_FOUND=$(find "$BASE_PATH" -type d -name ic_registry_local_store 2>/dev/null | head -n 1) + + # If the directory is found, set REGISTRY_PATH to its absolute path + if [[ -d "$REGISTRY_FOUND" ]]; then + export REGISTRY_PATH="$(readlink -f "$REGISTRY_FOUND")" + fi + if [[ -z "${REGISTRY_PATH}" ]] then echo "Local registry not found!" diff --git a/settings.sh b/settings.sh index 853fa8c..6997cbc 100755 --- a/settings.sh +++ b/settings.sh @@ -35,6 +35,6 @@ export IC_COMMIT="f79476803e097d9fd5f7e67d45f6818348b51ac9" export TESTNET="local" -export DFX_VERSION="0.19.0" +export DFX_VERSION="0.22.0" export DFX_SNS_VERSION="0.4.1" export DFX_NNS_VERSION="0.4.1" From 84d95066374db3f059326e00df6ac12e44a4a39c Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Thu, 19 Sep 2024 10:03:32 -0500 Subject: [PATCH 10/10] Address MR feedback --- constants.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/constants.sh b/constants.sh index 5580f7b..974b2c2 100755 --- a/constants.sh +++ b/constants.sh @@ -118,16 +118,6 @@ if [[ "${TESTNET}" == "local" ]]; then then export REGISTRY_PATH="$(readlink -f "${REGISTRY}")" fi - REGISTRY="${HOME}/Library/Application Support/org.dfinity.dfx/network/local/state/replicated_state/ic_registry_local_store" - if [[ -d "${REGISTRY}" ]] - then - export REGISTRY_PATH="$(readlink -f "${REGISTRY}")" - fi - REGISTRY="${HOME}/.local/share/dfx/network/local/state/replicated_state/ic_registry_local_store" - if [[ -d "${REGISTRY}" ]] - then - export REGISTRY_PATH="$(readlink -f "${REGISTRY}")" - fi # Determine the operating system OS_TYPE="$(uname)" if [[ "$OS_TYPE" == "Darwin" ]]; then @@ -140,8 +130,13 @@ if [[ "${TESTNET}" == "local" ]]; then fi # Find the ic_registry_local_store directory within the base path - REGISTRY_FOUND=$(find "$BASE_PATH" -type d -name ic_registry_local_store 2>/dev/null | head -n 1) + REGISTRY_FOUND=$(find "$BASE_PATH" -type d -name ic_registry_local_store 2>/dev/null) + if [ $(echo "$REGISTRY_FOUND" | wc -l) -gt 1 ]; then + echo "Error: Multiple ic_registry_local_store directories found" + exit 1 + fi + # If the directory is found, set REGISTRY_PATH to its absolute path if [[ -d "$REGISTRY_FOUND" ]]; then export REGISTRY_PATH="$(readlink -f "$REGISTRY_FOUND")" @@ -149,7 +144,7 @@ if [[ "${TESTNET}" == "local" ]]; then if [[ -z "${REGISTRY_PATH}" ]] then - echo "Local registry not found!" + echo "Error: Local registry not found!" exit 1 fi export NNS_SUB="$(ic-regedit snapshot "${REGISTRY_PATH}" | jq -r .nns_subnet_id.principal_id.raw | sed "s/(principal-id)//")"