From 60d3d5681ed05ef4ad2bb1a52d06c98c8d378343 Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Thu, 21 Mar 2024 08:32:36 +0100 Subject: [PATCH] initial commit --- arbitrum-fullnode.prune | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 arbitrum-fullnode.prune diff --git a/arbitrum-fullnode.prune b/arbitrum-fullnode.prune new file mode 100644 index 00000000..57941ee3 --- /dev/null +++ b/arbitrum-fullnode.prune @@ -0,0 +1,29 @@ +#!/bin/bash + +BASEPATH="$(dirname "$0")" +source $BASEPATH/.env + +#IFS=':' read -ra parts <<< $COMPOSE_FILE + +# Add the --init.prune option to the command list +sed -i '/command:/a \ \ - --init.prune' "$BASEPATH/arbitrum-fullnode.yml" + +docker-compose up -d -f $BASEPATH/docker-compose.yml + +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 $BASTEPATH checkout arbitrum-fullnode.yml