From 9c5d9a3403b1ccbfe77ac2372a939317c1f5b3ed Mon Sep 17 00:00:00 2001 From: Ola Date: Sun, 7 Aug 2022 19:34:14 +0200 Subject: [PATCH] CNCLI 5.1.0 update - Add GENESIS_HASH variable to env - Add --shelley-genesis-hash argument to cncli sync command - Bump min required version to 5.1.0 --- scripts/cnode-helper-scripts/cncli.sh | 4 ++-- scripts/cnode-helper-scripts/env | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/cnode-helper-scripts/cncli.sh b/scripts/cnode-helper-scripts/cncli.sh index 2c9d61d98..eab135914 100755 --- a/scripts/cnode-helper-scripts/cncli.sh +++ b/scripts/cnode-helper-scripts/cncli.sh @@ -181,7 +181,7 @@ cncliInit() { [[ ! -f "${CNCLI}" ]] && echo -e "\nERROR: failed to locate cncli executable, please install with 'prereqs.sh'\n" && exit 1 CNCLI_VERSION="v$(cncli -V | cut -d' ' -f2)" - if ! versionCheck "2.1.0" "${CNCLI_VERSION}"; then echo "ERROR: cncli ${CNCLI_VERSION} installed, minimum required version is 2.1.0, please upgrade to latest version!"; exit 1; fi + if ! versionCheck "5.1.0" "${CNCLI_VERSION}"; then echo "ERROR: cncli ${CNCLI_VERSION} installed, minimum required version is 5.1.0, please upgrade to latest version!"; exit 1; fi [[ -z "${CNCLI_DIR}" ]] && CNCLI_DIR="${CNODE_HOME}/guild-db/cncli" if ! mkdir -p "${CNCLI_DIR}" 2>/dev/null; then echo "ERROR: Failed to create CNCLI DB directory: ${CNCLI_DIR}"; exit 1; fi @@ -209,7 +209,7 @@ cncliInit() { ################################# cncliSync() { - ${CNCLI} sync --host "${CNODE_HOST}" --network-magic "${NWMAGIC}" --port "${CNODE_PORT}" --db "${CNCLI_DB}" + ${CNCLI} sync --host "${CNODE_HOST}" --network-magic "${NWMAGIC}" --port "${CNODE_PORT}" --db "${CNCLI_DB}" --shelley-genesis-hash "${GENESIS_HASH}" } ################################# diff --git a/scripts/cnode-helper-scripts/env b/scripts/cnode-helper-scripts/env index dee2fe2a9..d7434d083 100644 --- a/scripts/cnode-helper-scripts/env +++ b/scripts/cnode-helper-scripts/env @@ -899,6 +899,7 @@ else [[ ! -f "${ALONZO_GENESIS_JSON}" ]] && echo "Byron genesis file not found: ${ALONZO_GENESIS_JSON}" && return 1 [[ ! -f "${BYRON_GENESIS_JSON}" ]] && echo "Byron genesis file not found: ${BYRON_GENESIS_JSON}" && return 1 [[ ! -f "${GENESIS_JSON}" ]] && echo "Shelley genesis file not found: ${GENESIS_JSON}" && return 1 + GENESIS_HASH="$(${CCLI} genesis hash --genesis "${GENESIS_JSON}")" PROTOCOL="${CONFIG_CONTENTS[3]}" P2P_ENABLED="${CONFIG_CONTENTS[5]}" fi