【手册】PlatON网络1.2.1版本升级操作手册|[Manual] Operation Manual of PlatON’s Upgrade to Version 1.2.1

中文

版本信息

ChainID: 100

Version: 1.2.1

Git Commit: 890ac8f68cacd82366d369b09240a7ae069c87a1

二进制下载: https://download.platon.network/platon/platon/1.2.1/platon

1、安装指南

​ 若已安装了PlatON节点,请跳到第2点进行更新操作;

​ 未安装节点,请严格按照官方文档安装,如有需要帮助请联系客服。

2、更新指南(先更新,暂不重启)

​ 以下步骤以 Ubuntu18.04 系统为例,更新操作分为两种方式:直接使用二进制、源码编译,选其中一种方式更新即可;请严格按照以下步骤操作升级,如有需要帮助请联系客服。

  • 直接用二进制

    # 备份二进制
    $ [[ -x /usr/bin/platon ]] && sudo mv /usr/bin/platon /usr/bin/platon_`platon version | grep '^Version:' | awk -F "[ ,:,-]" '{print $3}'`
    # 下载最新的二进制文件
    $ wget https://download.platon.network/platon/platon/1.2.1/platon
    # 使用新的版本
    $ chmod +x platon
    $ sudo mv platon /usr/bin/platon
    # 查看版本
    $ platon version
    Version: 1.2.1-unstable
    Git Commit: 890ac8f68cacd82366d369b09240a7ae069c87a1
    
  • 源码编译(针对之前已成功编译过的环境,全新编译请参考官网源码安装

    # 备份二进制
    $ [[ -x /usr/bin/platon ]] && sudo mv /usr/bin/platon /usr/bin/platon_`platon version | grep '^Version:' | awk -F "[ ,:,-]" '{print $3}'`
    # 编译二进制
    $ git clone https://github.com/PlatONnetwork/PlatON-Go.git --recursive
    $ cd PlatON-Go/
    $ git fetch --all
    $ git checkout -b platon-1.2.1  890ac8f68cacd82366d369b09240a7ae069c87a1
    # 安装依赖和编译,如果出现missing go.sum entry for module,使用go mod tidy移除未使用和添加缺失的依赖
    $ go mod download && make all
    # 使用新的版本
    $ chmod +x build/bin/platon
    $ sudo mv build/bin/platon /usr/bin/platon
    # 查看版本
    $ platon version
    Version: 1.2.1-unstable
    Git Commit: 890ac8f68cacd82366d369b09240a7ae069c87a1
    

3、择机重启进程

​ 如果当前节点质押过,首先通过区块链浏览器查看节点是否已经被选为验证人(共识中)
如果已经当选,请等待节点退出验证人(共识中转为活跃中)后再进行重启操作。

​ 以下命令仅做参考,根据各自的管理方式,重启platon进程

# 查看进程号
$ ps aux |grep platon
root   13476 39.1 49.7 9174616 3925796 ?     Sl   Feb07 1140:19 /usr/bin/platon  --identity ....

# 停止platon节点,如kill 13476,上述示例中进程号为13476,实际操作时根据实际情况取值;执行kill命令后,可再使用上述ps命令查看进程是否正确退出,若正常退出再执行后续启动命令
$ kill <进程号>

# 启动platon节点
$ nohup platon --identity platon-node --datadir ./data --port 16789  --rpcport 6789 --rpcapi "db,platon,net,web3,admin,personal" --rpc --nodekey ./data/nodekey --cbft.blskey ./data/blskey --verbosity 1 --rpcaddr 127.0.0.1 --syncmode "fast" > ./data/platon.log 2>&1 &

# 重启后进入控制台检查节点版本是否生效:v1.2.1-unstable-890ac8f6-20220408
$ platon attach http://localhost:6789
Welcome to the PlatON JavaScript console!

instance: PlatONnetwork/10.1.1.60/v1.2.1-unstable-890ac8f6-20220408/linux-amd64/go1.16.8

4、版本声明

当版本声明后,可在浏览器查看节点版本

  • 未质押过的节点,跳过本步骤。

  • 没定义$PLATON_MTOOLDIR的,需要根据实际部署情况补全绝对路径。

    #版本声明示例
    $ platon_mtool declare_version --keystore $PLATON_MTOOLDIR/keystore/staking.json --config $PLATON_MTOOLDIR/validator/validator_config.json
    

5、反馈

platon升级失败的,可通过以下渠道反馈。

  1. 微信 Colinan
  2. 微信验证节点群
  3. 邮箱 validator@platon.network

English

Version Info

ChainID: 100

Version: 1.2.1

Git Commit: 890ac8f68cacd82366d369b09240a7ae069c87a1

Binary Document: https://download.platon.network/platon/platon/1.2.1/platon

1. Installation Instructions

​ If you have installed the PlatON node, please skip to Step 2 for the upgrade;

​ If you haven’t installed the node, please install it strictly according to the Official Documentation. If you need any help, feel free to reach out to us through our customer service.

2. Upgrade Instructions (Upgrade Without Rebooting)

The following instructions are based on the Ubuntu18.04 system. You could complete the upgrade directly through the binary document or source code compiling. Please carry out the upgrade in strict accordance with the following procedures. If you need any help, feel free to reach out to us through our customer service.

  • Directly activate the binary document

    # Make a binary backup
    $ [[ -x /usr/bin/platon ]] && sudo mv /usr/bin/platon /usr/bin/platon_`platon version | grep '^Version:' | awk -F "[ ,:,-]" '{print $3}'`
    # Download the latest binary document
    $ wget https://download.platon.network/platon/platon/1.2.1/platon
    # Use the latest version
    $ chmod +x platon
    $ sudo mv platon /usr/bin/platon
    # Check the version
    $ platon version
    Version: 1.2.1-unstable
    Git Commit: 890ac8f68cacd82366d369b09240a7ae069c87a1
    
  • Source code compiling (The following is intended for previously complied environments. For new compiling, please refer to our official website.)

    # Make a binary backup
    $ [[ -x /usr/bin/platon ]] && sudo mv /usr/bin/platon /usr/bin/platon_`platon version | grep '^Version:' | awk -F "[ ,:,-]" '{print $3}'`
    # Compile the binary document
    $ git clone https://github.com/PlatONnetwork/PlatON-Go.git --recursive
    $ cd PlatON-Go/
    $ git fetch --all
    $ git checkout -b platon-1.2.1  890ac8f68cacd82366d369b09240a7ae069c87a1
    # Install the dependency library and compiler. In case of missing go.sum entry for module, please use go mod tidy to remove unused dependencies and add the missing ones.
    $ go mod download && make all
    # Use the latest version
    $ chmod +x build/bin/platon
    $ sudo mv build/bin/platon /usr/bin/platon
    # Check the version
    $ platon version
    Version: 1.2.1-unstable
    Git Commit: 890ac8f68cacd82366d369b09240a7ae069c87a1
    

3. When to Reboot the PlatON Process

If the present node has staked before, please check whether it has been selected as a validator (Verifying) on the PlaON Blockchain Explorer.

If so, please reboot the process after the node exits from the validator model (switch from Verifying to Active).

The command below is for reference only. Validators should reboot the platon process according to their own management approach.

# Check the process number
$ ps aux |grep platon
root   13476 39.1 49.7 9174616 3925796 ?     Sl   Feb07 1140:19 /usr/bin/platon  --identity ....

# Stop the platon node, such as kill 13476. In the above example, the process number is 13476. In reality, the value is taken according to the actual situation. After executing the kill command, you can use the above ps command to check whether the process exits correctly. If so, then you can execute the subsequent rebooting command
$ kill <process number>

# Reboot the platon node
$ nohup platon --identity platon-node --datadir ./data --port 16789  --rpcport 6789 --rpcapi "db,platon,net,web3,admin,personal" --rpc --nodekey ./data/nodekey --cbft.blskey ./data/blskey --verbosity 1 --rpcaddr 127.0.0.1 --syncmode "fast" > ./data/platon.log 2>&1 &

# After rebooting, enter the console to check whether the node version takes effect: v1.2.1-unstable-890ac8f6-20220408
$ platon attach http://localhost:6789
Welcome to the PlatON JavaScript console!

instance: PlatONnetwork/10.1.1.60/v1.2.1-unstable-890ac8f6-20220408/linux-amd64/go1.16.8

4. Version Statement

After the version statement is released, you could check the validator version on the PlatON Blockchain Explorer.

  • Validators who never staked before could skip this step.

  • Where $PLATON_MTOOLDIR is not defined, the absolute path should be completed according to the actual deployment.

    #Example of version statement
    $ platon_mtool declare_version --keystore $PLATON_MTOOLDIR/keystore/staking.json --config $PLATON_MTOOLDIR/validator/validator_config.json
    

5. Feedback

If your platon upgrade failed, please provide us feedback through the following channels.

  1. WeChat: Colinan

  2. WeChat group of validators

  3. Email: validator@platon.network