A method of how to check if your phala miner is working properly

A good miner must have good controls.

Using the subscan API we can get some information on the status of our miners.

If you do not want to have doubts that your miner is working correctly you can use a sh script like this to check, with a preset interval, that the balance of your account does not go below the required minimum (avoiding the failure of the transaction due to lack of useful tpha upon completion of the transaction) and verify that the balance decrements correctly (this means that the block processing tx is performed by the miner)

#! / bin / sh
ADDRESS1 = “44FGHFosKj3iYbguonxQurU6iPV123123123123123123123123123”
echo $ ADDRESS1
while:
do
BALANCE1 = curl -s’ https://phala.subscan.io/api/open/account ‘–header’ Content-Type: application / json ‘–data-raw’ {“address”: "’$ ADDRESS1’ "} '| jq ‘.data.balance’ -r
curl -s -X POST https://api.telegram.org/bot4123123123:AAFs12312312312312312312BS6vV0/sendMessage -d text = “balctrl_1 = $ BALANCE1” -d chat_id = 412312312313
#sleep defines how often to check. 600 is equivalent to every hour
sleep 600
done

The script can be enhanced with for loops for those with multiple miners. Change the various parameters for telegram notification. Curl will send a notification like this on your chat telegram.

balctrl_1 = 7.3189

If in doubt, tag me on the telegram channel reserved for Phala Miners. @zaketac

1 Like