From 18ee0c02e96775f915bda12c9f68a5523b52e923 Mon Sep 17 00:00:00 2001 From: sudo-shashank Date: Thu, 6 Jun 2024 10:38:16 +0530 Subject: [PATCH] remove set_env sh --- ansible/archival-snapshots/resources/main.sh | 6 ++++-- ansible/archival-snapshots/resources/set_env.sh | 11 ----------- 2 files changed, 4 insertions(+), 13 deletions(-) delete mode 100755 ansible/archival-snapshots/resources/set_env.sh diff --git a/ansible/archival-snapshots/resources/main.sh b/ansible/archival-snapshots/resources/main.sh index 565b6ae78..4e82d0532 100755 --- a/ansible/archival-snapshots/resources/main.sh +++ b/ansible/archival-snapshots/resources/main.sh @@ -37,7 +37,9 @@ sleep 30 echo "Forest process started with PID: $FOREST_NODE_PID" # Set required env variables -sh set_env.sh +ADMIN_TOKEN=$(cat admin_token) +export FULLNODE_API_INFO="$ADMIN_TOKEN:/ip4/127.0.0.1/tcp/3456/http" +echo "USING TOKEN: $FULLNODE_API_INFO" echo "Waiting for forest to sync to latest network head" $FOREST_CLI sync wait @@ -48,7 +50,7 @@ LATEST_EPOCH=$($FOREST_CLI sync status | grep "Height:" | awk '{print $2}') echo "Latest Height: $LATEST_EPOCH" while ((LATEST_EPOCH - CURRENT_EPOCH > 30000)); do - echo "USING TOKEN: $FULLNODE_API_INFO" + export FULLNODE_API_INFO="$ADMIN_TOKEN:/ip4/127.0.0.1/tcp/3456/http" NEW_EPOCH=$((CURRENT_EPOCH + 30000)) echo "Next Height: $NEW_EPOCH" diff --git a/ansible/archival-snapshots/resources/set_env.sh b/ansible/archival-snapshots/resources/set_env.sh deleted file mode 100755 index b2fb245f3..000000000 --- a/ansible/archival-snapshots/resources/set_env.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Read the ADMIN_TOKEN from the file -ADMIN_TOKEN=$(cat admin_token) - -# Set FULLNODE_API_INFO -echo 'export FULLNODE_API_INFO="$ADMIN_TOKEN:/ip4/127.0.0.1/tcp/3456/http"' >> ~/.bashrc -source ~/.bashrc - -# Use the environment variable -echo "Using FULLNODE_API_INFO: $FULLNODE_API_INFO"