#!/bin/bash

current_directory="$(dirname "$(readlink -f "$0")")"
IFS="/" read -ra dir_array <<< "${current_directory#/}"  # Remove leading slash
if [ ${#dir_array[@]} -eq 3 ] && [ "${dir_array[2]}" != "scripts" ]; then
    parsed_dir="/${dir_array[0]}/${dir_array[1]}/${dir_array[2]}"
else
    parsed_dir="/${dir_array[0]}/${dir_array[1]}"
fi
source "${parsed_dir}/scripts/load_variables.sh"
source "${parsed_dir}/scripts/get_os_arch.sh"

sudo /$BASE_DIR/lighthouse/lighthouse beacon_node --datadir /$BASE_DIR/lighthouse/data --network mainnet --http --execution-endpoint http://localhost:8551 --execution-jwt /$BASE_DIR/$NODE_CLIENT/data/jwt.hex --checkpoint-sync-url https://mainnet-checkpoint-sync.stakely.io --disable-backfill-rate-limiting --genesis-backfill --disable-deposit-contract-sync --execution-timeout-multiplier 10 --historic-state-cache-size 4 --disable-lock-timeouts --listen-address :: --listen-address 0.0.0.0 --port 9909 --port6 9911 --discovery-port6 9999 --target-peers 200 --validator-monitor-auto --metrics
