From 449d79aa1341a2839f74be4ec04e3bb6dd3d544a Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Sun, 1 Sep 2024 20:35:01 +1000 Subject: [PATCH] Update populate-next-epoch-nonce.sh [#299] --- 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!"