【手册】PlatON网络1.1.1(哥白尼Copernicus)版本升级操作手册

中文版本

版本信息

ChainID: 100

Version: 1.1.1

Git Commit: 9960b7fd8128a047bc552b76ab7a0f557d0fb7dd

1、升级注意事项

1.1 CPU、内存和磁盘问题

因升级过程中部分历史数据会做迁移至Freezer数据库,cpu会有所增加,数据迁移完成恢复正常;升级重启后,少数会有内存增加的情况,数据迁移完成后恢复正常;升级后存储也会有部分提升(例如从1620万块高升级后存储空间将增加约8G)。详细查看Github releases

  • 升级内存

    8G内存的节点在升级重启的过程中小概率会出现内存增加,导致OOM,为了避免这种情况,建议使用swap分区,若有条件也可以选择将机器物理内存升级到16GB。

    增加swap分区

    wget https://download.platon.network/platon/scripts/platon_swap.sh
    chmod +x platon_swap.sh
    ./platon_swap.sh 
    

    注意

    1. 文档提供的platon_swap.sh 脚本做以下处理:当swap分区不存在,则创建8G的swap分区;当swap分区小于7G,会增加swap分区到8G;当swap分区大于7G,则不创建swap分区。
    2. 若不升级主机内存进行节点升级,出现OOM的情况,导致机器无法连接上;重启主机机器后,可恢复启动进程
  • 扩容磁盘

    升级过程中,磁盘容量有所增加约8G,若磁盘可用容量不足,建议扩容磁盘容量。

1.2 不兼容性问题

本次节点升级后,不能使用1.1.0的版本和升级后的数据进行启动,建议升级前,先下载官方提供的备份数据,存放在节点主机上,若节点升级后不能启动,需要使用1.1.0的版本和备份数据来启动节点。

  • fast模式备份数据,数据大小是9.4G的,块高是16230831,当节点启动失败,使用该数据替换data/platon目录

    wget https://download.platon.network/platon/nodedata/1.1.0-fast-data.tar.gz
    tar -xf 1.1.0-fast-data.tar.gz
    

2、安装指南

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

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

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

​ 以下步骤以 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.1.1/platon
    # 使用新的版本
    $ chmod +x platon
    $ sudo mv platon /usr/bin/platon
    # 查看版本
    $ platon version
    Version: 1.1.1-unstable
    Git Commit: 9960b7fd8128a047bc552b76ab7a0f557d0fb7dd
    
  • 源码编译(针对之前已成功编译过的环境,全新编译请参考官网源码安装

    # 备份二进制
    $ [[ -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 checkout -b platon-1.1.1  9960b7fd8128a047bc552b76ab7a0f557d0fb7dd
    # 安装依赖和编译,如果出现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.1.1-unstable
    Git Commit: 9960b7fd8128a047bc552b76ab7a0f557d0fb7dd
    

4、择机重启进程

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

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

nohup platon --identity platon --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 &

5、版本声明

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

#版本声明示例
$ platon_mtool declare_version --keystore $PLATON_MTOOLDIR/keystore/staking.json --config $PLATON_MTOOLDIR/validator/validator_config.json
  • 未质押过的节点,跳过本步骤。
  • 没定义$PLATON_MTOOLDIR的,需要根据实际部署情况补全绝对路径。

6、反馈

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

  1. 验证节点群
  2. 邮箱 validator@platon.network

English version

Version Information

ChainID: 100

Version: 1.1.1

Git Commit: 9960b7fd8128a047bc552b76ab7a0f557d0fb7dd

1. Notes of Update

1.1 CPU, memory and disk-related issues

As part of the historical data will be migrated to the Freezer database during the upgrade process, the hashing power of CPU will grow and return to normal when the data is migrated; after the upgrade is restarted, the memory may increase in some cases, and if so, it will return to normal when the data is migrated; the storage will also increase after the upgrade (for example, the storage space will increase by about 8G after the upgrade at the height of Block 16200000). For details, see Github releases

  • Upgrade memory

    There is a small probability that 8G memory will increase when the nodes are upgrading, resulting in OOM. To avoid this situation, it is advised to use swap partitions. If possible, you can also upgrade the machine’s physical memory to 16GB.

    Increase swap partition

    wget https://download.platon.network/platon/scripts/platon_swap.sh
    chmod +x platon_swap.sh
    ./platon_swap.sh 
    

    Notes:

    The platon_swap.sh script provided in the document is subject to the following treatments: when the swap partition does not exist, an 8G swap partition will be created; when the swap partition is less than 7G, the swap partition will be increased to 8G; when the swap partition is greater than 7G, the swap partition will not be created .

    If you do not upgrade the host memory for node upgrade, an OOM situation will occur and the host will fail to be connected; after the host is restarted, the startup process can be resumed

  • Scale the disk

    During the upgrade process, the disk capacity has increased by about 8G. If the available disk capacity is insufficient, it is suggested to scale it.

1.2 Incompatibility issue

After this node upgrade, you cannot use version 1.1.0 or the upgraded data to start up. It is suggested to download the official backup data before the upgrade and store it on the node’s host. If the node cannot be started after the upgrade, version 1.1.0 and the backup data will be needed.

  • To back up data in the fast mode, with the data size of 9.4G and the block height at 16230831, replace the data/platon directory with the data when the node fails to start,.

    wget https://download.platon.network/platon/nodedata/1.1.0-fast-data.tar.gz
    tar -xf 1.1.0-fast-data.tar.gz
    

2. Installation Guide

​ If the PlatON node has been installed, please skip to 3 to update the nodes;

​ If the node is not installed, please strictly follow the official document for installation. If you need help, please contact customer service.

3. Update Guide (update first, and do not restart temporarily)

We take the Ubuntu18.04 system as an example in the following steps. There are two ways for the update: directly using binary and source code compilation, for your choice; please strictly follow the steps below. If you need any help, please contact customer service.

  • Directly using binary

    # Back up binary
    $ [[ -x /usr/bin/platon ]] && sudo mv /usr/bin/platon /usr/bin/platon_`platon version | grep '^Version:' | awk -F "[ ,:,-]" '{print $3}'`
    # Download the latest binary file
    $ wget https://download.platon.network/platon/platon/1.1.1/platon
    # Use new version
    $ chmod +x platon
    $ sudo mv platon /usr/bin/platon
    # View version
    $ platon version
    Version: 1.1.1-unstable
    Git Commit: 9960b7fd8128a047bc552b76ab7a0f557d0fb7dd
    
  • Source code compilation (For the environment that has been successfully compiled before, please refer to Installation of official website source code for new compilation)

    # Back up binary
    $ [[ -x /usr/bin/platon ]] && sudo mv /usr/bin/platon /usr/bin/platon_`platon version | grep '^Version:' | awk -F "[ ,:,-]" '{print $3}'`
    # Compile binary
    $ git clone https://github.com/PlatONnetwork/PlatON-Go.git --recursive
    $ cd PlatON-Go/
    $ git checkout -b platon-1.1.1  9960b7fd8128a047bc552b76ab7a0f557d0fb7dd
    # Install dependencies and compile. If missing go.sum entry for module appears, use go mod tidy to remove unused and add missing dependencies
    $ go mod download && make all
    # Use new version
    $ chmod +x build/bin/platon
    $ sudo mv build/bin/platon /usr/bin/platon
    # View version
    $ platon version
    Version: 1.1.1-unstable
    Git Commit: 9960b7fd8128a047bc552b76ab7a0f557d0fb7dd
    

4. Restart the Process as Appropriate

If the current node has staked coins before, first check whether the node has been elected as a validator (in consensus) through Blockchain Explorer.
If yes, please restart after the node quit being the validator (from in consensus to active).

The following commands are for reference only. You may restart the platon process according to the respective management methods.

nohup platon --identity platon --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 &

5. Version Statement

After the version statement is released, you can check the node version in the explorer.

#Example of version statement
$ platon_mtool declare_version --keystore $PLATON_MTOOLDIR/keystore/staking.json --config $PLATON_MTOOLDIR/validator/validator_config.json
  • For nodes with no staking, skip this step.
  • If $PLATON_MTOOLDIR is not defined, the absolute path needs to be completed according to the actual deployment situation.

6. Feedback

If the platon upgrade fails, you can provide feedback through the following channels.

  1. WeChat group of validators

  2. Email validator@platon.network