Keeping up to date with new features and maintenance releases
Once a MultiChain network is up and running, three kinds of upgrades can be performed. The first is to upgrade the MultiChain software running on one or more nodes, to take advantage of new node-level features or the fixes in a maintenance release. The second is to upgrade the blockchain protocol, to activate new network-level features, beginning from a certain block. And the third is to upgrade certain other blockchain parameters, to scale the blockchain up or down or change its access rules.
Instructions for performing these upgrades are described below. It should be noted that a protocol upgrade will often require a prior software upgrade of the nodes in the network, because the new protocol is only supported by a new version of MultiChain.
Upgrading MultiChain software
These steps should be followed for each computer on which MultiChain is installed and needs to be upgraded:
- If MultiChain is currently running for a chain, you can check its version in the
version
field of the response to thegetinfo
command. There is also anodeversion
field containing a numerical version which is guaranteed to increase with each release. - If MultiChain is not running, its version can be checked by running
multichaind -version
on the command line. - To upgrade MultiChain, stop any running nodes using the
stop
API command (multichain-cli [chain-name] stop
from the command line). Alsoexit
from anymultichain-cli
processes running in interactive mode. - Verify that no MultiChain software is currently running. On Linux or Mac, use
ps -x
. On Windows, use the Windows Task Manager or thetasklist
command. - Follow the regular instructions to download and install MultiChain, overwriting the previous versions of the MultiChain executables.
- Restart any nodes required in the normal way:
multichaind [chain-name] -daemon
Upgrading blockchain protocol and other parameters
Protocol and parameter upgrades are managed by one or more of a chain’s administrators as follows:
- Check the chain’s current protocol version and other parameters (as of the most recent block) using
getblockchainparams
. The protocol version must be at least10008
to allow protocol upgrading, and20007
to allow upgrading of other blockchain parameters. - If upgrading the protocol version, check whether the MultiChain software being used by the other network’s participants supports the new version. Each can run
multichaind -version
to see the protocol versions supported by their copy of MultiChain – if necessary they should upgrade their software by following the steps in the previous section. - Once the network participants are ready, create the pending (as yet unapproved) upgrade from an address which has both
admin
andcreate
permissions. A node with the private key for this address should run the following, with values in[square brackets]
substituted as appropriate:createfrom [from-address] upgrade [upgrade-name] false [new-params]
The
[new-params]
structure is a JSON object containing the blockchain parameters to change, for example{"protocol-version":20010}
or{"target-block-time":5, "maximum-block-size":16777216}
. To apply the upgrade from a specific block number, include"startblock":[block-number]
inside this JSON object. - On any node, check the
required
field oflistupgrades [upgrade-name]
to see how many administrators need to approve the upgrade. This is equal to the number of addresses withadmin
permissions multiplied by theadmin-consensus-upgrade
blockchain parameter, rounded up. - Each required administrator should approve the upgrade by running the following on the node holding their private key:
approvefrom [from-address] [upgrade-name] true
- After each admin’s approval, check they appear in the
admins
field oflistupgrades [upgrade-name]
and thatrequired
has gone down. - Once enough approvals have been given, check that the
approved
field oflistupgrades [upgrade-name]
istrue
. - Wait for the next block (or specified block number) to appear, then check that the
appliedblock
field oflistupgrades [upgrade-name]
shows this block’s height. Theappliedparams
field will show changes that were made successfully. Theskippedparams
field will show any changes that could not be made, along with the reason why.
Some further notes about this process:
- If a node is running an old version of MultiChain that does not support a chain’s new protocol version, a
-718 (RPC_UPGRADE_REQUIRED)
error will be given for most API commands sent to that node. - A full history of pending or approved upgrades can be viewed using
listupgrades
on any node. - If an admin’s private key is not held in a node’s wallet, upgrades can be created and approved using raw transactions.