ATTENTION: This guide is only for updating from commercio-testnet4000 to commercio-testnet5000 and for full nodes or validators that have followed the instructions reported here Installing a full node
systemctl stop cnd
pkill cncli
cd ~/go/bin
wget "https://github.com/commercionetwork/commercionetwork/releases/download/v1.3.3/Linux-AMD64.zip"
unzip -o Linux-AMD64.zip
rm -rf Linux-AMD64.zip
cd ~/
rm -rf commercio-chains
mkdir commercio-chains && cd commercio-chains
git clone https://github.com/commercionetwork/chains.git .
cd commercio-testnet5000
Update your CHAINID
export CHAINID=commercio-$(cat .data | grep -oP 'Name\s+\K\S+')
sed -ie "s|CHAINID=\".*\"|CHAINID=\"$CHAINID\"|g" ~/.profile
cp -r ~/.cnd ~/.cnd.save
Test if you have the correct binaries version:
cnd version
# Should output the same version written inside the .data file.
# cat .data | grep -oP 'Release\s+\K\S+'
Reset chain and install new genesis:
cnd unsafe-reset-all
cp genesis.json ~/.cnd/config
Change the persistent peers inside config.toml file
sed -e "s|persistent_peers = \".*\"|persistent_peers = \"$(cat .data | grep -oP 'Persistent peers\s+\K\S+')\"|g" ~/.cnd/config/config.toml > ~/.cnd/config/config.toml.tmp
mv ~/.cnd/config/config.toml.tmp ~/.cnd/config/config.toml
Change the seeds inside the config.toml file
sed -e "s|seeds = \".*\"|seeds = \"$(cat .data | grep -oP 'Seeds\s+\K\S+')\"|g" ~/.cnd/config/config.toml > ~/.cnd/config/config.toml.tmp
mv ~/.cnd/config/config.toml.tmp ~/.cnd/config/config.toml
systemctl start cnd
Control if the sync was started. Use Ctrl + C to interrupt the tail command
tail -100f /var/log/syslog
# OUTPUT SHOULD BE LIKE BELOW If you start the chain before the genesis time
#Oct 30 18:38:33 yournodehost cnd[25314]: I[2019-10-30|18:38:33.401] starting ABCI with Tendermint module=main
Update cncli config
cncli config chain-id $CHAINID
In order to update the OS so that you can work properly, execute the following commands:
apt update && apt upgrade -y
snap refresh go
Before update the node, get commercio-testnet5000 chain data
rm -rf commercio-chains
mkdir commercio-chains && cd commercio-chains
git clone https://github.com/commercionetwork/chains.git .
cd commercio-testnet5000
Compile binaries
systemctl stop cnd
pkill cncli
git init .
git remote add origin https://github.com/commercionetwork/commercionetwork.git
git pull
git checkout tags/$(cat .data | grep -oP 'Release\s+\K\S+')
make install
Test if you have the correct binaries version:
cnd version
# Should output the same version written inside the .data file
# cat .data | grep -oP 'Release\s+\K\S+'
Update CHAINID:
export CHAINID=commercio-$(cat .data | grep -oP 'Name\s+\K\S+')
sed -ie "s|CHAINID=\".*\"|CHAINID=\"$CHAINID\"|g" ~/.profile
cp -r ~/.cnd ~/.cnd.save
Test if you have the correct binaries version:
cnd version
# Should output the same version written inside the .data file.
# cat .data | grep -oP 'Release\s+\K\S+'
Reset chain and install new genesis:
cnd unsafe-reset-all
cp genesis.json ~/.cnd/config
Change the persistent peers inside config.toml file
sed -e "s|persistent_peers = \".*\"|persistent_peers = \"$(cat .data | grep -oP 'Persistent peers\s+\K\S+')\"|g" ~/.cnd/config/config.toml > ~/.cnd/config/config.toml.tmp
mv ~/.cnd/config/config.toml.tmp ~/.cnd/config/config.toml
Change the seeds inside the config.toml file
sed -e "s|seeds = \".*\"|seeds = \"$(cat .data | grep -oP 'Seeds\s+\K\S+')\"|g" ~/.cnd/config/config.toml > ~/.cnd/config/config.toml.tmp
mv ~/.cnd/config/config.toml.tmp ~/.cnd/config/config.toml
systemctl start cnd
Control if the sync was started. Use Ctrl + C to interrupt the tail command
tail -100f /var/log/syslog
# OUTPUT SHOULD BE LIKE BELOW If you start the chain before the genesis time
#Oct 30 18:38:33 yournodehost cnd[25314]: I[2019-10-30|18:38:33.401] starting ABCI with Tendermint module=main
Update cncli config
cncli config chain-id $CHAINID
cncli rest-server