-
-
Save garethtdavies/2eb8ecf459653b9c2aa93bc2512f17d6 to your computer and use it in GitHub Desktop.
Evaluate VRF output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate the input for the epoch | |
for i in {49980..57120}; do echo "{\"globalSlot\": \"$i\",\"epochSeed\": \"2vb6kwsBmK8ZqJmoLeTXpofEMkXirHmtD6ixTEaiBzzqKmqyNQBD\",\"delegatorIndex\": 1276}"; done > input.txt | |
# Generate the batch witnesses | |
cat input.txt | mina advanced vrf batch-generate-witness --privkey-path ~/path-to-my-wallet > batch-generated.txt | |
# Add in the threshold for VRF evaluation | |
sed -i 's/]/],"vrfThreshold":{"delegatedStake":"1704440.324956633","totalStake":"829489852.840039300"}/g' batch-generated.txt | |
# Optional: Remove the using password lines if using env vars | |
sed -i -e 1,3d batch-generated.txt | |
# Generate the batch-check-witnesses | |
cat batch-generated.txt | mina advanced vrf batch-check-witness > batch-check.txt | |
# How many slots did we win | |
cat batch-check.txt | grep true | wc -l | |
# Which slots did we win | |
cat batch-check.txt | grep -B19 true | awk -F '\n' 'ln ~ /^$/ { ln = "matched"; print $1 } $1 ~ /^--$/ { ln = "" }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make a local GraphQL request to Mina daemon: