As per the new version of validators, the node is exiting every time it starts and finishes validating. To address this issue, I have created a small bash script that can help fix the problem.
Navigate to the Shardeum directory and access docker instance using the following command:
cd .shardeum/
./shell.sh
Install nano and create a new file “status_check.sh”:
apt install nano
nano status_check.sh
Paste the following code :
#!/bin/bash
# Function to check the status
check_status() {
# Fetch the status using the operator-cli command or any appropriate method
status=$(operator-cli status | grep "state:" | awk '{print $2}')
# Compare the status to "active"
if [[ "$status" == "standby" || "$status" == "active" ]]; then
echo "Status is standby or active."
else
echo "Status is neither standby nor active. Running the command..."
# Run the command you want to execute when the status is not active
# Replace the following line with your desired command
operator-cli start
fi
}
# Loop to check the status every 5 minutes
while true; do
check_status
sleep 300 # Sleep for 5 minutes (300 seconds)
done
Save and exit
Run the following command to text than exit
chmod +x status_checker.sh
Make the script run indefinitely :
Install tmux
apt-get install tmux
Run the script:
./status_checker.sh
Detach from the tmux
session: Press Ctrl + B
, then release the keys and press D
.
Finally, this script runs every 5 minutes to check if the node is stopped and reactivates it. Additionally, please note that Shardeum will be airdropping soon, as mentioned in this tweet: link to the tweet.