Last active
August 19, 2018 07:00
-
-
Save yellowred/a263ccc07be9047cf92a41e4b5c7788c to your computer and use it in GitHub Desktop.
Tezos baking/endorsement rights
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
#!/bin/bash | |
# Query baking and endorsement right for a delegate in the Tezos blockchain | |
# Usage: | |
# Set the delegate first. | |
# ./baking_rights.sh 17 20 - get right for cycles from 17 to 20 | |
# @source https://gist.github.com/yellowred/a263ccc07be9047cf92a41e4b5c7788c | |
export TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=Y; | |
DELEGATE=<delegate_hash> | |
YELLOW='\e[33m' | |
GREEN='\e[32m' | |
NC='\e[0m' | |
echo -e "${GREEN}** Tezos baking/endorsement rights **${NC}" | |
tzBakingRights() { | |
echo -e "${YELLOW}Baking rights for cycle: $1 ${NC}" | |
./tezos-client rpc get "/chains/main/blocks/head/helpers/baking_rights?delegate=${DELEGATE}&max_priority=2&cycle=$1" | |
} | |
tzEndorsmentRights() { | |
echo -e "${YELLOW}Endorsement rights for cycle: $1 ${NC}" | |
./tezos-client rpc get "/chains/main/blocks/head/helpers/endorsing_rights?delegate=${DELEGATE}&cycle=$1" | |
} | |
for cycle in $(seq $1 $2); do | |
tzBakingRights $cycle; | |
tzEndorsmentRights $cycle; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment