Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pruning backup and restore in upgrade.sh script #20

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions setup/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,27 @@ cd $REPO_ROOT
# System update and installation of dependencies
sh ./setup/dependencies.sh

# Create a backup of old config files and moniker
# Create a backup of old config files
cp $CONFIG_DIR/app.toml $CONFIG_DIR/app.toml.bak
cp $CONFIG_DIR/config.toml $CONFIG_DIR/config.toml.bak
MONIKER=$(grep "moniker" $CONFIG_DIR/config.toml | cut -d'=' -f2 | tr -d '[:space:]"')

# Backup moniker and pruning settings
MONIKER=$(grep "^moniker =" "$CONFIG_DIR/config.toml")
PRUNING=$(grep "^pruning =" "$CONFIG_DIR/app.toml")
PRUNING_KEEP_RECENT=$(grep "^pruning-keep-recent =" "$CONFIG_DIR/app.toml")
#pruning-keep-every got deprecated
PRUNING_INTERVAL=$(grep "^pruning-interval =" "$CONFIG_DIR/app.toml")

# Introduce new config files
cp ./configs/default_app.toml $CONFIG_DIR/app.toml
cp ./configs/default_config.toml $CONFIG_DIR/config.toml

# Restore moniker
sed -i "s/moniker = .*/moniker = \"$MONIKER\"/" $CONFIG_DIR/config.toml
# Restore moniker and pruning settings
sed -i "s|^.*moniker =.*$|$MONIKER|" $CONFIG_DIR/config.toml
sed -i "s|^.*pruning =.*$|$PRUNING|" $CONFIG_DIR/app.toml
sed -i "s|^.*pruning-keep-recent =.*$|$PRUNING_KEEP_RECENT|" $CONFIG_DIR/app.toml
#pruning-keep-every got deprecated
sed -i "s|^.*pruning-interval =.*$|$PRUNING_INTERVAL|" $CONFIG_DIR/app.toml

# Fetch latest seeds and peers list from genesis-parameters repo
sh ./utils/fetch/peers.sh
Expand Down
Loading