Skip to content

Commit

Permalink
Drop deprecated references to cardano-cli ${NETWORK_ERA} (#1844)
Browse files Browse the repository at this point in the history
## Description
<!--- Describe your changes -->
Drop deprecated references to cardano-cli ${NETWORK_ERA}

## Which issue it fixes?
<!--- Link to issue: Closes #issue-number -->
Closes #1843

## How has this been tested?
<!--- Describe how you tested changes -->
Only tested individual cardano-cli commands for each type of change
  • Loading branch information
rdlrt authored Jan 14, 2025
1 parent 32ed00c commit 2ecea33
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 196 deletions.
4 changes: 4 additions & 0 deletions docs/Scripts/cntools-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to this tool will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [13.3.3] - 2025-01-10
#### Fixed
- Drop deprecated refences to `${NETWORK_ERA}`

## [13.3.2] - 2025-01-09
#### Fixed
- Corrected predefined Drep wallet data querying in light (api) mode - should address StringToDecodeMissingSeparatorChar errors
Expand Down
2 changes: 1 addition & 1 deletion scripts/cnode-helper-scripts/cncli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ getPoolVrfVkeyCborHex() {
}

getLedgerData() { # getNodeMetrics expected to have been already run
if ! stake_snapshot=$(${CCLI} ${NETWORK_ERA} query stake-snapshot --stake-pool-id ${POOL_ID} ${NETWORK_IDENTIFIER} 2>&1); then
if ! stake_snapshot=$(${CCLI} query stake-snapshot --stake-pool-id ${POOL_ID} ${NETWORK_IDENTIFIER} 2>&1); then
echo "ERROR: stake-snapshot query failed: ${stake_snapshot}"
return 1
fi
Expand Down
6 changes: 3 additions & 3 deletions scripts/cnode-helper-scripts/cnode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ set_defaults() {
check_config_sanity() {
BYGENHASH=$("${CCLI}" byron genesis print-genesis-hash --genesis-json "${BYRON_GENESIS_JSON}" 2>/dev/null)
BYGENHASHCFG=$(jq '.ByronGenesisHash' <"${CONFIG}" 2>/dev/null)
SHGENHASH=$("${CCLI}" ${NETWORK_ERA} genesis hash --genesis "${GENESIS_JSON}" 2>/dev/null)
SHGENHASH=$("${CCLI}" latest genesis hash --genesis "${GENESIS_JSON}" 2>/dev/null)
SHGENHASHCFG=$(jq '.ShelleyGenesisHash' <"${CONFIG}" 2>/dev/null)
ALGENHASH=$("${CCLI}" ${NETWORK_ERA} genesis hash --genesis "${ALONZO_GENESIS_JSON}" 2>/dev/null)
ALGENHASH=$("${CCLI}" latest genesis hash --genesis "${ALONZO_GENESIS_JSON}" 2>/dev/null)
ALGENHASHCFG=$(jq '.AlonzoGenesisHash' <"${CONFIG}" 2>/dev/null)
CWGENHASH=$("${CCLI}" ${NETWORK_ERA} genesis hash --genesis "${CONWAY_GENESIS_JSON}" 2>/dev/null)
CWGENHASH=$("${CCLI}" latest genesis hash --genesis "${CONWAY_GENESIS_JSON}" 2>/dev/null)
CWGENHASHCFG=$(jq '.ConwayGenesisHash' <"${CONFIG}" 2>/dev/null)
# If hash are missing/do not match, add that to the end of config. We could have sorted it based on logic, but that would mess up sdiff comparison outputs
if [[ "${BYGENHASH}" != "${BYGENHASHCFG}" ]] || [[ "${SHGENHASH}" != "${SHGENHASHCFG}" ]] || [[ "${ALGENHASH}" != "${ALGENHASHCFG}" ]] || [[ "${CWGENHASH}" != "${CWGENHASHCFG}" ]]; then
Expand Down
228 changes: 114 additions & 114 deletions scripts/cnode-helper-scripts/cntools.library

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions scripts/cnode-helper-scripts/cntools.sh

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions scripts/cnode-helper-scripts/dbsync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ check_defaults() {
check_config_sanity() {
BYGENHASH=$("${CCLI}" byron genesis print-genesis-hash --genesis-json "${BYRON_GENESIS_JSON}" 2>/dev/null)
BYGENHASHCFG=$(jq '.ByronGenesisHash' <"${CONFIG}" 2>/dev/null)
SHGENHASH=$("${CCLI}" ${NETWORK_ERA} genesis hash --genesis "${GENESIS_JSON}" 2>/dev/null)
SHGENHASH=$("${CCLI}" latest genesis hash --genesis "${GENESIS_JSON}" 2>/dev/null)
SHGENHASHCFG=$(jq '.ShelleyGenesisHash' <"${CONFIG}" 2>/dev/null)
ALGENHASH=$("${CCLI}" ${NETWORK_ERA} genesis hash --genesis "${ALONZO_GENESIS_JSON}" 2>/dev/null)
ALGENHASH=$("${CCLI}" latest genesis hash --genesis "${ALONZO_GENESIS_JSON}" 2>/dev/null)
ALGENHASHCFG=$(jq '.AlonzoGenesisHash' <"${CONFIG}" 2>/dev/null)
CWGENHASH=$("${CCLI}" ${NETWORK_ERA} genesis hash --genesis "${CONWAY_GENESIS_JSON}" 2>/dev/null)
CWGENHASH=$("${CCLI}" latest genesis hash --genesis "${CONWAY_GENESIS_JSON}" 2>/dev/null)
CWGENHASHCFG=$(jq '.ConwayGenesisHash' <"${CONFIG}" 2>/dev/null)
# If hash are missing/do not match, add that to the end of config. We could have sorted it based on logic, but that would mess up sdiff comparison outputs
if [[ "${BYGENHASH}" != "${BYGENHASHCFG}" ]] || [[ "${SHGENHASH}" != "${SHGENHASHCFG}" ]] || [[ "${ALGENHASH}" != "${ALGENHASHCFG}" ]] || [[ "${CWGENHASH}" != "${CWGENHASHCFG}" ]]; then
Expand Down
10 changes: 5 additions & 5 deletions scripts/cnode-helper-scripts/env
Original file line number Diff line number Diff line change
Expand Up @@ -840,10 +840,10 @@ getPoolID() {
pool_id_bech32=""
pool_coldkey_vk_file="${pool_dir}/${POOL_COLDKEY_VK_FILENAME}"
if [[ -f ${pool_coldkey_vk_file} ]]; then
[[ $(type -t println) = function ]] && println ACTION "${CCLI} ${NETWORK_ERA} stake-pool id --cold-verification-key-file ${pool_coldkey_vk_file} --output-format hex"
[[ $(type -t println) = function ]] && println ACTION "${CCLI} ${NETWORK_ERA} stake-pool id --cold-verification-key-file ${pool_coldkey_vk_file}"
if ! pool_id=$(${CCLI} ${NETWORK_ERA} stake-pool id --cold-verification-key-file "${pool_coldkey_vk_file}" --output-format hex 2>/dev/null) || \
! pool_id_bech32=$(${CCLI} ${NETWORK_ERA} stake-pool id --cold-verification-key-file "${pool_coldkey_vk_file}" 2>/dev/null); then
[[ $(type -t println) = function ]] && println ACTION "${CCLI} latest stake-pool id --cold-verification-key-file ${pool_coldkey_vk_file} --output-format hex"
[[ $(type -t println) = function ]] && println ACTION "${CCLI} latest stake-pool id --cold-verification-key-file ${pool_coldkey_vk_file}"
if ! pool_id=$(${CCLI} latest stake-pool id --cold-verification-key-file "${pool_coldkey_vk_file}" --output-format hex 2>/dev/null) || \
! pool_id_bech32=$(${CCLI} latest stake-pool id --cold-verification-key-file "${pool_coldkey_vk_file}" 2>/dev/null); then
return 1
fi
echo ${pool_id} > "${pool_id_file}"
Expand All @@ -870,7 +870,7 @@ getProtocolParams() {
return 3
fi
else
PROT_PARAMS="$(${CCLI} ${NETWORK_ERA} query protocol-parameters ${NETWORK_IDENTIFIER} 2>&1)"
PROT_PARAMS="$(${CCLI} query protocol-parameters ${NETWORK_IDENTIFIER} 2>&1)"
if grep -q "Network.Socket.connect" <<< "${PROT_PARAMS}"; then
return 1
elif [[ -z "${PROT_PARAMS}" ]] || ! jq -er . <<< "${PROT_PARAMS}" &>/dev/null; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/cnode-helper-scripts/gLiveView.sh
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ getOpCert () {
fi
fi
if [[ -f ${opcert_file} ]]; then
op_cert="$(${CCLI} ${NETWORK_ERA} query kes-period-info ${NETWORK_IDENTIFIER} --op-cert-file "${opcert_file}")"
op_cert="$(${CCLI} query kes-period-info ${NETWORK_IDENTIFIER} --op-cert-file "${opcert_file}")"
[[ ${op_cert} =~ qKesNodeStateOperationalCertificateNumber.:[[:space:]]([0-9]+) ]] && op_cert_chain="${BASH_REMATCH[1]}"
[[ ${op_cert} =~ qKesOnDiskOperationalCertificateNumber.:[[:space:]]([0-9]+) ]] && op_cert_disk="${BASH_REMATCH[1]}"
fi
Expand Down

0 comments on commit 2ecea33

Please sign in to comment.