Upgrade & Hard Fork
Klaytn and its ServiceChain have constantly released new versions to develop new features and fix bugs. This page is a guide to upgrade ServiceChain binaries and setting hard fork block numbers for your ServiceChain.
This section shows how to upgrade the ServiceChain binary.
NOTE Upgrading ServiceChain binaries may be irreversible and backward-incompatible, meaning you cannot downgrade to an older version. Refer to the release notes for more details. For example, the Klaytn v1.9.0 release note says:
NOTE: This version updates the version of the database to support snapshot sync. You cannot downgrade to the older versions with existing data after updating to v1.9.0.
You can get the latest version of Klaytn and ServiceChain binaries in one of the below links:
To upgrade the ServiceChain binary, stop the ServiceChain node and replace the binary. For example, you can use below commands to stop an SCN node and replace the binary with a newer one.
$ kscnd stop
Shutting down kscnd: OK
$ cp /path/to/new/kscn /path/to/original/kscn
You may restart the ServiceChain node after the upgrade. However, if you are planning to activate hard fork in the ServiceChain, you have to keep the ServiceChain nodes down. Refer to the Hard Fork for instructions of ServiceChain hard fork.
$ kscnd start
To apply the hard fork to the ServiceChain, you need to:
- 1.Pick an appropriate block number for the hard fork
- 2.Upgrade the ServiceChain binary to a version that supports the hard fork
- 3.Set the hard fork block number in the ServiceChain
In the Javascript console of the ServiceChain, you can check the current block number as shown below.
$ kscn attach ~/kscnd_home/klay.ipc
Welcome to the Klaytn JavaScript console!