testnet-laconicd-stack/ops/stage2/upgrade-node-to-stage2.sh

26 lines
551 B
Bash
Raw Normal View History

#!/bin/bash
# Exit on error
set -e
set -u
NODE_HOME="$HOME/.laconicd"
stage2_genesis="$NODE_HOME/tmp-stage2/genesis.json"
if [ ! -f ${stage2_genesis} ]; then
echo "stage2 genesis file not found, exiting..."
exit 1
fi
# Remove data but keep keys
laconicd cometbft unsafe-reset-all
# Use provided genesis config
cp $stage2_genesis $NODE_HOME/config/genesis.json
# Set chain id in config
chain_id=$(jq -r '.chain_id' $stage2_genesis)
laconicd config set client chain-id $chain_id --home $NODE_HOME
echo "Node data reset and ready for stage2!"