Skip to content

Commit

Permalink
Merge pull request #111 from HorizenLabs/gp/entrypoint_fix
Browse files Browse the repository at this point in the history
Moved the data directory renaming before keys handling
  • Loading branch information
JackPiri committed Aug 6, 2024
2 parents 4c602d1 + ca8b412 commit d7a685f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions docker/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ while IFS='=' read -r -d '' var_name var_value; do
fi
done < <(env -0)

if [ -n "${ZKV_CONF_BASE_PATH}" ]; then
BASE_CHAINS="${ZKV_CONF_BASE_PATH}/chains"

for chain in local testnet ; do
source_chain_dir="${BASE_CHAINS}/nh_${chain}";
dest_chain_dir="${BASE_CHAINS}/zkv_${chain}";
[ -d "$source_chain_dir" ] && [ ! -e "$dest_chain_dir" ] && \
echo "Move ${source_chain_dir} to ${dest_chain_dir}" && \
mv "${source_chain_dir}" "${dest_chain_dir}"
done
fi

# Keys handling
if [ -f "${ZKV_SECRET_PHRASE_PATH}" ]; then
injection_args=()
Expand Down Expand Up @@ -124,16 +136,5 @@ if [[ (-n "${ZKV_CONF_BASE_PATH:-}") && (-n "${ZKV_CONF_CHAIN:-}") && (-f "${ZKV
cp "${ZKV_NODE_KEY_FILE}" "${destination}/secret_ed25519"
fi

BASE_CHAINS="/data/node/chains"

for chain in local testnet ; do
source_chain_dir="${BASE_CHAINS}/nh_${chain}";
dest_chain_dir="${BASE_CHAINS}/zkv_${chain}";

[ -d "$source_chain_dir" ] && [ ! -e "$dest_chain_dir" ] && \
echo "Move ${source_chain_dir} to ${dest_chain_dir}" && \
mv "${source_chain_dir}" "${dest_chain_dir}"
done

echo "Launching ${ZKV_NODE} with args ${conf_args[*]}"
exec "${ZKV_NODE}" "${conf_args[@]}"
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mainchain"
version = "0.5.0"
version = "0.5.1"
description = "zkVerify Mainchain."
authors.workspace = true
homepage = "https://github.com/HorizenLabs/zkVerify"
Expand Down

0 comments on commit d7a685f

Please sign in to comment.