Skip to content

Commit

Permalink
Fix order of execution in env
Browse files Browse the repository at this point in the history
  • Loading branch information
Scitz0 committed Jul 31, 2024
1 parent dbb8b87 commit eb4098f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/cnode-helper-scripts/env
Original file line number Diff line number Diff line change
Expand Up @@ -1074,9 +1074,6 @@ if ! command -v "jq" &>/dev/null; then
return 1
fi
NETWORK_ERA=$(${CCLI} latest query tip ${NETWORK_IDENTIFIER} 2>/dev/null | jq -r '.era //empty' | tr '[:upper:]' '[:lower:]')
[[ -z ${NETWORK_ERA} ]] && NETWORK_ERA=latest
read -ra CONFIG_CONTENTS <<<"$(jq -r '[ .AlonzoGenesisFile //"null", .ByronGenesisFile //"null", .ShelleyGenesisFile //"null", .Protocol //"Cardano", .TraceChainDb //"null", .EnableP2P //"false", .ConwayGenesisFile //"null"]| @tsv' "${CONFIG}" 2>/dev/null)"
if [[ ${CONFIG_CONTENTS[4]} != "true" ]]; then
echo "Could not find TraceChainDb when attempting to parse ${CONFIG} file in JSON format, please double-check the syntax of your config, or simply download it from guild-operators repository!"
Expand All @@ -1096,7 +1093,7 @@ else
[[ ! -f "${ALONZO_GENESIS_JSON}" ]] && echo "Alonzo 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} ${NETWORK_ERA} genesis hash --genesis "${GENESIS_JSON}")"
GENESIS_HASH="$(${CCLI} latest genesis hash --genesis "${GENESIS_JSON}")"
PROTOCOL="${CONFIG_CONTENTS[3]}"
P2P_ENABLED="${CONFIG_CONTENTS[5]}"
fi
Expand Down Expand Up @@ -1201,6 +1198,9 @@ case ${NWMAGIC} in
[[ -z ${SHELLEY_TRANS_EPOCH} ]] && SHELLEY_TRANS_EPOCH=0
esac
NETWORK_ERA=$(${CCLI} latest query tip ${NETWORK_IDENTIFIER} 2>/dev/null | jq -r '.era //empty' | tr '[:upper:]' '[:lower:]')
[[ -z ${NETWORK_ERA} ]] && NETWORK_ERA=latest
[[ ${OFFLINE_MODE} = "N" && ${SHELLEY_TRANS_EPOCH} -eq -1 ]] && getNodeMetrics && getShelleyTransitionEpoch
# Return code 2 is used for scripts that want to source env but not fail due to a starting node
Expand Down

0 comments on commit eb4098f

Please sign in to comment.