Upgrade Guide of Validators on PlatON 0.12.0

version info

ChainID:102

Version: 0.12.0

Git Commit: 30d7fee0c164d7b9b5cd41d7b7ede0fbfeccf212


### 0 . Validator Backup

The staking addresses or profit addresses of validators are the award-receiving addresses of validators when PlatON main net is announced, please back it up in advance. If you loss it, please contact the PlatON team for modification.

If you want to use your previous public key and private key of your validator, please back it up in advanced as well. If you loss it, please generate a new one following the documentation from our official website.


### 1 . Installation Manual

If you’ve installed a PlatON validator, please skip this step and move to part 2 for upgrade.

Set Ubuntu 18.04 as an example, there are two kinds of installations: PPA and source code compiling. Please complete the installation following the installation manual from our official website. If you do need help, please feel free to contact us.

- PPA

PPA installation guide: https://devdocs.platon.network/docs/zh-CN/Install_Node/#安装-platon

**- **** Source Code Compiling ******

source code compiling guide: https://devdocs.platon.network/docs/zh-CN/Install_PlatON/#ubuntu源码编译


### 2、 Upgrade Guide

The upgrade requires validators to clean the chain data. Set the chain data under /opt/platon-node as an example, please stop your platon thread first, and then clean your data following:


# Check the files and categories needed to be cleaned

$ ls /opt/platon-node/data/platon

chaindata  evidence  LOCK  nodes  snapshotdb  transactions.rlp  wal

# Stop your platon thread with this command:

$ ps -ef | grep platon | grep datadir | grep -v grep | cut -c 9-15 | xargs kill

# Enter into the category

$ cd /opt/platon-node/data

# Delete the platon category

$ rm -rf platon

Set Ubuntu 18.04 as an example, there are three kinds of installations: PPA, source code compiling, and use binary. Please complete the upgrade following the steps as follows, and if you do need help, please feel free to contact us.

- PPA


# upgrade
</br>

$ sudo apt update 
# Uninstall your platon
$ sudo apt remove `apt search platon|awk -F/ '/installed/{print $1}'` --purge -y  
# Install platon 0.12.0
$ sudo apt install -y platon0.12.0
# Check whether if it’s 0.12.0
$ platon version
# According to your management method, launch platon thread
# Check whether if the block height works is right
$ platon attach http://localhost:6789 -exec platon.blockNumber
$ cd PlatON-Go
$ git fetch --all
$ git checkout -b release-0.12.0 origin/release-0.12.0
$ make clean
$ make all
# Replace the previous platon file with the one under PlatON-Go/build/bin/
$ chown +x platon
# Check whether if the version is 0.12.0
$ ./platon version
# According to your management method, launch platon thread
# Check whether if the block height is right
$ ./platon attach http://localhost:6789 -exec platon.blockNumber
  • ****** Use Binary ******
# Download the latest binary
$ wget http://47.91.153.183/platon-node/0.12.0-20200507/platon-ubuntu-amd64-0.12.0.tar.gz
# Unzip it and use the latest platon binary to replace the previous one
$ tar -xvf platon-ubuntu-amd64-0.12.0.tar.gz
$ chmod u+x platon
# Check whether if the version is 0.12.0
$ ./platon version
# According to the management method, launch platon thread
# Check whether if the block height is right
$ ./platon attach http://localhost:6789 -exec platon.blockNumber
</br>
</br>
</br>

**### 3、** **Chian ID modification**

After the upgrade, the chain ID is modified. If you haven’t installed PlatON validator, please input 102 as your chain ID when running validator_conf.sh; if you haven run PlatON validator, please modify your chain ID to be 102 from 101, in the validator_conf.sh configuration file. Set the mtool installation category under /opt/mtool-client as an example, the chain ID modification is as follows:
</br>

```bash
# Enter into the related configuration file category
$ cd /opt/mtool-client/validator
# Edit validator_config.json file, and change the chainID to be 102 only
$ vim validator/validator_config.json
{
"chainId": "102",
 ...
}

### 4 . Feedback

If you failed in platon upgrade, please let us know via:

  1. gitter room: https://gitter.im/PlatON_Network/Welcome
  2. validator Wechat group
  3. email to: rally@platon.network