Use temporary venv to use bech32 in python script

This commit is contained in:
Shreerang Kale 2025-05-15 18:32:54 +05:30
parent 6a662820b5
commit 7caeca926f
2 changed files with 11 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
*-deployment
*-spec.yml
mainnet-genesis
output
# Playbook vars
*-vars.yml

View File

@ -37,12 +37,18 @@ docker run \
# --------
# Install required bech32 dependency
# TODO: Avoid installing bech32 system-wide
python3 -m pip install bech32 --break-system-packages
# Define and create venv if not exists
venv_dir="$PWD/venv"
if [ ! -d "$venv_dir" ]; then
python3 -m venv "$venv_dir"
"$venv_dir/bin/pip" install bech32
fi
# Carry over state from testnet to mainnet
echo "Carrying over state from testnet state to mainnet genesis..."
python3 $script_dir/transfer-state.py
"$venv_dir/bin/python" "$script_dir/transfer-state.py"
# Clean up venv
rm -rf "$venv_dir"
# --------