forked from OffchainLabs/eth-pos-devnet
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCheckAll.sh
executable file
·58 lines (55 loc) · 2.03 KB
/
CheckAll.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
source Config.sh
######## Checker Functions
function Log() {
echo
echo "--> $@"
}
function CheckGeth()
{
Log "Checking Geth $1"
test -z $my_ip && my_ip=`curl ifconfig.me 2>/dev/null` && Log "my_ip=$my_ip"
geth attach --exec "admin.nodeInfo.enode" data/execution/$1/geth.ipc | sed s/^\"// | sed s/\"$//
echo Peers: `geth attach --exec "admin.peers" data/execution/$1/geth.ipc | grep "remoteAddress" | grep -e $my_ip -e "127.0.0.1"`
echo Block Number: `geth attach --exec "eth.blockNumber" data/execution/$1/geth.ipc`
}
function CheckBeacon()
{
Log "Checking Beacon $1"
#curl http://localhost:$((5052+$1))/eth/v1/node/identity 2>/dev/null | jq
#curl http://localhost:$((5052+$1))/eth/v1/node/peers 2>/dev/null | jq
#curl http://localhost:$((5052+$1))/eth/v1/node/syncing 2>/dev/null | jq
#curl http://localhost:$((5052+$1))/eth/v1/node/health 2>/dev/null | jq
echo My ID: `curl http://localhost:$((5052 + $1))/eth/v1/node/identity 2>/dev/null | jq -r ".data.peer_id"`
echo My enr: `curl http://localhost:$((5052 + $1))/eth/v1/node/identity 2>/dev/null | jq -r ".data.enr"`
echo Peer Count: `curl http://localhost:$((5052 + $1))/eth/v1/node/peers 2>/dev/null | jq -r ".meta.count"`
curl http://localhost:$((5052 + $1))/eth/v1/node/syncing 2>/dev/null | jq
}
function CheckBeacon_Prysm()
{
Log "Checking Beacon $1"
curl localhost:$((8000 + $1))/p2p
curl http://localhost:$((8000 + $1))/healthz
curl http://localhost:$((3500 + $1))/eth/v1/node/syncing 2>/dev/null | jq
}
function CheckAll()
{
for i in $(seq 0 $(($NodesCount-1))); do
CheckGeth $i
done
for i in $(seq 0 $(($NodesCount-1))); do
CheckBeacon $i
done
}
########
echo "
clear && tail -f logs/geth_0.log -n1000
clear && tail -f logs/geth_1.log -n1000
clear && tail -f logs/beacon_0.log -n1000
clear && tail -f logs/beacon_1.log -n1000
clear && tail -f logs/validator_0.log -n1000
clear && tail -f logs/validator_1.log -n1000
curl http://localhost:9596/eth/v1/node/identity | jq
curl http://localhost:9596/eth/v1/node/peers | jq
curl http://localhost:9596/eth/v1/node/syncing | jq
"
CheckAll