forked from charx0r/POKT_DOKT
-
Notifications
You must be signed in to change notification settings - Fork 7
/
arbitrum-fullnode.prune
33 lines (23 loc) · 1.54 KB
/
arbitrum-fullnode.prune
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
#!/bin/bash
BASEPATH="$(dirname "$0")"
source $BASEPATH/.env
echo "running in $BASEPATH"
#IFS=':' read -ra parts <<< $COMPOSE_FILE
# Add the --init.prune option to the command list
sed -i '/command:/a \ \ - --init.prune=full' "$BASEPATH/arbitrum-fullnode.yml"
echo "$(cat $BASEPATH/arbitrum-fullnode.yml)"
docker compose --project-directory "$BASEPATH" up -d
while true; do
# Execute SSH command and extract the answer
answer=$($BASEPATH/sync-status.sh arbitrum-fullnode)
# Check if answer is "online"
if [ "$answer" == "online" ]; then
break # Break the loop if answer is "online"
else
blocknumber=$($BASEPATH/blocknumber.sh arbitrum-fullnode)
echo "$(date) staus is $answer and blocknumber is $blocknumber"
fi
# Wait for 5 minutes before next iteration
sleep 5m
done
git -C $BASEPATH checkout arbitrum-fullnode.yml