Skip to content

Commit

Permalink
Merge pull request #79 from dfinity/@anchpop/dfx-0.22.0
Browse files Browse the repository at this point in the history
Upgrade DFX to 0.22.0
  • Loading branch information
anchpop authored Sep 19, 2024
2 parents ff2a12c + 84d9506 commit c723389
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
32 changes: 23 additions & 9 deletions constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,33 @@ 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}")"
# 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
REGISTRY="${HOME}/.local/share/dfx/network/local/state/replicated_state/ic_registry_local_store"
if [[ -d "${REGISTRY}" ]]
then
export REGISTRY_PATH="$(readlink -f "${REGISTRY}")"

# 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)

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")"
fi

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)//")"
Expand Down
2 changes: 1 addition & 1 deletion settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit c723389

Please sign in to comment.