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 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/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 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 989f554d9..d87860cce 100755 --- a/scripts/cnode-helper-scripts/cncli.sh +++ b/scripts/cnode-helper-scripts/cncli.sh @@ -130,13 +130,12 @@ getLedgerData() { # getNodeMetrics expected to have been already run } getConsensus() { - if isNumber "$1" ; then + if isNumber "$1"; then getProtocolParamsHist "$(( $1 - 1 ))" || return 1 else getProtocolParams || return 1 fi - - if versionCheck "10.0" "${PROT_VERSION}"; then + if versionCheck "9.0" "${PROT_VERSION}"; then consensus="cpraos" stability_window_factor=3 elif versionCheck "7.0" "${PROT_VERSION}"; then @@ -617,8 +616,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/cntools.library b/scripts/cnode-helper-scripts/cntools.library index 88d419dd4..1fc35bb4b 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 } @@ -2224,7 +2226,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 +2356,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 @@ -2658,7 +2660,7 @@ delegate() { ) fi - tmpNewBalance=$(( base_lovelace )) + tmpNewBalance=${base_lovelace} build_args=( ${tx_in} "${script_args[@]}" @@ -3056,7 +3058,7 @@ modifyPool() { getAssetsTxOut - tmpNewBalance=$(( base_lovelace )) + tmpNewBalance=${base_lovelace} build_args=( ${tx_in} "${script_args[@]}" @@ -3837,7 +3839,7 @@ voteDelegation() { ) fi - tmpNewBalance=$(( base_lovelace )) + tmpNewBalance=${base_lovelace} build_args=( ${tx_in} "${script_args[@]}" @@ -3950,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}" @@ -4198,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 diff --git a/scripts/cnode-helper-scripts/cntools.sh b/scripts/cnode-helper-scripts/cntools.sh index f8e5733fd..b7db7b4a0 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 @@ -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}" @@ -4154,7 +4161,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 +4323,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 +4440,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 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/env b/scripts/cnode-helper-scripts/env index 86d52e5ec..c168cec26 100644 --- a/scripts/cnode-helper-scripts/env +++ b/scripts/cnode-helper-scripts/env @@ -1092,9 +1092,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!" @@ -1114,7 +1111,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 @@ -1219,6 +1216,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 diff --git a/scripts/cnode-helper-scripts/gLiveView.sh b/scripts/cnode-helper-scripts/gLiveView.sh index 8a7aa2649..1be56c7a7 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) @@ -1450,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++)) 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