From 577dadb7480b9043a900a6b3e6efea06571fdb55 Mon Sep 17 00:00:00 2001 From: KoT_B_KocMoce <49576827+hodlonaut@users.noreply.github.com> Date: Sat, 24 Aug 2024 07:32:55 +1000 Subject: [PATCH] Update populate-next-epoch-nonce.sh remove now missing 'contents' level when fetching nonces from protocol state --- files/grest/cron/jobs/populate-next-epoch-nonce.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/grest/cron/jobs/populate-next-epoch-nonce.sh b/files/grest/cron/jobs/populate-next-epoch-nonce.sh index c64538f4..e54070f4 100755 --- a/files/grest/cron/jobs/populate-next-epoch-nonce.sh +++ b/files/grest/cron/jobs/populate-next-epoch-nonce.sh @@ -30,7 +30,7 @@ current_slot_in_epoch=$(curl -s "${PROM_URL}" | grep slotInEpoch | awk '{print $ next_epoch=$((current_epoch + 1)) [[ ${current_slot_in_epoch} -ge ${min_slot} ]] && - next_epoch_nonce=$(echo "$(${CCLI} query protocol-state --testnet-magic "${NWMAGIC}" | jq -r .candidateNonce.contents)$(${CCLI} query protocol-state --testnet-magic "${NWMAGIC}" | jq -r .lastEpochBlockNonce.contents)" | xxd -r -p | b2sum -b -l 256 | awk '{print $1}') && + next_epoch_nonce=$(echo "$(${CCLI} query protocol-state --testnet-magic "${NWMAGIC}" | jq -r .candidateNonce)$(${CCLI} query protocol-state --testnet-magic "${NWMAGIC}" | jq -r .lastEpochBlockNonce)" | xxd -r -p | b2sum -b -l 256 | awk '{print $1}') && psql ${DB_NAME} -c "INSERT INTO grest.epoch_info_cache (epoch_no, p_nonce) VALUES (${next_epoch}, '${next_epoch_nonce}') ON CONFLICT(epoch_no) DO UPDATE SET p_nonce='${next_epoch_nonce}';" echo "$(date +%F_%H:%M:%S) Job done!"