-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathheminode.sh
More file actions
executable file
·75 lines (67 loc) · 2.79 KB
/
heminode.sh
File metadata and controls
executable file
·75 lines (67 loc) · 2.79 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
# Copyright (c) 2024-2025 Hemi Labs, Inc.
# Use of this source code is governed by the MIT License,
# which can be found in the LICENSE file.
# tmux windows to monitor a Hemi stack running with the provided compose
NAME=hemi
source ./.env
NETWORK="hemi"
if [ "$NET" == "testnet" ]; then
NETWORK="hemi-testnet"
fi
tmux start-server
tmux has-session -t $NAME 2>/dev/null
if [ "$?" -eq 1 ] ; then
tmux new-session -d -s $NAME -n compose
i=0
tmux new-window -t $NAME -n stats
i=$((i+1))
tmux split-window -v -t $NAME:$i
if [ "$PROFILE" == "L1" ] || [ "$PROFILE" == "full" ]; then
tmux new-window -t $NAME -n bitcoin
i=$((i+1))
tmux new-window -t $NAME -n eth
i=$((i+1))
tmux split-window -v -t $NAME:$i
fi
if [ "$PROFILE" == "hemi" ] || [ "$PROFILE" == "full" ]; then
tmux new-window -t $NAME -n L2
i=$((i+1))
tmux split-window -v -t $NAME:$i
tmux split-window -h -t $NAME:$i.0
fi
if [ "$PROFILE" == "hemi" ] || [ "$PROFILE" == "hemi-min" ] || [ "$PROFILE" == "full" ]; then
tmux new-window -t $NAME -n l2-nodes
i=$((i+1))
tmux split-window -v -t $NAME:$i
tmux split-window -h -t $NAME:$i.0
fi
i=0
i=$((i+1))
tmux send-keys -t $NAME:$i.0 "docker stats" C-m
tmux send-keys -t $NAME:$i.1 "while true; do df -h; sleep 30; done" C-m
i=$((i+1))
if [ "$PROFILE" == "L1" ] || [ "$PROFILE" == "full" ]; then
tmux send-keys -t $NAME:$i "while true; do docker logs -f $NETWORK-stack-bitcoind-1; echo 'NOT UP!!'; sleep 30; done" C-m
i=$((i+1))
tmux send-keys -t $NAME:$i.0 "while true; do docker logs -f $NETWORK-stack-prysm-1; echo 'NOT UP!!'; sleep 30; done" C-m
tmux send-keys -t $NAME:$i.1 "while true; do docker logs -f $NETWORK-stack-geth-l1-1; echo 'NOT UP!!'; sleep 30; done" C-m
i=$((i+1))
fi
if [ "$PROFILE" == "hemi" ] || [ "$PROFILE" == "full" ]; then
tmux send-keys -t $NAME:$i.0 "while true; do docker logs -f $NETWORK-stack-bfgd-1; echo 'NOT UP!!'; sleep 30; done" C-m
tmux send-keys -t $NAME:$i.1 "while true; do docker logs -f $NETWORK-stack-bfgd-postgres-1; echo 'NOT UP!!'; sleep 30; done" C-m
tmux send-keys -t $NAME:$i.2 "while true; do docker logs -f $NETWORK-stack-electrs-1; echo 'NOT UP!!'; sleep 30; done" C-m
i=$((i+1))
fi
if [ "$PROFILE" == "hemi" ] || [ "$PROFILE" == "hemi-min" ] || [ "$PROFILE" == "full" ]; then
tmux send-keys -t $NAME:$i.0 "while true; do docker logs -f $NETWORK-stack-bssd-1; echo 'NOT UP!!'; sleep 30; done" C-m
tmux send-keys -t $NAME:$i.1 "while true; do docker logs -f $NETWORK-stack-op-node-1; echo 'NOT UP!!'; sleep 30; done" C-m
tmux send-keys -t $NAME:$i.2 "while true; do docker logs -f $NETWORK-stack-op-geth-l2-1; echo 'NOT UP!!'; sleep 30; done" C-m
i=$((i+1))
fi
tmux select-window -t $NAME:0
fi
tmux set-option -t $NAME set-titles on
tmux set-option -t $NAME set-titles-string "#S"
tmux attach-session -d -t $NAME