Skip to content

Commit

Permalink
Merge branch 'alpha' into cncli_epochdata_load
Browse files Browse the repository at this point in the history
  • Loading branch information
Scitz0 authored Aug 3, 2024
2 parents 2cdd481 + d0cf528 commit 4d78d02
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 125 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker_bin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/Build/node-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <service>` 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.

Expand Down
2 changes: 1 addition & 1 deletion docs/Scripts/blockperf.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/Scripts/cncli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <status|start|stop|restart> <service name>`
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 <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 <service>` can be used to check service output (follow mode). Other logging configurations are not covered here.

Recommended workflow to get started with CNCLI blocklog.

Expand Down
2 changes: 1 addition & 1 deletion docs/Scripts/logmonitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion files/docker/node/release-versions/mithril-latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2428.0
2430.0
2 changes: 0 additions & 2 deletions scripts/cnode-helper-scripts/blockPerf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions scripts/cnode-helper-scripts/cncli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
31 changes: 19 additions & 12 deletions scripts/cnode-helper-scripts/cntools.library
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -2658,7 +2660,7 @@ delegate() {
)
fi

tmpNewBalance=$(( base_lovelace ))
tmpNewBalance=${base_lovelace}
build_args=(
${tx_in}
"${script_args[@]}"
Expand Down Expand Up @@ -3056,7 +3058,7 @@ modifyPool() {

getAssetsTxOut

tmpNewBalance=$(( base_lovelace ))
tmpNewBalance=${base_lovelace}
build_args=(
${tx_in}
"${script_args[@]}"
Expand Down Expand Up @@ -3837,7 +3839,7 @@ voteDelegation() {
)
fi

tmpNewBalance=$(( base_lovelace ))
tmpNewBalance=${base_lovelace}
build_args=(
${tx_in}
"${script_args[@]}"
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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

Expand Down
23 changes: 15 additions & 8 deletions scripts/cnode-helper-scripts/cntools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions scripts/cnode-helper-scripts/dbsync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 4d78d02

Please sign in to comment.