From 3a2ff4cad3995a92f9d2f7b80df9b0a1dc10ad94 Mon Sep 17 00:00:00 2001 From: kladko <13399135+kladkogex@users.noreply.github.com> Date: Tue, 8 Jun 2021 19:39:49 +0300 Subject: [PATCH] First release --- endpoints.py | 7 ++----- periodic_config_update.py | 6 ++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/endpoints.py b/endpoints.py index c1ab7d2..d94c7f6 100644 --- a/endpoints.py +++ b/endpoints.py @@ -17,17 +17,14 @@ exit(-5) -ABI_FILEPATH = "/etc/skale-manager-1.8.0-mainnet-abi.json" +ABI_FILEPATH = "/tmp/abi.json" if not os.path.exists(ABI_FILEPATH): print("Fatal error: could not find ABI. Exiting") exit(-6) -if not os.path.exists(ABI_FILEPATH): - print("Fatal error: could not find ABI. Exiting") - exit(-6) -RESULTS_PATH = "/tmp/mainnet.json" +RESULTS_PATH = "/tmp/chains.json" PORTS_PER_SCHAIN = 64 diff --git a/periodic_config_update.py b/periodic_config_update.py index 78a21aa..ad69450 100644 --- a/periodic_config_update.py +++ b/periodic_config_update.py @@ -12,7 +12,7 @@ TMP_CONFIG_FILE = "/tmp/tmp.config" CERT_FILE = "/data/server.crt" KEY_FILE = "/data/server.key" -RESULTS_PATH = "/tmp/mainnet.json" +RESULTS_PATH = "/tmp/chains.json" PROXY_FULL_HOST_NAME = os.environ.get("PROXY_FULL_HOST_NAME") if PROXY_FULL_HOST_NAME is None: @@ -128,9 +128,11 @@ def main(): while True: print("Updating chain info ...") subprocess.check_call(["/bin/bash", "-c", "rm -f /tmp/*"]) + subprocess.check_call(["/bin/bash", "-c", + "cp /etc/skale-manager-1.8.0-mainnet-abi.json /tmp/abi.json"]) subprocess.check_call(["python3", "/etc/endpoints.py"]) subprocess.check_call(["/bin/bash", "-c", "mkdir -p /usr/share/nginx/www"]) - subprocess.check_call(["/bin/bash", "-c", "cp -f /tmp/mainnet.json /usr/share/nginx/www"]) + subprocess.check_call(["/bin/bash", "-c", "cp -f /tmp/chains.json /usr/share/nginx/www/mainnet.json"]) if not os.path.exists(RESULTS_PATH): print("Fatal error: Chains file does not exist. Exiting ...")