diff --git a/install.sh b/install.sh index d362abc..dfd5971 100755 --- a/install.sh +++ b/install.sh @@ -15,6 +15,7 @@ network_identifier="" staking_url="" container_id="" latest_key_end_block="" +previous_network_addresses="" voi_logo="MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM @@ -564,6 +565,7 @@ ensure_accounts_are_offline() { local local_network_identifier local_network_identifier=$(get_network_identifier "$1") account_addresses=$(get_account_addresses "${local_network_identifier}") + previous_network_addresses="${account_addresses}" if [[ -z ${account_addresses} ]]; then return @@ -1493,7 +1495,19 @@ if [[ -n ${VOINETWORK_IMPORT_ACCOUNT} && ${VOINETWORK_IMPORT_ACCOUNT} -eq 1 ]]; fi else - if check_if_account_exists; then + if [[ ${new_network} -eq 1 && -n ${previous_network_addresses} ]]; then + + for account in ${previous_network_addresses}; do + echo "Let's proceed to import ${account} into ${VOINETWORK_NETWORK} using your existing account mnemonic." + echo "This is a two-step process, first we will delete the account from the previous network, followed" + echo "by importing the account into the new network." + echo "" + execute_interactive_docker_command "/node/bin/goal account delete -a ${account}" + execute_interactive_docker_command "/node/bin/goal account import" + done + + get_account_address + elif check_if_account_exists; then execute_interactive_docker_command "/node/bin/goal account new" get_account_address