English
Configuring Slot Leader Calculations
โ€‹
๐Ÿ”ฅ
Hot tip: You can calculate your slot leader schedule, which tells you when it's your stake pools turn to mint a block. This can help you know what time is best to schedule maintenance on your stake pool. It can also help verify your pool is minting blocks correctly when it is your pool's turn. This is to be setup and run on the block producer node.
Cardano-CLI Query
CNCLI Tool
[Deprecated] Python Method
Since version 1.34, it is possible to check the slot leadership schedule for the current and next epoch using cardano-cli.
Next epoch's leadership schedule becomes available 1.5 days (36 hours) before the end of the current epoch.
โ€‹
Next epoch's leadership schedule is obtained with the following:
1
cardano-cli query leadership-schedule \
2
--mainnet \
3
--genesis $NODE_HOME/mainnet-shelley-genesis.json \
4
--stake-pool-id $(cat $NODE_HOME/stakepoolid.txt) \
5
--vrf-signing-key-file $NODE_HOME/vrf.skey \
6
--next
Copied!
โ€‹
Current epoch's leadership schedule is obtained with the following:
1
cardano-cli query leadership-schedule \
2
--mainnet \
3
--genesis $NODE_HOME/mainnet-shelley-genesis.json \
4
--stake-pool-id $(cat $NODE_HOME/stakepoolid.txt) \
5
--vrf-signing-key-file $NODE_HOME/vrf.skey \
6
--current
Copied!
Example leadership schedule output:
1
SlotNo UTC Time
2
-------------------------------------------------------------
3
4073 2021-12-29 17:26:54.998001755 UTC
4
4126 2021-12-29 17:27:00.298001755 UTC
5
4206 2021-12-29 17:27:08.298001755 UTC
6
4256 2021-12-29 17:27:13.298001755 UTC
7
4309 2021-12-29 17:27:18.598001755 UTC
8
4376 2021-12-29 17:27:25.298001755 UTC
9
4423 2021-12-29 17:27:29.998001755 UTC
10
4433 2021-12-29 17:27:30.998001755 UTC
Copied!
โ€‹
๐Ÿ”
Automate the process with Cronjob:
The automation of this process will work with the following method, as said, next epoch blocks can be checked 1.5 days before the start of the next epoch or at the 75% of the current epoch's completion. What the script will do, is to calculate the the correct day and hour to run the command, then wait until it is possible to do that and once the selected time comes, run the check listed below. Once finished, it will redirect the output into a log file that can be analyzed.
Keep in mind that running the leadership-schedule command, listed below and used by the script, with the cardano-node at the same time, will use approximately 17GB of RAM at the time of writing this guide (April 2022).
The possible solutions to avoid a node crash are:
Credits to Techs2help for developing the script.
Create the leaderScheduleCheck.sh script file in the block producer (script can also be run on a relay node but vrf.skey needs to be exported there) and paste the following code inside of it:
1
#!/bin/bash
2
โ€‹
3
# cardano node directory
4
DIRECTORY=
5
โ€‹
6
if [[ ! -d "$DIRECTORY/logs" ]]; then mkdir $DIRECTORY/logs; fi
7
โ€‹
8
# create a pid, this way you can ps aux | grep leaderScheduleCheck.sh to see if script is running
9
echo $ > "$DIRECTORY/logs/leaderScheduleCheck.pid";
10
โ€‹
11
# Set your own stake pool ID
12
STAKE_POOL_ID=""
13
โ€‹
14
TESTNET="testnet"
15
MAINNET="mainnet"
16
โ€‹
17
# Edit variable with $TESTNET for Testnet and $MAINNET for Mainnet
18
network=$TESTNET
19
โ€‹
20
# check for vrf.skey presence
21
if [[ ! -f "$DIRECTORY/vrf.skey" ]]; then echo "vrf.skey not found"; exit 127; fi
22
โ€‹
23
CCLI=$(which cardano-cli)
24
if [[ -z $CCLI ]]; then echo "cardano-cli command cannot be found, exiting..."; exit 127; fi
25
โ€‹
26
JQ=$(which jq)
27
if [[ -z $JQ ]]; then echo "jq command cannot be found, exiting..."; exit 127; fi
28
โ€‹
29
read -ra BYRON_GENESIS <<< "$(jq -r '[ .startTime, .protocolConsts.k, .blockVersionData.slotDuration ] |@tsv' < $DIRECTORY/$network-byron-genesis.json)"
30
if [[ -z $BYRON_GENESIS ]]; then echo "BYRON GENESIS config file not loaded correctly"; exit 127; fi
31
โ€‹
32
network_magic=""
33
if [ $network = $TESTNET ]; then
34
network_magic="--testnet-magic 1097911063"
35
elif [ $network = $MAINNET ]; then
36
network_magic="--mainnet"
37
else
38
echo "Incorrect network selected, please use $TESTNET or $MAINNET network type"; exit 1
39
fi
40
โ€‹
41
โ€‹
42
# Check that node is synced
43
function isSynced(){
44
isSynced=false
45
โ€‹
46
sync_progress=$($CCLI query tip $network_magic | jq -r ".syncProgress")
47
if [[ $sync_progress == "100.00" ]]; then
48
isSynced=true
49
fi
50
โ€‹
51
echo $isSynced
52
}
53
โ€‹
54
# Get current epoch
55
function getCurrentEpoch(){
56
echo $($CCLI query tip $network_magic | jq -r ".epoch")
57
}
58
โ€‹
59
# Get epoch start time based on current one
60
function getEpochStartTime(){
61
byron_genesis_start_time=${BYRON_GENESIS[0]}
62
byron_k=${BYRON_GENESIS[1]}
63
byron_epoch_length=$(( 10 * byron_k ))
64
byron_slot_length=${BYRON_GENESIS[2]}
65
โ€‹
66
echo $(( $byron_genesis_start_time + (($(getCurrentEpoch) * $byron_epoch_length * $byron_slot_length) / 1000) ))
67
}
68
โ€‹
69
# Get epoch end time based on the current one
70
function getEpochEndTime(){
71
#calculate currentEpoch Start time + 5 days of epoch duration - 10 minutes(600s) to not overlap with next epoch
72
echo $(( $(getEpochStartTime)+(5*86400)-(600) ))
73
}
74
โ€‹
75
# Get current timestamp
76
function getCurrentTime(){
77
echo $(printf '%(%s)T\n' -1)
78
}
79
โ€‹
80
# Convert timestamps to UTC time
81
function timestampToUTC(){
82
timestamp=$1
83
echo $(date +"%D %T" -ud @$timestamp)
84
}
85
โ€‹
86
# Find the correct time to run the leaderslot check command
87
function getLeaderslotCheckTime(){
88
epochStartTime=$(getEpochStartTime)
89
epochEndTime=$(getEpochEndTime)
90
โ€‹
91
# epoch completion percent to check for --next epoch leaderslots
92
percentage=75
93
checkTimestamp=$(( $epochStartTime+($percentage*($epochEndTime-$epochStartTime)/100) ))
94
โ€‹
95
echo $checkTimestamp
96
}
97
โ€‹
98
# Function to make the script sleep until check need to be executed
99
function sleepUntil(){
100
sleepSeconds=$1
101
if [[ $sleepSeconds -gt 0 ]]; then
102
echo "Script is going to sleep for: $sleepSeconds seconds"
103
sleep $sleepSeconds
104
fi
105
}
106
โ€‹
107
# Check leaderschedule of next epoch
108
function checkLeadershipSchedule(){
109
next_epoch=$(( $(getCurrentEpoch)+1 ))
110
currentTime=$(getCurrentTime)
111
โ€‹
112
echo "Check is running at: $(timestampToUTC $currentTime) for epoch: $next_epoch"
113
$CCLI query leadership-schedule $network_magic --genesis "$DIRECTORY/$network-shelley-genesis.json" --stake-pool-id $STAKE_POOL_ID --vrf-signing-key-file "$DIRECTORY/vrf.skey" --next > "$DIRECTORY/logs/leaderSchedule_$next_epoch.txt"
114
}
115
โ€‹
116
if [ isSynced ];then
117
echo "Current epoch: $(getCurrentEpoch)"
118
โ€‹
119
epochStartTimestamp=$(getEpochStartTime)
120
echo "Epoch start time: $(timestampToUTC $epochStartTimestamp)"
121
โ€‹
122
epochEndTimestamp=$(getEpochEndTime)
123
echo "Epoch end time: $(timestampToUTC $epochEndTimestamp)"
124
โ€‹
125
currentTime=$(getCurrentTime)
126
echo "Current cron execution time: $(timestampToUTC $currentTime)"
127
โ€‹
128
timestampCheckLeaders=$(getLeaderslotCheckTime)
129
echo "Next check time: $(timestampToUTC $timestampCheckLeaders)"
130
โ€‹
131
timeDifference=$(( $timestampCheckLeaders-$currentTime ))
132
if [ -f "$DIRECTORY/logs/leaderSchedule_$(( $(getCurrentEpoch)+1 )).txt" ]; then
133
echo "Check already done, check logs for results"; exit 1
134
elif [[ $timeDifference -gt 86400 ]]; then
135
echo "Too early to run the script, wait for next cron scheduled job"; exit 1
136
elif [[ $timeDifference -gt 0 ]] && [[ $timeDifference -le 86400 ]]; then
137
sleepUntil $timeDifference
138
echo "Check is starting on $(timestampToUTC $(getCurrentTime))"
139
checkLeadershipSchedule
140
echo "Script ended, schedule logged inside file: leaderSchedule_$(( $(getCurrentEpoch)+1 )).txt"
141
elif [[ $timeDifference -lt 0 ]] && [ ! -f "$DIRECTORY/logs/leaderSchedule_$(( $(getCurrentEpoch)+1 )).txt" ]; then
142
echo "Check is starting on $(timestampToUTC $(getCurrentTime))"
143
checkLeadershipSchedule
144
echo "Script ended, schedule logged inside file: leaderSchedule_$(( $(getCurrentEpoch)+1 )).txt"
145
else
146
echo "There were problems on running the script, check that everything is working fine"; exit 1
147
fi
148
else
149
echo "Node not fully synced."; exit 1
150
fi
Copied!
Set the following variables with your data:
1
# cardano node directory, directory where all files needed for running a cardano-node are located
2
DIRECTORY=
3
โ€‹
4
# Set your own stake pool ID
5
STAKE_POOL_ID=""
6
โ€‹
7
# Set variable with $TESTNET for Testnet and $MAINNET for Mainnet
8
network=
Copied!
Add execution permissions and test that the script is running without errors:
1
chmod +x leaderScheduleCheck.sh
2
./leaderScheduleCheck.sh
Copied!
If everything is working correctly, an output as the follow will be presented:
Current epoch: 199 Epoch start time: 04/14/22 20:20:16 Epoch end time: 04/19/22 20:10:16 Current cron execution time: 04/18/22 15:37:51 Next check time: 04/18/22 14:12:46 [...] Cutted output cause it can vary based on time when the script is ran
Configure Cronjob to make the script run automatically:
To configure the job at the start of an epoch, keep in mind the following information:
  • Epoch in TESTNET starts at 20:20 UTC
  • Epoch in MAINNET starts at 21:45 UTC
Find the time when the cronjob should start:
Cronjobs run based on local timezone, not on UTC hours. \
Find timezone:
timedatectl | grep "Time zone"
Once you found your timezone, you need to understand when run the job (It isn't mandatory to run it at epoch's starting hour). Here is an example with a UTC+2 timezone for Mainnet:
Epoch starting hour UTC: 21:45 Epoch starting hour for requested timezone: 23:45 Cronjob will be set to run at 23:45
Add cronjob and edit parameters based on your needs, PATH, NODE_HOME, NODE_CONFIG, CARDANO_NODE_SOCKET_PATH, MM, HH, path_to_script and desired_log_folder:
1
cat > $NODE_HOME/crontab-fragment.txt << EOF
2
# disable MTA use
3
MAILTO=""
4
# linux path, needed because cron doesn't know where to find cardano-cli
5
PATH=
6
# folder with cardano-node files
7
NODE_HOME=
8
# testnet or mainnet
9
NODE_CONFIG=
10
# path to the soket of cardano node, should be under db/ folder under NODE_HOME
11
CARDANO_NODE_SOCKET_PATH=
12
โ€‹
13
MM HH * * * path_to_script/leaderScheduleCheck.sh > desired_log_folder/leaderSchedule_logs.txt 2>&1
14
EOF
15
crontab -l | cat - ${NODE_HOME}/crontab-fragment.txt > ${NODE_HOME}/crontab.txt && crontab ${NODE_HOME}/crontab.txt
16
rm ${NODE_HOME}/crontab-fragment.txt
Copied!
Once the cronjob is set, the script will be run every day and it will check if in the next 24H, it will be the correct time to run the command and see if there are scheduled blocks in the next epoch. For every epoch, there will be a file called leaderSchedule_epoch.txt
โ€‹CNCLI by BCSH, SAND, SALADโ€‹
A community-based cardano-node CLI tool. It's a collection of utilities to enhance and extend beyond those available with the cardano-cli.
โ€‹
๐Ÿงฌ
Installing the Binary
1
###
2
### On blockproducer
3
###
4
RELEASETAG=$(curl -s https://api.github.com/repos/AndrewWestberg/cncli/releases/latest | jq -r .tag_name)
5
VERSION=$(echo ${RELEASETAG} | cut -c 2-)
6
echo "Installing release ${RELEASETAG}"
7
curl -sLJ https://github.com/AndrewWestberg/cncli/releases/download/${RELEASETAG}/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -o /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
Copied!
1
sudo tar xzvf /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin/
Copied!
Confirming That CNCLI is Properly Installed
Run the following command to check if cncli is correctly installed and available in your system PATH variable:
1
command -v cncli
Copied!
It should return /usr/local/bin/cncli
โ€‹
โ›
Running LeaderLog with stake-snapshot
This command calculates a stake pool's expected slot list.
  • prev and current logs are available as long as you have a synchronized database.
  • next logs are only available 1.5 days (36 hours) before the end of the epoch.
  • You need to use poolStakeMark and activeStakeMark for next, poolStakeSet and activeStakeSet for current, poolStakeGo and activeStakeGo for prev.
Example usage with the stake-snapshot approach for next epoch:
Run this command 1.5 days (36 hours) before the next epoch begins.
1
/usr/local/bin/cncli sync --host 127.0.0.1 --port 6000 --no-service
2
โ€‹
3
MYPOOLID=$(cat $NODE_HOME/stakepoolid.txt)
4
echo "LeaderLog - POOLID $MYPOOLID"
5
โ€‹
6
SNAPSHOT=$(/usr/local/bin/cardano-cli query stake-snapshot --stake-pool-id $MYPOOLID --mainnet)
7
POOL_STAKE=$(echo "$SNAPSHOT" | grep -oP '(?<= "poolStakeMark": )\d+(?=,?)')
8
ACTIVE_STAKE=$(echo "$SNAPSHOT" | grep -oP '(?<= "activeStakeMark": )\d+(?=,?)')
9
MYPOOL=`/usr/local/bin/cncli leaderlog --pool-id $MYPOOLID --pool-vrf-skey ${NODE_HOME}/vrf.skey --byron-genesis ${NODE_HOME}/mainnet-byron-genesis.json --shelley-genesis ${NODE_HOME}/mainnet-shelley-genesis.json --pool-stake $POOL_STAKE --active-stake $ACTIVE_STAKE --ledger-set next`
10
echo $MYPOOL | jq .
11
โ€‹
12
EPOCH=`echo $MYPOOL | jq .epoch`
13
echo "\`Epoch $EPOCH\` ๐Ÿง™๐Ÿ”ฎ:"
14
โ€‹
15
SLOTS=`echo $MYPOOL | jq .epochSlots`
16
IDEAL=`echo $MYPOOL | jq .epochSlotsIdeal`
17
PERFORMANCE=`echo $MYPOOL | jq .maxPerformance`
18
โ€‹
19
echo "\`MYPOOL - $SLOTS \`๐ŸŽฐ\`, $PERFORMANCE% \`๐Ÿ€max, \`$IDEAL\` ๐Ÿงฑideal"
Copied!
Example usage with the stake-snapshot approach for current epoch:
1
/usr/local/bin/cncli sync --host 127.0.0.1 --port 6000 --no-service
2
โ€‹
3
MYPOOLID=$(cat $NODE_HOME/stakepoolid.txt)
4
echo "LeaderLog - POOLID $MYPOOLID"
5
โ€‹
6
SNAPSHOT=$(/usr/local/bin/cardano-cli query stake-snapshot --stake-pool-id $MYPOOLID --mainnet)
7
POOL_STAKE=$(echo "$SNAPSHOT" | grep -oP '(?<= "poolStakeSet": )\d+(?=,?)')
8
ACTIVE_STAKE=$(echo "$SNAPSHOT" | grep -oP '(?<= "activeStakeSet": )\d+(?=,?)')
9
MYPOOL=`/usr/local/bin/cncli leaderlog --pool-id $MYPOOLID --pool-vrf-skey ${NODE_HOME}/vrf.skey --byron-genesis ${NODE_HOME}/mainnet-byron-genesis.json --shelley-genesis ${NODE_HOME}/mainnet-shelley-genesis.json --pool-stake $POOL_STAKE --active-stake $ACTIVE_STAKE --ledger-set current`
10
echo $MYPOOL | jq .
11
โ€‹
12
EPOCH=`echo $MYPOOL | jq .epoch`
13
echo "\`Epoch $EPOCH\` ๐Ÿง™๐Ÿ”ฎ:"
14
โ€‹
15
SLOTS=`echo $MYPOOL | jq .epochSlots`
16
IDEAL=`echo $MYPOOL | jq .epochSlotsIdeal`
17
PERFORMANCE=`echo $MYPOOL | jq .maxPerformance`
18
โ€‹
19
echo "\`MYPOOL - $SLOTS \`๐ŸŽฐ\`, $PERFORMANCE% \`๐Ÿ€max, \`$IDEAL\` ๐Ÿงฑideal"
Copied!
Example usage with the stake-snapshot approach for previous epoch:
1
/usr/local/bin/cncli sync --host 127.0.0.1 --port 6000 --no-service
2
โ€‹
3
MYPOOLID=$(cat $NODE_HOME/stakepoolid.txt)
4
echo "LeaderLog - POOLID $MYPOOLID"
5
โ€‹
6
SNAPSHOT=$(/usr/local/bin/cardano-cli query stake-snapshot --stake-pool-id $MYPOOLID --mainnet)
7
POOL_STAKE=$(echo "$SNAPSHOT" | grep -oP '(?<= "poolStakeGo": )\d+(?=,?)')
8
ACTIVE_STAKE=$(echo "$SNAPSHOT" | grep -oP '(?<= "activeStakeGo": )\d+(?=,?)')
9
MYPOOL=`/usr/local/bin/cncli leaderlog --pool-id $MYPOOLID --pool-vrf-skey ${NODE_HOME}/vrf.skey --byron-genesis ${NODE_HOME}/mainnet-byron-genesis.json --shelley-genesis ${NODE_HOME}/mainnet-shelley-genesis.json --pool-stake $POOL_STAKE --active-stake $ACTIVE_STAKE --ledger-set prev`
10
echo $MYPOOL | jq .
11
โ€‹
12
EPOCH=`echo $MYPOOL | jq .epoch`
13
echo "\`Epoch $EPOCH\` ๐Ÿง™๐Ÿ”ฎ:"
14
โ€‹
15
SLOTS=`echo $MYPOOL | jq .epochSlots`
16
IDEAL=`echo $MYPOOL | jq .epochSlotsIdeal`
17
PERFORMANCE=`echo $MYPOOL | jq .maxPerformance`
18
โ€‹
19
echo "\`MYPOOL - $SLOTS \`๐ŸŽฐ\`, $PERFORMANCE% \`๐Ÿ€max, \`$IDEAL\` ๐Ÿงฑideal"
Copied!
Integrating with PoolTool
โ€‹PoolTool provides example scripts to submit the following data for your stake pool:
  • Current block height
  • The number of slots in which your stake pool is currently elected to mint blocks
The following figure shows the green badge that PoolTool displays next to your stake pool when your node is fully synchronized with the blockchain (image credit to QCPOL):
Your pool's tip on pooltool.io
You can also use Andrew Westberg's CNCLI utilities to send the block height and slot count to PoolTool.
โ€‹Guild Operators maintain the cncli.sh companion script to help stake pool operators use Andrew Westberg's CNCLI utilities.
To send data to PoolTool using CNCLI utilities without using the cncli.sh script, create a configuration file containing your PoolTool API key and stake pool details.
For details on requesting an API key from PoolTool, see the topic Obtaining a PoolTool API Key.
To create a configuration file, update values in the following example with your pool information. To follow the example, save the configuration file at $NODE_HOME/scripts/pooltool.json
1
cat > ${NODE_HOME}/scripts/pooltool.json << EOF
2
{
3
"api_key": "<UPDATE WITH YOUR API KEY FROM POOLTOOL PROFILE PAGE>",
4
"pools": [
5
{
6
"name": "<UPDATE TO MY POOL TICKER>",
7
"pool_id": "$(cat ${NODE_HOME}/stakepoolid.txt)",
8
"host" : "127.0.0.1",
9
"port": 6000
10
}
11
]
12
}
13
EOF
Copied!
Creating systemd Services
CNCLI sync and sendtip can be easily enabled as systemd services. When enabled as systemd services:
  • sync will continuously keep the cncli.db database synchronized.
  • sendtip will continuously send your stake pool tip to PoolTool.
To set up systemd:
  • Create the following and move to/etc/systemd/system/cncli-sync.service
1
cat > ${NODE_HOME}/cncli-sync.service << EOF
2
[Unit]
3
Description=CNCLI Sync
4
After=multi-user.target
5
โ€‹
6
[Service]
7
User=$USER
8
Type=simple
9
Restart=always
10
RestartSec=5
11
LimitNOFILE=131072
12
ExecStart=/usr/local/bin/cncli sync --host 127.0.0.1 --port 6000 --db ${NODE_HOME}/scripts/cncli.db
13
KillSignal=SIGINT
14
SuccessExitStatus=143
15
StandardOutput=syslog
16
StandardError=syslog
17
SyslogIdentifier=cncli-sync
18
โ€‹
19
[Install]
20
WantedBy=multi-user.target
21
EOF
Copied!
1
sudo mv ${NODE_HOME}/cncli-sync.service /etc/systemd/system/cncli-sync.service
Copied!
  • Create the following and move to /etc/systemd/system/cncli-sendtip.service
1
cat > ${NODE_HOME}/cncli-sendtip.service << EOF
2
[Unit]
3
Description=CNCLI Sendtip
4
After=multi-user.target
5
โ€‹
6
[Service]
7
User=$USER
8
Type=simple
9
Restart=always
10
RestartSec=5
11
LimitNOFILE=131072
12
ExecStart=/usr/local/bin/cncli sendtip --cardano-node /usr/local/bin/cardano-node --config ${NODE_HOME}/scripts/pooltool.json
13
KillSignal=SIGINT
14
SuccessExitStatus=143
15
StandardOutput=syslog
16
StandardError=syslog
17
SyslogIdentifier=cncli-sendtip
18
โ€‹
19
[Install]
20
WantedBy=multi-user.target
21
EOF
Copied!
1
sudo mv ${NODE_HOME}/cncli-sendtip.service /etc/systemd/system/cncli-sendtip.service
Copied!
  • To enable and run the above services, run:
1
sudo systemctl daemon-reload
Copied!
1
sudo systemctl start cncli-sync.service
Copied!
1
sudo systemctl start cncli-sendtip.service
Copied!
โ€‹
๐Ÿ› 
Upgrading CNCLI
1
RELEASETAG=$(curl -s https://api.github.com/repos/AndrewWestberg/cncli/releases/latest | jq -r .tag_name)
2
VERSION=$(echo ${RELEASETAG} | cut -c 2-)
3
echo "Installing release ${RELEASETAG}"
4
curl -sLJ https://github.com/AndrewWestberg/cncli/releases/download/${RELEASETAG}/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -o /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
Copied!
1
sudo tar xzvf /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin/
Copied!
Confirming CNCLI Upgrades
1
cncli -V
Copied!
It should return the updated version number.
Credits for inventing this process goes to the hard work by Andrew Westberg @amw7 (developer of JorManager and operator of BCSH family of stake pools).
Check if you have python installed.
1
python3 --version
Copied!
Otherwise, install python3.
1
sudo apt-get update
2
sudo apt-get install -y software-properties-common
3
sudo add-apt-repository ppa:deadsnakes/ppa
4
sudo apt-get update
5
sudo apt-get install -y python3.9
Copied!
Check if you have pip installed.
1
pip3 --version
Copied!
Install pip3 if needed.
1
sudo apt-get install -y python3-pip
Copied!
Install pytz which handles timezones.
1
pip3 install pytz
Copied!
Verify python and pip are setup correctly before continuing.
1
python3 --version
2
pip3 --version
Copied!
Clone the leaderLog scripts from papacarp/pooltool.io git repo.
Official documentation for this LeaderLogs tool can be read here.โ€‹
1
cd $HOME/git
2
git clone https://github.com/papacarp/pooltool.io
3
cd pooltool.io/leaderLogs
Copied!
Calculate your slot leader schedule for the latest current epoch.
1
python3 leaderLogs.py \
2
--pool-id $(cat ${NODE_HOME}/stakepoolid.txt) \
3
--tz America/Los_Angeles \
4
--vrf-skey ${NODE_HOME}/vrf.skey
Copied!
Set the timezone name to format the schedule's times properly. Use the --tz option. [Default: America/Los_Angeles]') Refer to the official documentation for more info.โ€‹
โ€‹
๐Ÿค–
Pro Tip: 1.5 days before the end of the current epoch, you can find the next epoch's schedule.
โ€‹
๐Ÿค–
Pro Tip #2: Add the flag --epoch <INTEGER #> to find a specific epoch's slot schedule.
โ€‹
๐Ÿค–
Pro Tip #3: Ensure your slot leader scripts are up to date.
1
cd $HOME/git/pooltool.io/leaderLogs
2
git pull
Copied!
If your pool is scheduled to mint blocks, you should hopefully see output similar to this. Listed by date and time, this is your slot leader schedule or in other words, when your pool is eligible to mint a block.
1
Checking leadership log for Epoch 222 [ d Param: 0.6 ]
2
2020-10-01 00:11:10 ==> Leader for slot 121212, Cumulative epoch blocks: 1
3
2020-10-01 00:12:22 ==> Leader for slot 131313, Cumulative epoch blocks: 2
4
2020-10-01 00:19:55 ==> Leader for slot 161212, Cumulative epoch blocks: 3
Copied!
Your slot leader log should remain confidential. If you share this information publicly, an attacker could use this information to attack your stake pool.
Copy link