Check with one command if your Raspberry Pi Node is synced with the Harmony One Blockchain
Please refer to docs from Harmony One: https://docs.harmony.one/home/network/validators/node-setup/installing-updating/installing-node/using-binary
- Open Port as set up inside Harmony.conf
- Changed IP to 0.0.0.0 inside Harmony.conf
[HTTP]
Enabled = true
IP = "0.0.0.0"
Port = 9500
RosettaEnabled = false
RosettaPort = 9700
Build your own Version with the following set of commands:
- Create the Shell Script:
What's needed to change is the IP (IPv4 address of your Node) and the Port. In here we have an example for 4 Rasperry Pi each on another Shard, you can remove or adjust as required.
cat<<-EOF > ~/RPIstatus.sh
#! /bin/bash
date +%c
echo -e "\n RPI Node on Shard 0 Status:\n" && ./hmy blockchain latest-headers -n http://172.217.0.0:9500 | grep epoch && ./hmy blockchain latest-headers -n http://172.217.0.0:9500 | grep viewID && ./hmy blockchain latest-headers -n http://172.217.0.0:9500 | grep shardID
echo -e "\n Harmony Network Shard 0 Status:\n" && ./hmy --node="https://api.s0.t.hmny.io" blockchain latest-headers | grep epoch && ./hmy --node="https://api.s0.t.hmny.io" blockchain latest-headers | grep viewID && ./hmy --node="https://api.s0.t.hmny.io" blockchain latest-headers | grep shardID
echo -e "\n RPI Node on Shard 1 Status:\n" && ./hmy blockchain latest-headers -n http://172.217.0.0:9501 | grep epoch && ./hmy blockchain latest-headers -n http://172.217.0.0:9501 | grep viewID && ./hmy blockchain latest-headers -n http://172.217.0.0:9501 | grep shardID
echo -e "\n Harmony Network Shard 1 Status:\n" && ./hmy --node="https://api.s1.t.hmny.io" blockchain latest-headers | grep epoch && ./hmy --node="https://api.s1.t.hmny.io" blockchain latest-headers | grep viewID && ./hmy --node="https://api.s1.t.hmny.io" blockchain latest-headers | grep shardID
echo -e "\n RPI Node on Shard 2 Status:\n" && ./hmy blockchain latest-headers -n http://172.217.0.0:9502 | grep epoch && ./hmy blockchain latest-headers -n http://172.217.0.0:9502 | grep viewID && ./hmy blockchain latest-headers -n http://172.217.0.0:9502 | grep shardID
echo -e "\n Harmony Network Shard 2 Status:\n" && ./hmy --node="https://api.s2.t.hmny.io" blockchain latest-headers | grep epoch && ./hmy --node="https://api.s2.t.hmny.io" blockchain latest-headers | grep viewID && ./hmy --node="https://api.s2.t.hmny.io" blockchain latest-headers | grep shardID
echo -e "\n RPI Node on Shard 3 Status:\n" && ./hmy blockchain latest-headers -n http://172.217.0.0:9503 | grep epoch && ./hmy blockchain latest-headers -n http://172.217.0.0:9503 | grep viewID && ./hmy blockchain latest-headers -n http://172.217.0.0:9503 | grep shardID
echo -e "\n Harmony Network Shard 3 Status:\n" && ./hmy --node="https://api.s3.t.hmny.io" blockchain latest-headers | grep epoch && ./hmy --node="https://api.s3.t.hmny.io" blockchain latest-headers | grep viewID && ./hmy --node="https://api.s3.t.hmny.io" blockchain latest-headers | grep shardID
echo -e "\n Epoch signing rate:\n" && ./hmy blockchain validator information oneaddress --node="https://api.s0.t.hmny.io" | grep current-epoch-signing-percentage
EOF
- Change permission:
chmod +x ~/RPIstatus.sh
- Run the Shell Script:
./RPIstatus.sh
- Give out:
In our example we have a Node on Shard 1 and on Shard 2, so we removed Shard 0 and Shard 3 commands.