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

Upgrade DFX to 0.22.0 #79

Merged
merged 2 commits into from
Sep 19, 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
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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Error: Multiple ic_registry_local_store directories found"
echo "Error: Multiple ic_registry_local_store directories found; please start your local replica using `dfx start --clean`"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I thought it wouldn't let me merge until I resolved this

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"
Loading