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

Fixed reinstall.sh syntax error at EOF, added swap cleanup and resetting of config files #11

Merged
merged 6 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions reinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ genesisd tendermint unsafe-reset-all
cd
cd .genesisd/config
sed -i 's/seeds = ""/seeds = ""/' config.toml
sed -i 's/^timeout_commit = .*/timeout_commit = "10s"/' config.toml
sed -i 's/persistent_peers = ""/persistent_peers = "[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:56656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26651,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:21496,[email protected]:26656,[email protected]:26651,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26651,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:26632,[email protected]:60856,[email protected]:26656,[email protected]:20106,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26641,[email protected]:26671"/' config.toml
sed -i 's/minimum-gas-prices = "0aphoton"/minimum-gas-prices = "0el1"/g' app.toml
sed -i 's/minimum-gas-prices = "0aphoton"/minimum-gas-prices = "50000000000el1"/g' app.toml
sed -i 's/halt-height = 0/halt-height = 6751390/g' app.toml
sed -i '212s/.*/enable = false/' app.toml
# STARTING genesisd AS A SERVICE
Expand All @@ -141,4 +142,4 @@ sed -i '212s/.*/enable = false/' app.toml

# service genesisd start
# genesisd start
ponysay "start genesisd daemon, set stop height before it`"
ponysay "start genesisd daemon, set stop height before it"
33 changes: 31 additions & 2 deletions reupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ service genesisd stop
service evmos stop
service evmosd stop

# AFTER STOPPING OF DAEMONS REMOVE ALL SWAP FILES MADE BY THE 0.46 UPGRADE
files_to_remove=$(find / -maxdepth 1 -type f -name 'genesisd_swapfile*')
if [ -z "$files_to_remove" ]; then
echo "No swap files starting with '/genesisd_swapfile' found in the root directory."
else
for file in $files_to_remove; do
swapoff -v "$file"

if swapon --show | grep -q "^$file "; then
echo "Swap file $file was not removed because it is still in use."
else
rm -f "$file"
echo "Removed swap file: $file"
fi
done
fi

for file in $files_to_remove; do
swapfile_name=$(basename "$file")
sed -i "/^\/$swapfile_name /d" /etc/fstab
echo "Removed entry for $swapfile_name from /etc/fstab"
done

# BACKUP .genesisd FOLDER
cd
rsync -r --verbose --exclude 'data' ./.genesisd/ ./.genesisd_backup_reupdate/
Expand Down Expand Up @@ -102,15 +125,21 @@ rm -r genesis.json
wget https://github.com/alpha-omega-labs/genesisd/raw/neolithic/genesis_29-1-state/genesis.json
cd

# RESET TO IMPORTED genesis.json
# BACKUP MONIKER AND REMOVE CONFIG FILES (THE CONFIG FILES FOR v0.46 WERE DIFFERENT)
moniker=$(grep "moniker" .genesisd/config/config.toml | cut -d'=' -f2 | tr -d '[:space:]"')
rm .genesisd/config/app.toml .genesisd/config/config.toml

# REGENERATE CONFIG FILES AND RESET TO IMPORTED genesis.json
genesisd tendermint unsafe-reset-all

# ADD PEERS, ADJUST SETTINGS
cd
cd .genesisd/config
sed -i "s/.*moniker = .*/moniker = \"$moniker\"/" config.toml
sed -i 's/seeds = ""/seeds = ""/' config.toml
sed -i 's/^timeout_commit = .*/timeout_commit = "10s"/' config.toml
sed -i 's/persistent_peers = ""/persistent_peers = "[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:56656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26651,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:21496,[email protected]:26656,[email protected]:26651,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26651,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:26632,[email protected]:60856,[email protected]:26656,[email protected]:20106,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26641,[email protected]:26671"/' config.toml
sed -i 's/minimum-gas-prices = "0aphoton"/minimum-gas-prices = "0el1"/g' app.toml
sed -i 's/minimum-gas-prices = "0aphoton"/minimum-gas-prices = "50000000000el1"/g' app.toml
sed -i 's/halt-height = 0/halt-height = 6751390/g' app.toml
sed -i '212s/.*/enable = false/' app.toml

Expand Down
Loading