Update
Version Release v0.15.0 Latest
Update BInary
cd $HOME
rm -fr erbie
git clone https://github.com/erbieio/erbie
cd erbie
git checkout v0.15.0
go build -o erbie cmd/erbie/main.go
sudo systemctl stop erbied.service
sudo rm /usr/local/bin/erbie
sudo mv erbie /usr/local/bin
sudo systemctl start erbied.service && sudo journalctl -fu erbied -o cat
monitor.sh (using port 8545)
#!/bin/bash
function info(){
cn=0
while true
do
echo "$cn second."
echo "node $1"
rs=`curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","id":64}' https://api.erbietest.com 2>/dev/null`
blockNumbers=$(parse_json $rs "result")
echo "Block height of the whole network: $((16#${blockNumbers:2}))"
rs1=`curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_peerCount","id":64}' 127.0.0.1:$1 2>/dev/null`
count=$(parse_json $rs1 "result")
echo "Number of node connections: $((16#${count:2}))"
rs2=`curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","id":64}' 127.0.0.1:$1 2>/dev/null`
blckNumber=$(parse_json $rs2 "result")
echo "Block height of the current peer: $((16#${blckNumber:2}))"
sleep 5
clear
let cn+=5
done
}
function parse_json(){
if [[ $# -gt 1 ]] && [[ $1 =~ $2 ]];then
echo "${1//\"/}"|sed "s/.*$2:\([^,}]*\).*/\1/"
else
echo "0x0"
fi
}
function main(){
if [[ $# -eq 0 ]];then
info 8545
else
info $1
fi
}
main "$@"