Skip to content

Latest commit

 

History

History
284 lines (239 loc) · 5.75 KB

UP.md

File metadata and controls

284 lines (239 loc) · 5.75 KB

Upgrade version

1. Find containers and nodes

Install and start new tmux session:

pacman -Syyu --noconfirm tmux
pacman -Sy --noconfirm tmux
tmux new -s upgrade
tmux attach -t upgrade

Find nodes that run service:

Eg: osmosis, osmosis-testnet, osmosis-archived, osmosis-pruned

read -p "Enter service name [bitsong]:" service
docker service ps $(docker service ls | grep $service | grep -E "rpc_$service\\_" | awk '{print $2}')
docker service ps $(docker service ls | grep $service | grep -E "snapshot_$service " | awk '{print $2}')
docker service ps $(docker service ls | grep $service | grep -E $service"-archive-sub" | awk '{print $2}')

2. Upgrade RPC

Rpc:

read -p "Enter service name [bitsong]:" service
docker exec -it $(docker ps -a | grep $service | grep -E "rpc_$service\\_" | awk '{print $1}') /bin/bash

Install and start new tmux session:

pacman -Syyu --noconfirm tmux
pacman -Sy --noconfirm tmux
tmux new -s upgrade
tmux attach -t upgrade

New version:

read -p "Enter new version [v2.0.0]:" newversion
killall crond
cat ~/env.sh

Upgrade use script:

curl -Ls -o- https://raw.githubusercontent.com/notional-labs/cosmosia/main/rpc/scripts/update_config.sh | bash -s -- 1
curl -Ls -o- https://raw.githubusercontent.com/notional-labs/cosmosia/main/rpc/scripts/upgrading.sh | bash -s -- $newversion

Wait till synced.

Check status:

curl localhost:26657/status | jq

Check logs

tail -f -n100 /var/log/chain.err.log

Edit env.sh to new version:

crond
pacman -Sy --noconfirm vim
vim $HOME/env.sh

3. Upgrade Snapshot

Snapshot:

read -p "Enter service name [bitsong]:" service
docker exec -it $(docker ps -a | grep $service | grep -E "snapshot_$service\." | awk '{print $1}') /bin/bash

Install and start new tmux session:

pacman -Syyu --noconfirm tmux
pacman -Sy --noconfirm tmux
tmux new -s upgrade
tmux attach -t upgrade

New version:

read -p "Enter new version [v2.0.0]:" newversion
killall crond
cat ~/env.sh

Upgrade use script:

curl -Ls -o- https://raw.githubusercontent.com/notional-labs/cosmosia/main/rpc/scripts/update_config.sh | bash -s -- 2
curl -Ls -o- https://raw.githubusercontent.com/notional-labs/cosmosia/main/rpc/scripts/upgrading.sh | bash -s -- $newversion

Wait till synced.

Check status:

curl localhost:26657/status | jq

Check logs

tail -f -n100 /var/log/chain.err.log

Turn on crond and edit env.sh to new version:

crond
pacman -Sy --noconfirm vim
vim $HOME/env.sh

4. Archive sub

Archive sub:

read -p "Enter service name [bitsong]:" service
docker exec -it $(docker ps -a | grep $service | grep -E $service"-archive-sub" | awk '{print $1}') /bin/bash

Install and start new tmux session:

pacman -Syyu --noconfirm tmux
pacman -Sy --noconfirm tmux
tmux new -s upgrade
tmux attach -t upgrade

Backup data:

cd
sh $HOME/env.sh
cp -R $node_home /root/backup

watch copy progress:

watch -n 1 du -sh $HOME/backup
read -p "Enter new version [v2.0.0]:" newversion
killall crond
cat ~/env.sh

Upgrade use script:

curl -Ls -o- https://raw.githubusercontent.com/notional-labs/cosmosia/main/rpc/scripts/update_config.sh | bash -s -- 1
curl -Ls -o- https://raw.githubusercontent.com/notional-labs/cosmosia/main/rpc/scripts/upgrading.sh | bash -s -- $newversion

Wait till synced.

Check status:

curl localhost:26657/status | jq

Check logs

tail -f -n100 /var/log/chain.err.log

Turn on crond and edit env.sh to new version:

crond
pacman -Sy --noconfirm vim
vim $HOME/env.sh

Remove backup data:

rm -rf $HOME/backup

5. Archive sub snapshot

Archive sub snapshot:

read -p "Enter service name [bitsong]:" service
docker exec -it $(docker ps -a | grep $service | grep -E "snapshot_"$service"-archive-sub" | awk '{print $1}') /bin/bash

Install and start new tmux session:

pacman -Syyu --noconfirm tmux
pacman -Sy --noconfirm tmux
tmux new -s upgrade
tmux attach -t upgrade

Backup data:

cd
sh $HOME/env.sh
cp -R $node_home /root/backup

watch copy progress:

watch -n 1 du -sh $HOME/backup
read -p "Enter new version [v2.0.0]:" newversion
killall crond
cat ~/env.sh

Upgrade use script:

curl -Ls -o- https://raw.githubusercontent.com/notional-labs/cosmosia/main/rpc/scripts/update_config.sh | bash -s -- 1
curl -Ls -o- https://raw.githubusercontent.com/notional-labs/cosmosia/main/rpc/scripts/upgrading.sh | bash -s -- $newversion

Wait till synced.

Check status:

curl localhost:26657/status | jq

Check logs

tail -f -n100 /var/log/chain.err.log

Turn on crond and edit env.sh to new version:

crond
pacman -Sy --noconfirm vim
vim $HOME/env.sh

Remove backup data:

rm -rf $HOME/backup

6. Install go with specific version

curl -Ls -o- https://raw.githubusercontent.com/hqdNotional/blockchain/main/install_go.sh | bash -s -- 

7. Update golevel chain

Remember to add NEW_VERSION:

curl -Ls -o- https://raw.githubusercontent.com/hqdNotional/blockchain/main/upgrade_golevel.sh | bash -s -- 

8. Synch check

curl -Ls -o- https://raw.githubusercontent.com/hqdNotional/blockchain/main/check_sync.sh | bash -s -- 

9. Build chain only

PebbleDB:

curl -Ls -o- https://raw.githubusercontent.com/hqdNotional/blockchain/main/mono_pebble.sh | bash -s -- 

GolevelDB:

curl -Ls -o- https://raw.githubusercontent.com/hqdNotional/blockchain/main/mono_golevel.sh | bash -s -- 

10. Update Registry

Go to github pull fork repo cosmosia ->> Sync Fork

git pull

Chain:

export CHAIN=
vi ~/cosmosia/data/$CHAIN.ini

Update:

  • version

Then commit ->> push ->> contribute ->> pull request ->> merge