Skip to content

Commit

Permalink
Update populate-next-epoch-nonce.sh
Browse files Browse the repository at this point in the history
remove now missing 'contents' level when fetching nonces from protocol state
  • Loading branch information
hodlonaut authored Aug 23, 2024
1 parent 7c08625 commit 577dadb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/grest/cron/jobs/populate-next-epoch-nonce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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!"

0 comments on commit 577dadb

Please sign in to comment.