From 8bf98569e87ab95e2e72fef8d78c22d4dbce7e73 Mon Sep 17 00:00:00 2001 From: Ola Date: Tue, 30 Jul 2024 17:28:34 +0200 Subject: [PATCH 01/12] ignore node version check if unable to fetch version from running node --- scripts/cnode-helper-scripts/gLiveView.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cnode-helper-scripts/gLiveView.sh b/scripts/cnode-helper-scripts/gLiveView.sh index 8a7aa2649..5c441d460 100755 --- a/scripts/cnode-helper-scripts/gLiveView.sh +++ b/scripts/cnode-helper-scripts/gLiveView.sh @@ -60,7 +60,7 @@ setTheme() { # Do NOT modify code below # ###################################### -GLV_VERSION=v1.30.1 +GLV_VERSION=v1.30.2 PARENT="$(dirname $0)" @@ -717,6 +717,8 @@ checkPeers() { } checkNodeVersion() { + [[ ${running_node_version} = '?' ]] && return # ignore check if unable to fetch version from running node + version=$("${CNODEBIN}" version) node_version=$(grep "cardano-node" <<< "${version}" | cut -d ' ' -f2) node_rev=$(grep "git rev" <<< "${version}" | cut -d ' ' -f3 | cut -c1-8) From 6f256e0de68e17a877fab922561c004f2db4cb88 Mon Sep 17 00:00:00 2001 From: cardano-bot Date: Tue, 30 Jul 2024 17:19:31 +0000 Subject: [PATCH 02/12] New mithril release version --- files/docker/node/release-versions/mithril-latest.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/docker/node/release-versions/mithril-latest.txt b/files/docker/node/release-versions/mithril-latest.txt index a97a229be..ef1a7646e 100644 --- a/files/docker/node/release-versions/mithril-latest.txt +++ b/files/docker/node/release-versions/mithril-latest.txt @@ -1 +1 @@ -2428.0 +2430.0 From b0164caa0b4a9bbcbf7c48162d3efa54d3dad77f Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Wed, 31 Jul 2024 11:51:28 +1000 Subject: [PATCH 03/12] Remove StandardOutput/StandardError (currently pointing to deprecated syslog) from systemd definitions, closes #1792 --- docs/Build/node-cli.md | 2 +- docs/Scripts/blockperf.md | 2 +- docs/Scripts/cncli.md | 2 +- docs/Scripts/logmonitor.md | 2 +- scripts/cnode-helper-scripts/blockPerf.sh | 2 -- scripts/cnode-helper-scripts/cncli.sh | 2 -- scripts/cnode-helper-scripts/dbsync.sh | 2 -- .../cnode-helper-scripts/deploy-as-systemd.sh | 18 ------------------ scripts/cnode-helper-scripts/mithril-signer.sh | 2 -- scripts/cnode-helper-scripts/ogmios.sh | 2 -- scripts/cnode-helper-scripts/submitapi.sh | 2 -- scripts/grest-helper-scripts/setup-grest.sh | 4 ---- 12 files changed, 4 insertions(+), 38 deletions(-) diff --git a/docs/Build/node-cli.md b/docs/Build/node-cli.md index 7f91c55b1..f7b9ec559 100644 --- a/docs/Build/node-cli.md +++ b/docs/Build/node-cli.md @@ -247,7 +247,7 @@ sudo systemctl status cnode-submit-api.service ``` !!! important - In case you see the node exit unsuccessfully upon checking status, please verify you've followed the transition process correctly as documented below, and that you do not have another instance of node already running. It would help to check your system logs (`/var/log/syslog` for debian-based and `/var/log/messages` for Red Hat/CentOS/Fedora systems, you can also check `journalctl -f -u ` to examine startup attempt for services) for any errors while starting node. + In case you see the node exit unsuccessfully upon checking status, please verify you've followed the transition process correctly as documented below, and that you do not have another instance of node already running. It would help to check your system logs, you can also check `journalctl -f -u cnode` to examine startup attempt for services, and scroll up until you see output for node startup attempt) for any errors while starting node. You can use [gLiveView](../Scripts/gliveview.md) to monitor your node that was started as a systemd service. diff --git a/docs/Scripts/blockperf.md b/docs/Scripts/blockperf.md index 30d348792..ad5eccc7f 100644 --- a/docs/Scripts/blockperf.md +++ b/docs/Scripts/blockperf.md @@ -28,7 +28,7 @@ The script is best run as a background process. This can be accomplished in many #### Run as service Use the `deploy-as-systemd.sh` script to create a systemd unit file. -In this setup the script is started in "service" mode. Error/Warn level log output is handled by syslog and end up in the systems standard syslog file, normally `/var/log/syslog`. `journalctl -f -u cnode-tu-blockperf.service` can be used to check service output (follow mode). +In this setup the script is started in "service" mode. Error/Warn level log output is handled by journald. `journalctl -f -u cnode-tu-blockperf.service` can be used to check service output (follow mode). Outside the cnTools environment call `blockPerf.sh -d` to install it as a systemd service. diff --git a/docs/Scripts/cncli.md b/docs/Scripts/cncli.md index eaaf1059e..b8e3e03a6 100644 --- a/docs/Scripts/cncli.md +++ b/docs/Scripts/cncli.md @@ -50,7 +50,7 @@ You can override the values in the script at the User Variables section shown be Services are controlled by `sudo systemctl ` All services are configured as child services to `cnode.service` and as such, when an action is taken against this service it's replicated to all child services. E.g running `sudo systemctl start cnode.service` will also start all child services. -Log output is handled by syslog and end up in the systems standard syslog file, normally `/var/log/syslog`. `journalctl -f -u ` can be used to check service output (follow mode). Other logging configurations are not covered here. +Log output is handled by journald. `journalctl -f -u ` can be used to check service output (follow mode). Other logging configurations are not covered here. Recommended workflow to get started with CNCLI blocklog. diff --git a/docs/Scripts/logmonitor.md b/docs/Scripts/logmonitor.md index 2c39aada5..dacc3ff64 100644 --- a/docs/Scripts/logmonitor.md +++ b/docs/Scripts/logmonitor.md @@ -12,7 +12,7 @@ For optimal coverage, it's best run together with [CNCLI](../Scripts/cncli.md) s The script is best run as a background process. This can be accomplished in many ways but the preferred method is to run it as a systemd service. A terminal multiplexer like tmux or screen could also be used but not covered here. Use the `deploy-as-systemd.sh` script to create a systemd unit file (deployed together with [CNCLI](../Scripts/cncli.md)). -Log output is handled by syslog and end up in the systems standard syslog file, normally `/var/log/syslog`. `journalctl -f -u cnode-logmonitor.service` can be used to check service output (follow mode). Other logging configurations are not covered here. +Log output is handled by journald. `journalctl -f -u cnode-logmonitor.service` can be used to check service output (follow mode). Other logging configurations are not covered here. ##### View Blocklog Best viewed in CNTools or gLiveView. See [CNCLI](../Scripts/cncli.md) for example output. diff --git a/scripts/cnode-helper-scripts/blockPerf.sh b/scripts/cnode-helper-scripts/blockPerf.sh index 25b63a592..3508b546c 100755 --- a/scripts/cnode-helper-scripts/blockPerf.sh +++ b/scripts/cnode-helper-scripts/blockPerf.sh @@ -43,8 +43,6 @@ User=$USER WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/blockPerf.sh -s\" KillSignal=SIGINT -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-tu-blockperf TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/cncli.sh b/scripts/cnode-helper-scripts/cncli.sh index 7db963483..76e30ef6d 100755 --- a/scripts/cnode-helper-scripts/cncli.sh +++ b/scripts/cnode-helper-scripts/cncli.sh @@ -609,8 +609,6 @@ WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh metrics serve\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${CNODE_VNAME}_cncli_exporter TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/dbsync.sh b/scripts/cnode-helper-scripts/dbsync.sh index d3e9e057a..1317fcfaa 100755 --- a/scripts/cnode-helper-scripts/dbsync.sh +++ b/scripts/cnode-helper-scripts/dbsync.sh @@ -94,8 +94,6 @@ deploy_systemd() { WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/dbsync.sh\" KillSignal=SIGINT - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-dbsync TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/deploy-as-systemd.sh b/scripts/cnode-helper-scripts/deploy-as-systemd.sh index bd23d74c4..36ab9dd95 100755 --- a/scripts/cnode-helper-scripts/deploy-as-systemd.sh +++ b/scripts/cnode-helper-scripts/deploy-as-systemd.sh @@ -71,8 +71,6 @@ Type=oneshot User=$USER WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/topologyUpdater.sh -f\" -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-tu-push EOF" sudo bash -c "cat << 'EOF' > /etc/systemd/system/${vname}-tu-push.timer @@ -103,8 +101,6 @@ User=$USER WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/topologyUpdater.sh -p\" ExecStartPost=/bin/sleep 5 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-tu-fetch [Install] @@ -118,8 +114,6 @@ Description=Cardano Node - Topology Updater - restart ${vname}.service for topol Type=oneshot WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -c \"/bin/systemctl try-restart ${vname}.service 2>/dev/null || /usr/bin/systemctl try-restart ${vname}.service 2>/dev/null\" -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-tu-restart EOF" sudo bash -c "cat << 'EOF' > /etc/systemd/system/${vname}-tu-restart.timer @@ -185,8 +179,6 @@ ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh sync\" ExecStop=/bin/bash -l -c \"exec kill -2 \$(ps -ef | grep [c]ncli.sync.*.${CNODE_HOME}/ | tr -s ' ' | cut -d ' ' -f2) &>/dev/null\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-sync TimeoutStopSec=5 KillMode=mixed @@ -207,8 +199,6 @@ User=$USER WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh leaderlog\" SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-leaderlog TimeoutStopSec=5 KillMode=mixed @@ -231,8 +221,6 @@ WorkingDirectory=${CNODE_HOME}/scripts ExecStartPre=/bin/sleep 5 ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh validate\" SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-validate TimeoutStopSec=5 KillMode=mixed @@ -264,8 +252,6 @@ ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh ptsendslots\" ExecStop=/bin/bash -l -c \"exec kill -2 \$(ps -ef | grep [c]ncli.sendslots.*.${vname}-pooltool.json | tr -s ' ' | cut -d ' ' -f2) &>/dev/null\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-ptsendslots TimeoutStopSec=5 KillMode=mixed @@ -306,8 +292,6 @@ ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/logMonitor.sh\" ExecStop=/bin/bash -l -c \"exec kill -2 \$(ps -ef | grep -m1 ${CNODE_HOME}/scripts/logMonitor.sh | tr -s ' ' | cut -d ' ' -f2) &>/dev/null\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-logmonitor TimeoutStopSec=5 KillMode=mixed @@ -373,8 +357,6 @@ ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh ptsendtip\" ExecStop=/bin/bash -l -c \"exec kill -2 \$(ps -ef | grep [c]ncli.sendtip.*.${vname}-pooltool.json | tr -s ' ' | cut -d ' ' -f2) &>/dev/null\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-ptsendtip TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/mithril-signer.sh b/scripts/cnode-helper-scripts/mithril-signer.sh index 9329bf6e1..f8f24cb0a 100755 --- a/scripts/cnode-helper-scripts/mithril-signer.sh +++ b/scripts/cnode-helper-scripts/mithril-signer.sh @@ -68,8 +68,6 @@ deploy_systemd() { ExecStart=/bin/bash -l -c \"exec ${HOME}/.local/bin/$(basename "${0::-3}") -vv\" KillSignal=SIGINT SuccessExitStatus=143 - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-$(basename "${0::-3}") TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/ogmios.sh b/scripts/cnode-helper-scripts/ogmios.sh index 97fe7bab4..ba92dcfb2 100755 --- a/scripts/cnode-helper-scripts/ogmios.sh +++ b/scripts/cnode-helper-scripts/ogmios.sh @@ -82,8 +82,6 @@ deploy_systemd() { ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/ogmios.sh \" KillSignal=SIGINT SuccessExitStatus=143 - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-ogmios TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/submitapi.sh b/scripts/cnode-helper-scripts/submitapi.sh index 80347e8f3..33341e6de 100755 --- a/scripts/cnode-helper-scripts/submitapi.sh +++ b/scripts/cnode-helper-scripts/submitapi.sh @@ -65,8 +65,6 @@ deploy_systemd() { ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/submitapi.sh\" KillSignal=SIGINT SuccessExitStatus=143 - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-submit-api TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/grest-helper-scripts/setup-grest.sh b/scripts/grest-helper-scripts/setup-grest.sh index 3372923cf..3e3e1573e 100755 --- a/scripts/grest-helper-scripts/setup-grest.sh +++ b/scripts/grest-helper-scripts/setup-grest.sh @@ -476,8 +476,6 @@ SGVERSION=1.2.0a LimitNOFILE=1048576 ExecStart=/home/authenticator/.local/bin/postgrest ${CNODE_HOME}/priv/grest.conf ExecReload=/bin/kill -SIGUSR1 \\\$MAINPID - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=postgrest [Install] @@ -520,8 +518,6 @@ SGVERSION=1.2.0a ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/grest-exporter.sh\" KillSignal=SIGINT SuccessExitStatus=143 - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=grest_exporter TimeoutStopSec=5 KillMode=mixed From dbb8b871e7d0e5ec5051a265e4eb912a27c08afc Mon Sep 17 00:00:00 2001 From: Ola Date: Wed, 31 Jul 2024 08:48:42 +0200 Subject: [PATCH 04/12] Change protocol version check for conway from 10 => 9 --- scripts/cnode-helper-scripts/cncli.sh | 2 +- scripts/cnode-helper-scripts/cntools.library | 4 ++-- scripts/cnode-helper-scripts/cntools.sh | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/cnode-helper-scripts/cncli.sh b/scripts/cnode-helper-scripts/cncli.sh index 76e30ef6d..e3576c66e 100755 --- a/scripts/cnode-helper-scripts/cncli.sh +++ b/scripts/cnode-helper-scripts/cncli.sh @@ -128,7 +128,7 @@ getLedgerData() { # getNodeMetrics expected to have been already run getConsensus() { getProtocolParams - if versionCheck "10.0" "${PROT_VERSION}"; then + if versionCheck "9.0" "${PROT_VERSION}"; then consensus="cpraos" stability_window_factor=3 elif versionCheck "8.0" "${PROT_VERSION}"; then diff --git a/scripts/cnode-helper-scripts/cntools.library b/scripts/cnode-helper-scripts/cntools.library index 88d419dd4..0970a8610 100644 --- a/scripts/cnode-helper-scripts/cntools.library +++ b/scripts/cnode-helper-scripts/cntools.library @@ -2224,7 +2224,7 @@ registerStakeWallet() { stake_param=("--stake-verification-key-file" "${stake_vk_file}") fi - if versionCheck "10.0" "${PROT_VERSION}"; then + if versionCheck "9.0" "${PROT_VERSION}"; then stake_param+=("--key-reg-deposit-amt" ${KEY_DEPOSIT}) fi @@ -2354,7 +2354,7 @@ deregisterStakeWallet() { stake_param=("--stake-verification-key-file" "${stake_vk_file}") fi - if versionCheck "10.0" "${PROT_VERSION}"; then + if versionCheck "9.0" "${PROT_VERSION}"; then stake_param+=("--key-reg-deposit-amt" ${stake_deposit}) fi diff --git a/scripts/cnode-helper-scripts/cntools.sh b/scripts/cnode-helper-scripts/cntools.sh index f8e5733fd..1d44ea556 100755 --- a/scripts/cnode-helper-scripts/cntools.sh +++ b/scripts/cnode-helper-scripts/cntools.sh @@ -1120,7 +1120,7 @@ function main { [[ -z ${reward_addr} ]] && println "\n${FG_YELLOW}INFO${NC}: '${FG_LGRAY}${WALLET_STAKE_ADDR_FILENAME}${NC}' missing and '${FG_LGRAY}${WALLET_STAKE_VK_FILENAME}${NC}' to generate it!" drep_script_file="${WALLET_FOLDER}/${wallet_name}/${WALLET_GOV_DREP_SCRIPT_FILENAME}" - if [[ ${CNTOOLS_MODE} != "OFFLINE" && ! -f "${drep_script_file}" ]] && versionCheck "10.0" "${PROT_VERSION}"; then + if [[ ${CNTOOLS_MODE} != "OFFLINE" && ! -f "${drep_script_file}" ]] && versionCheck "9.0" "${PROT_VERSION}"; then println "DEBUG" "\nGovernance Vote Delegation Status" unset walletName if getWalletVoteDelegation ${wallet_name}; then @@ -3850,7 +3850,7 @@ function main { println " >> VOTE >> GOVERNANCE >> INFO & STATUS" println DEBUG "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo - if ! versionCheck "10.0" "${PROT_VERSION}"; then + if ! versionCheck "9.0" "${PROT_VERSION}"; then println INFO "${FG_YELLOW}Not yet in Conway era, please revisit once network has crossed into Cardano governance era!${NC}"; waitToProceed && continue fi [[ ! $(ls -A "${WALLET_FOLDER}" 2>/dev/null) ]] && echo && println "${FG_YELLOW}No wallets available!${NC}" && waitToProceed && continue @@ -3960,7 +3960,7 @@ function main { println DEBUG "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" println " >> VOTE >> GOVERNANCE >> DELEGATE" println DEBUG "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - if ! versionCheck "10.0" "${PROT_VERSION}"; then + if ! versionCheck "9.0" "${PROT_VERSION}"; then println INFO "\n${FG_YELLOW}Not yet in Conway era, please revisit once network has crossed into Cardano governance era!${NC}"; waitToProceed && continue fi if [[ ${CNTOOLS_MODE} = "OFFLINE" ]]; then @@ -4154,7 +4154,7 @@ function main { println " >> VOTE >> GOVERNANCE >> CAST VOTE" println DEBUG "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo - if ! versionCheck "10.0" "${PROT_VERSION}"; then + if ! versionCheck "9.0" "${PROT_VERSION}"; then println INFO "${FG_YELLOW}Not yet in Conway era, please revisit once network has crossed into Cardano governance era!${NC}"; waitToProceed && continue fi if [[ ${CNTOOLS_MODE} = "OFFLINE" ]]; then @@ -4316,7 +4316,7 @@ function main { println DEBUG "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" println " >> VOTE >> GOVERNANCE >> DREP REGISTRATION / UPDATE" println DEBUG "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - if ! versionCheck "10.0" "${PROT_VERSION}"; then + if ! versionCheck "9.0" "${PROT_VERSION}"; then println INFO "\n${FG_YELLOW}Not yet in Conway era, please revisit once network has crossed into Cardano governance era!${NC}"; waitToProceed && continue fi if [[ ${CNTOOLS_MODE} = "OFFLINE" ]]; then @@ -4433,7 +4433,7 @@ function main { println DEBUG "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" println " >> VOTE >> GOVERNANCE >> DREP RETIRE" println DEBUG "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - if ! versionCheck "10.0" "${PROT_VERSION}"; then + if ! versionCheck "9.0" "${PROT_VERSION}"; then println INFO "\n${FG_YELLOW}Not yet in Conway era, please revisit once network has crossed into Cardano governance era!${NC}"; waitToProceed && continue fi if [[ ${CNTOOLS_MODE} = "OFFLINE" ]]; then From eb4098ff7c8782fc5bfa561370e71e025205533e Mon Sep 17 00:00:00 2001 From: Ola Date: Wed, 31 Jul 2024 18:27:09 +0200 Subject: [PATCH 05/12] Fix order of execution in env --- scripts/cnode-helper-scripts/env | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/cnode-helper-scripts/env b/scripts/cnode-helper-scripts/env index f45f95e32..71bd41ba6 100644 --- a/scripts/cnode-helper-scripts/env +++ b/scripts/cnode-helper-scripts/env @@ -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!" @@ -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 @@ -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 From 31eadb3ddbe3257a0ed8aafe589f87344445ea01 Mon Sep 17 00:00:00 2001 From: Greg B Date: Thu, 1 Aug 2024 08:09:51 +0800 Subject: [PATCH 06/12] Added reward_stake_deposit to store fetched delegation deposit, initializing stake_deposit now in light mode using that to fix de-registration of wallet --- scripts/cnode-helper-scripts/cntools.library | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/cnode-helper-scripts/cntools.library b/scripts/cnode-helper-scripts/cntools.library index 0970a8610..86085a589 100644 --- a/scripts/cnode-helper-scripts/cntools.library +++ b/scripts/cnode-helper-scripts/cntools.library @@ -1662,6 +1662,7 @@ getWalletRewards() { : # do nothing, variables populated through isWalletRegistered else reward_lovelace=${rewards_available[${reward_addr}]:-0} + stake_deposit=${reward_stake_deposit[${reward_addr}]} fi fi } @@ -1672,7 +1673,7 @@ getRewardInfoKoios() { # generate different arrays using reward address as key, rewards available, status and delegated pool if any # Its assumed that an array called reward_addr_list has been populated with all reward addresses to fetch data for - declare -gA rewards_available=(); declare -gA reward_status=(); declare -gA reward_pool=(); + declare -gA rewards_available=(); declare -gA reward_status=(); declare -gA reward_pool=(); declare -gA reward_stake_deposit=(); # set defaults for _reward_addr in "${reward_addr_list[@]}"; do @@ -1683,14 +1684,15 @@ getRewardInfoKoios() { if [[ -n ${KOIOS_API} && -n ${reward_addr_list+x} ]]; then printf -v addr_list_joined '\"%s\",' "${reward_addr_list[@]}" - println ACTION "curl -sSL -f -X POST -H \"Content-Type: application/json\" -H \"accept: text/csv\" -d '{\"_stake_addresses\":[${addr_list_joined%,}]}' ${KOIOS_API}/account_info?select=stake_address,status,delegated_pool,rewards_available" - ! account_info_list=$(curl -sSL -f -X POST -H "Content-Type: application/json" -H "accept: text/csv" -d '{"_stake_addresses":['${addr_list_joined%,}']}' "${KOIOS_API}/account_info?select=stake_address,status,delegated_pool,rewards_available" 2>&1) && println "ERROR" "\n${FG_RED}KOIOS_API ERROR${NC}: ${account_info_list}\n" && return 1 # print error and return + println ACTION "curl -sSL -f -X POST -H \"Content-Type: application/json\" -H \"accept: text/csv\" -d '{\"_stake_addresses\":[${addr_list_joined%,}]}' ${KOIOS_API}/account_info?select=stake_address,status,delegated_pool,rewards_available,deposit" + ! account_info_list=$(curl -sSL -f -X POST -H "Content-Type: application/json" -H "accept: text/csv" -d '{"_stake_addresses":['${addr_list_joined%,}']}' "${KOIOS_API}/account_info?select=stake_address,status,delegated_pool,rewards_available,deposit" 2>&1) && println "ERROR" "\n${FG_RED}KOIOS_API ERROR${NC}: ${account_info_list}\n" && return 1 # print error and return [[ -z ${account_info_list} ]] && return - while IFS=',' read -r stake_address status delegated_pool rewards_available; do + while IFS=',' read -r stake_address status delegated_pool rewards_available deposit; do [[ ${stake_address} = stake_address ]] && continue # header line reward_status["${stake_address}"]="${status}" rewards_available["${stake_address}"]="${rewards_available}" [[ -n ${delegated_pool} ]] && reward_pool["${stake_address}"]="${delegated_pool}" + reward_stake_deposit["${stake_address}"]="${deposit}" done <<< "${account_info_list}" fi } From 46bf25dfbbc5f1f161b8ad6a65de819ccad7e375 Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Thu, 1 Aug 2024 10:44:20 +1000 Subject: [PATCH 07/12] Add docker-alpha for manually publishing changes to docker --- .github/workflows/docker_bin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_bin.yml b/.github/workflows/docker_bin.yml index 4e260d064..94c149e06 100644 --- a/.github/workflows/docker_bin.yml +++ b/.github/workflows/docker_bin.yml @@ -41,7 +41,7 @@ jobs: - name: Set TESTING id: set_testing run: | - echo "testing=${{ github.event_name == 'push' && (steps.vars.outputs.branch != 'master') || github.event.inputs.testing }}" >> $GITHUB_OUTPUT + echo "testing=${{ github.event_name == 'push' && (steps.vars.outputs.branch != 'master' || needs.set_environment_vars.outputs.guild_deploy_branch == 'docker-alpha') || github.event.inputs.testing }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 with: ref: ${{ steps.set_guild_deploy_branch.outputs.guild_deploy_branch }} @@ -55,7 +55,7 @@ jobs: echo "cnversion=$(cat files/docker/node/release-versions/cardano-node-latest.txt)" >> $GITHUB_OUTPUT build_production: needs: set_environment_vars - if: needs.set_environment_vars.outputs.testing == 'false' && needs.set_environment_vars.outputs.guild_deploy_branch == 'master' + if: needs.set_environment_vars.outputs.testing == 'false' && (needs.set_environment_vars.outputs.guild_deploy_branch == 'master' || needs.set_environment_vars.outputs.guild_deploy_branch == 'docker-alpha') env: REGISTRY: docker.io runs-on: ubuntu-latest From 87cf4632cc4047f26248ec911dc4fc1179658752 Mon Sep 17 00:00:00 2001 From: Greg B Date: Thu, 1 Aug 2024 13:17:20 +0800 Subject: [PATCH 08/12] Fix drep update min fee calculation --- scripts/cnode-helper-scripts/cntools.library | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/cnode-helper-scripts/cntools.library b/scripts/cnode-helper-scripts/cntools.library index 86085a589..ae2ee8205 100644 --- a/scripts/cnode-helper-scripts/cntools.library +++ b/scripts/cnode-helper-scripts/cntools.library @@ -3952,7 +3952,12 @@ registerDRep() { ) fi - tmpNewBalance=$(( base_lovelace - DREP_DEPOSIT )) + if [[ ${is_update} = N ]]; then + tmpNewBalance=$(( base_lovelace - DREP_DEPOSIT )) + else + tmpNewBalance=$(( base_lovelace )) + fi + build_args=( ${tx_in} --tx-out "${base_addr}+${tmpNewBalance}${assets_tx_out}" From 9757078fe245e3e714c9629774d4892c857926f6 Mon Sep 17 00:00:00 2001 From: Ola Date: Thu, 1 Aug 2024 08:07:44 +0200 Subject: [PATCH 09/12] replace unnecessary bash math syntax with direct variable mapping --- scripts/cnode-helper-scripts/cntools.library | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/cnode-helper-scripts/cntools.library b/scripts/cnode-helper-scripts/cntools.library index ae2ee8205..326a984e5 100644 --- a/scripts/cnode-helper-scripts/cntools.library +++ b/scripts/cnode-helper-scripts/cntools.library @@ -2660,7 +2660,7 @@ delegate() { ) fi - tmpNewBalance=$(( base_lovelace )) + tmpNewBalance=${base_lovelace} build_args=( ${tx_in} "${script_args[@]}" @@ -3058,7 +3058,7 @@ modifyPool() { getAssetsTxOut - tmpNewBalance=$(( base_lovelace )) + tmpNewBalance=${base_lovelace} build_args=( ${tx_in} "${script_args[@]}" @@ -3839,7 +3839,7 @@ voteDelegation() { ) fi - tmpNewBalance=$(( base_lovelace )) + tmpNewBalance=${base_lovelace} build_args=( ${tx_in} "${script_args[@]}" @@ -3955,7 +3955,7 @@ registerDRep() { if [[ ${is_update} = N ]]; then tmpNewBalance=$(( base_lovelace - DREP_DEPOSIT )) else - tmpNewBalance=$(( base_lovelace )) + tmpNewBalance=${base_lovelace} fi build_args=( From c0c42afb7d0cbf8e61c7eafe1542823c78f0ebd9 Mon Sep 17 00:00:00 2001 From: Greg Beresnev Date: Fri, 2 Aug 2024 12:47:26 +1000 Subject: [PATCH 10/12] Corrected minimum Ada check for governance vote command --- scripts/cnode-helper-scripts/cntools.library | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cnode-helper-scripts/cntools.library b/scripts/cnode-helper-scripts/cntools.library index 326a984e5..1fc35bb4b 100644 --- a/scripts/cnode-helper-scripts/cntools.library +++ b/scripts/cnode-helper-scripts/cntools.library @@ -4205,10 +4205,10 @@ governanceVote() { newBalance=$(( base_lovelace - min_fee )) println LOG "New balance after subtracted tx fee is $(formatLovelace ${newBalance}) ADA ($(formatLovelace ${base_lovelace}) - $(formatLovelace ${min_fee}))" - if [[ ${base_lovelace} -lt ${fee} ]]; then + if [[ ${base_lovelace} -lt ${min_fee} ]]; then println ERROR "\n${FG_RED}ERROR${NC}: Not enough ADA in base address!"\ "Funds in address: ${FG_LBLUE}$(formatLovelace ${base_lovelace})${NC} ADA"\ - "Minimum required: ${FG_LBLUE}$(formatLovelace ${fee})${NC} ADA" + "Minimum required: ${FG_LBLUE}$(formatLovelace ${min_fee})${NC} ADA" return 1 fi From ffba90f6409734b09bffab187c2fd66ef11bc871 Mon Sep 17 00:00:00 2001 From: Greg Beresnev Date: Fri, 2 Aug 2024 15:45:19 +1000 Subject: [PATCH 11/12] Mention number of proposals found, don't prompt for page size if less than one page worth, visually mark expired proposal epoch in red --- scripts/cnode-helper-scripts/cntools.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/cnode-helper-scripts/cntools.sh b/scripts/cnode-helper-scripts/cntools.sh index 1d44ea556..b7db7b4a0 100755 --- a/scripts/cnode-helper-scripts/cntools.sh +++ b/scripts/cnode-helper-scripts/cntools.sh @@ -4086,12 +4086,15 @@ function main { println "${FG_YELLOW}No active proposals to vote on!${NC}" waitToProceed && continue fi - getAnswerAnyCust page_entries "Enter number of actions to display per page (enter for 5)" + if [[ ${action_cnt} -gt 5 ]]; then + getAnswerAnyCust page_entries "${action_cnt} proposals found. Enter number of actions to display per page (enter for 5)" + fi page_entries=${page_entries:=5} if ! isNumber ${page_entries} || [[ ${page_entries} -eq 0 ]]; then println ERROR "${FG_RED}ERROR${NC}: invalid number" waitToProceed && continue fi + curr_epoch=$(getEpoch) page=1 pages=$(( (action_cnt + (page_entries - 1)) / page_entries )) echo @@ -4119,7 +4122,11 @@ function main { printf "| %-13s : ${FG_LGRAY}%-${max_len}s${NC} |\n" "Action ID" "${action_id}" printf "| %-13s : ${FG_LGRAY}%-${max_len}s${NC} |\n" "Type" "${action_type}" printf "| %-13s : epoch ${FG_LBLUE}%-$(( max_len - 6 ))s${NC} |\n" "Proposed In" "${proposed_in}" - printf "| %-13s : epoch ${FG_LBLUE}%-$(( max_len - 6 ))s${NC} |\n" "Expires After" "${expires_after}" + if [[ ${expires_after} -lt ${curr_epoch} ]]; then + printf "| %-13s : epoch ${FG_RED}%-$(( max_len - 6 ))s${NC} |\n" "Expires After" "${expires_after}" + else + printf "| %-13s : epoch ${FG_LBLUE}%-$(( max_len - 6 ))s${NC} |\n" "Expires After" "${expires_after}" + fi printf "| %-13s : ${FG_LGRAY}%-${max_len}s${NC} |\n" "Anchor URL" "${anchor_url}" printf "| %-13s : Yes=${FG_LBLUE}%s${NC} No=${FG_LBLUE}%s${NC} Abstain=${FG_LBLUE}%-$((max_len-4-${#drep_yes}-4-${#drep_no}-9))s${NC} |\n" "DRep" "${drep_yes}" "${drep_no}" "${drep_abstain}" printf "| %-13s : Yes=${FG_LBLUE}%s${NC} No=${FG_LBLUE}%s${NC} Abstain=${FG_LBLUE}%-$((max_len-4-${#spo_yes}-4-${#spo_no}-9))s${NC} |\n" "SPO" "${spo_yes}" "${spo_no}" "${spo_abstain}" From d0cf5285c5eb3855b56fd0d589f5dc271d32a039 Mon Sep 17 00:00:00 2001 From: illuminatus Date: Fri, 2 Aug 2024 15:42:08 -0700 Subject: [PATCH 12/12] Disable mithril signers section outside of main gLiveView views. (#1796) ## Description Only display mithril signers in the main gLiveView window, not during peer analysis views. Allowing SPO's with Mithril Signers running on both core and relay to leverage mithril signer section details. ## Which issue it fixes? closes #1795 --- scripts/cnode-helper-scripts/gLiveView.sh | 112 +++++++++++----------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/scripts/cnode-helper-scripts/gLiveView.sh b/scripts/cnode-helper-scripts/gLiveView.sh index 5c441d460..1be56c7a7 100755 --- a/scripts/cnode-helper-scripts/gLiveView.sh +++ b/scripts/cnode-helper-scripts/gLiveView.sh @@ -1452,66 +1452,66 @@ while true; do closeRow fi fi - fi - - if [[ "${MITHRIL_SIGNER_ENABLED}" == "Y" ]] ; then - # Mithril Signer Section - mithrilSignerVars - printf "${mithrildivider}\n" && ((line++)) - get_metric_value() { - local metric_name="$1" - local metric_value - while IFS= read -r line; do - if [[ $line =~ ${metric_name}[[:space:]]+([0-9]+) ]]; then - metric_value="${BASH_REMATCH[1]}" - echo "$metric_value" - return - fi - done <<< "$mithrilSignerMetrics" - } - metrics=( - "runtime_cycle_total_since_startup" - "signer_registration_success_last_epoch" - "signer_registration_success_since_startup" - "signer_registration_total_since_startup" - "signature_registration_success_last_epoch" - "signature_registration_success_since_startup" - "signature_registration_total_since_startup" - ) - cycle_total_VAL=$(get_metric_value "runtime_cycle_total_since_startup") - signer_reg_epoch_VAL=$(get_metric_value "signer_registration_success_last_epoch") - signer_reg_success_VAL=$(get_metric_value "signer_registration_success_since_startup") - signer_reg_total_VAL=$(get_metric_value "signer_registration_total_since_startup") - signatures_epoch_VAL=$(get_metric_value "signature_registration_success_last_epoch") - signatures_reg_success_VAL=$(get_metric_value "signature_registration_success_since_startup") - signatures_reg_total_VAL=$(get_metric_value "signature_registration_total_since_startup") - if [[ ${VERBOSE} = "Y" ]]; then - printf "${VL} Status : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signerServiceStatus" - printf " : Registered Epoch : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_epoch_VAL" - closeRow - printf "${VL} Cycles : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$cycle_total_VAL" - printf " : Signing in Epoch : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_epoch_VAL" - closeRow - printf "${VL} Signatures : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_reg_success_VAL" - printf " : Total Signatures : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signatures_reg_total_VAL" - closeRow - printf "${VL} Registered : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_success_VAL" - printf " : Registered Total : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_total_VAL" - closeRow - else - printf "${VL} Status : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signerServiceStatus" - printf " : Registered Epoch : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_epoch_VAL" - closeRow - printf "${VL} Cycles : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$cycle_total_VAL" - printf " : Signing in Epoch : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_epoch_VAL" - closeRow - printf "${VL} Signatures : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_reg_success_VAL" - printf " : Total Signatures : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signatures_reg_total_VAL" - closeRow + if [[ "${MITHRIL_SIGNER_ENABLED}" == "Y" ]]; then + # Mithril Signer Section + mithrilSignerVars + printf "${mithrildivider}\n" && ((line++)) + get_metric_value() { + local metric_name="$1" + local metric_value + while IFS= read -r line; do + if [[ $line =~ ${metric_name}[[:space:]]+([0-9]+) ]]; then + metric_value="${BASH_REMATCH[1]}" + echo "$metric_value" + return + fi + done <<< "$mithrilSignerMetrics" + } + metrics=( + "runtime_cycle_total_since_startup" + "signer_registration_success_last_epoch" + "signer_registration_success_since_startup" + "signer_registration_total_since_startup" + "signature_registration_success_last_epoch" + "signature_registration_success_since_startup" + "signature_registration_total_since_startup" + ) + cycle_total_VAL=$(get_metric_value "runtime_cycle_total_since_startup") + signer_reg_epoch_VAL=$(get_metric_value "signer_registration_success_last_epoch") + signer_reg_success_VAL=$(get_metric_value "signer_registration_success_since_startup") + signer_reg_total_VAL=$(get_metric_value "signer_registration_total_since_startup") + signatures_epoch_VAL=$(get_metric_value "signature_registration_success_last_epoch") + signatures_reg_success_VAL=$(get_metric_value "signature_registration_success_since_startup") + signatures_reg_total_VAL=$(get_metric_value "signature_registration_total_since_startup") + if [[ ${VERBOSE} = "Y" ]]; then + printf "${VL} Status : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signerServiceStatus" + printf " : Registered Epoch : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_epoch_VAL" + closeRow + printf "${VL} Cycles : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$cycle_total_VAL" + printf " : Signing in Epoch : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_epoch_VAL" + closeRow + printf "${VL} Signatures : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_reg_success_VAL" + printf " : Total Signatures : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signatures_reg_total_VAL" + closeRow + printf "${VL} Registered : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_success_VAL" + printf " : Registered Total : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_total_VAL" + closeRow + else + printf "${VL} Status : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signerServiceStatus" + printf " : Registered Epoch : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signer_reg_epoch_VAL" + closeRow + printf "${VL} Cycles : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$cycle_total_VAL" + printf " : Signing in Epoch : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_epoch_VAL" + closeRow + printf "${VL} Signatures : ${style_values_2}%-${three_col_1_value_width}s${NC}" "$signatures_reg_success_VAL" + printf " : Total Signatures : ${style_values_1}%-${three_col_1_value_width}s${NC}" "$signatures_reg_total_VAL" + closeRow + fi fi fi + [[ ${check_peers} = "true" ]] && check_peers=false && show_peers=true && clrScreen && continue echo "${bdivider}" && ((line++))