diff --git a/src/node_launcher.star b/src/node_launcher.star index 9314b27..8c9ebd3 100644 --- a/src/node_launcher.star +++ b/src/node_launcher.star @@ -190,6 +190,7 @@ def cp(plan, node_name, src, dest): def download_to_path_and_untar(plan, node_name, url, dest): + # Install curl plan.exec( service_name=node_name, recipe=ExecRecipe( @@ -197,19 +198,31 @@ def download_to_path_and_untar(plan, node_name, url, dest): "apt update --allow-insecure-repositories && apt-get install curl -y --allow-unauthenticated"] ) ) - plan.print("Downloading {0} to {1}".format(url, dest)) + + # Download the file + download_path = "/static_files/subnet_vm.tar.gz" + plan.print("Downloading {0} to {1}".format(url, download_path)) plan.exec( service_name=node_name, recipe=ExecRecipe( - command=["/bin/sh", "-c", "curl {0} -o {1}".format(url, dest)] + command=["/bin/sh", "-c", "mkdir -p /static_files/ && curl -L {0} -o {1}".format(url, download_path)] ) ) - plan.print("Untaring {0} to {1}".format(dest, ABS_PLUGIN_DIRPATH)) + # Untar the downloaded file + plan.print("Untaring {0}".format(download_path)) plan.exec( service_name=node_name, recipe=ExecRecipe( - # untar above downloaded file - command=["/bin/sh", "-c", "tar -zxvf {0} -C /avalanchego/build/plugins/".format(dest)] + command=["/bin/sh", "-c", "mkdir -p /avalanchego/build/plugins && tar -zxvf {0} -C /static_files/".format(download_path)] ) ) + + # Move the extracted binary to the destination + plan.print("Moving extracted binary to {0}".format(dest)) + plan.exec( + service_name=node_name, + recipe=ExecRecipe( + command=["/bin/sh", "-c", "mv /static_files/subnet-evm {0}".format(dest)] + ) + ) \ No newline at end of file