From aec8bea7e7d480f592a40368ff94d7315060eb05 Mon Sep 17 00:00:00 2001 From: Evan-Kim2028 Date: Fri, 27 Dec 2024 16:02:01 -0500 Subject: [PATCH] chore: remove old file --- entrypoint_old_logging.sh | 87 --------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 entrypoint_old_logging.sh diff --git a/entrypoint_old_logging.sh b/entrypoint_old_logging.sh deleted file mode 100644 index fb6ec93..0000000 --- a/entrypoint_old_logging.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Load the mev-commit version from environment -source /etc/environment - -# Print the mev-commit version -echo "Running mev-commit version: ${MEV_COMMIT_VERSION}" - -# Set variables based on DOMAIN -RPC_URL="wss://chainrpc-wss.${DOMAIN}" -BOOTNODE="/dnsaddr/bootnode.${DOMAIN}" -CONTRACTS_URL="https://contracts.${DOMAIN}" - -# Fetch contracts.json and export necessary environment variables -contracts_json=$(curl -sL ${CONTRACTS_URL}) -if ! echo "${contracts_json}" | jq . > /dev/null 2>&1; then - echo "Failed to fetch contracts from ${CONTRACTS_URL}" - exit 1 -fi - -export MEV_COMMIT_BLOCK_TRACKER_ADDR=$(echo "${contracts_json}" | jq -r '.BlockTracker') -export MEV_COMMIT_BIDDER_REGISTRY_ADDR=$(echo "${contracts_json}" | jq -r '.BidderRegistry') -export MEV_COMMIT_PRECONF_ADDR=$(echo "${contracts_json}" | jq -r '.PreconfManager') -export MEV_COMMIT_LOG_FMT="${MEV_COMMIT_LOG_FMT:-json}" - -# Check if PRIVATE_KEY_BIDDER is set -if [ -z "${PRIVATE_KEY_BIDDER}" ]; then - echo "PRIVATE_KEY_BIDDER environment variable is not set" - exit 1 -else - echo "PRIVATE_KEY_BIDDER is set." - # Write the private key to key - echo "${PRIVATE_KEY_BIDDER}" > "${ROOT_PATH}/key" - # Secure the key file by restricting permissions - chmod 600 "${ROOT_PATH}/key" - # Export MEV_COMMIT_PRIVKEY_FILE to point to the key file - export MEV_COMMIT_PRIVKEY_FILE="${ROOT_PATH}/key" -fi - -# Define flags for mev-commit -FLAGS=( - --settlement-ws-rpc-endpoint "${RPC_URL}" - --peer-type "bidder" - --bootnodes "${BOOTNODE}" - --log-tags "service:docker-mev-commit-bidder" - --bidder-bid-timeout "15s" # Override timeout here - -) - -# Start mev-commit in the background -${BINARY_PATH} "${FLAGS[@]}" & - -PID=$! - -# Function to wait for mev-commit to be ready -wait_for_health() { - echo "Waiting for mev-commit to be ready..." - until curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:13523/health | grep -q 200; do - sleep 1 - done - echo "mev-commit is ready." -} - -# Function to send auto deposit request -send_auto_deposit() { - echo "Sending auto deposit request..." - response=$(curl --silent --show-error --output /dev/null --write-out "%{http_code}" --request POST "http://127.0.0.1:13523/v1/bidder/auto_deposit/${AUTO_DEPOSIT_VALUE}") - if [ "${response}" -ne 200 ]; then - echo "Failed to send auto deposit request, status code: ${response}" - else - echo "Auto deposit request sent successfully" - fi -} - -# Wait for mev-commit to be ready -wait_for_health - -# Send auto deposit request once -send_auto_deposit - -# Trap to handle script termination and clean up background jobs -trap "echo 'Received termination signal. Exiting...'; kill ${PID}; kill 0; exit 0" SIGINT SIGTERM - -# Wait for mev-commit process to exit -wait ${PID}