3.2.2. mijin Catapult(v.2) version up

This chapter describes how to upgrade a mijin Catapult(v.2) node.
Upgrading to 1.0.3.11 is done with mijin-init-tools, the setup tool included in the node. Upgrading to 1.0.3.9 or earlier is done by updating the docker container version and, if necessary, the config files.
Version upgrade announcements are sent out for paid support customers.
creation-day:

Aug. 1, 2022

update date:

Nov. 27, 2026

3.2.2.1. Upgrading to 1.0.3.11

This is the procedure for upgrading nodes of the AWS Marketplace Enterprise edition (1.0.3.6 through 1.0.3.9) to 1.0.3.11.
Nodes are upgraded one at a time without stopping the chain.

Warning

1.0.3.11 includes a hard fork (such as stricter VRF verification). The fork takes effect at the fork height that you decide when upgrading.
Finish upgrading all nodes before the chain reaches the fork height. Nodes that have not been upgraded will fall out of consensus at the fork height.
Always upgrade nodes one at a time. If voting nodes are stopped at the same time, finalization stops (see When mijin Catapult(v.2) Finalization Stops ).

Warning

The aggregate transaction version switches at the fork height.
・フォークの高さからは、バージョン 3 だけが承認されます。バージョン 2 は Failure_Aggregate_V2_Prohibited で拒否されます。
・1.0.3.6〜1.0.3.8 から上げる場合、上げてからフォークの高さまでの間は、バージョン 2 だけが承認されます。バージョン 3 は Failure_Aggregate_V3_Prohibited で拒否されます。両方が承認される期間はありません。
・1.0.3.9 から上げる場合は、1.0.3.9 ですでにバージョン 3 に切り替わっているため、影響はありません。
mijin-catapult-tools and SDK 2.0.6 ( Development using mijin Catapult(v.2) ) always send version 3, so when upgrading from 1.0.3.6 through 1.0.3.8, operations that use aggregate transactions (such as creating mosaics) fail between the upgrade and the fork height. Set the fork height shortly after all nodes will have been upgraded, and suspend operations that use aggregate transactions during that time.
You can check which version to use now and how many blocks remain until the fork height with the REST endpoint /mijin/forks (see mijin Catapult(v.2) How to check status ).

3.2.2.1.1. Changes in 1.0.3.11

Item

Details

catapult-server

mijin-1.0.3.11

catapult-rest

mijin-2.5.2-100311 (changed from restify to Fastify)

MongoDB

8.0.38. When upgrading from 1.0.3.6 (MongoDB 5.0), the data compatibility version (featureCompatibilityVersion) is raised one step at a time. mijin-init-tools does this automatically

REST rate limit ( RestThrottring )

Requests are now counted per IP as the number of requests in each time window (for 30tps, 100 requests per 3.3 seconds). The average limit is the same, but if you send many requests in a short time, 429 may be returned at different timings than before. NoLimit still means no limit

Owner of files and containers

All node files (including those under /mnt/mijin ) and containers are owned by the catapult user. mijin-init-tools aligns the ownership during the upgrade

REST additions

/mijin/forks, /mijin/votingkeys, /mijin/storage ( mijin Catapult(v.2) How to check status )

3.2.2.1.2. Preparation

Before upgrading the first node, decide the following two things.

  • The order in which to upgrade nodes: api1 → api2 → peer1 → peer2 → …

  • The fork height N (Step.3).

Perform the work on each node with root privileges ( sudo ).
If you want to log in to AWS MarketPlace’s mijin Catapult(v.2), you can use mijin Catapult(v.2) EC2 instance login how to.
The api nodes need Internet access, because images of intermediate MongoDB versions are pulled from docker hub.

3.2.2.1.2.1. Check the free space on the root volume (all nodes)

The upgrade pulls new docker images onto the root volume (/). The current images stay, so the root volume needs free space for the new images.
If there is not enough free space, upgrade fails while pulling the images. Check the free space on all nodes before you upgrade the first node.

Node

Images pulled

Free space needed (guideline)

api node

catapult-server, catapult-rest, MongoDB 8.0 (and the intermediate MongoDB versions when upgrading from 1.0.3.8 or earlier)

10 GB or more

peer node

catapult-server

5 GB or more

The free space is shown in the Avail column of df -h /.
$ df -h /
Filesystem       Size  Used Avail Use% Mounted on
/dev/root         29G   21G  8.0G  73% /
If there is not enough free space, increase the size of the root volume before the upgrade. Increase the size of the EBS volume, then extend the file system on the node. Neither step requires stopping the node. For the procedure, see the AWS documentation.

Note

The root volume of a node is the volume shown as “Root device name” on the instance’s “Storage” tab in the EC2 console.

3.2.2.1.3. Step.1 Install mijin-init-tools (all nodes)

Download the published mijin-init-tools for the node’s architecture ( uname -m ), verify the checksum, and place it at /usr/local/bin/mijin-init-tools.
No AWS credentials are required.
$ VERSION=0.1.2
$ BASE=https://tools.catapult.mijin.io/mijin-init-tools/$VERSION
$ FILE=mijin-init-tools-linux-$(uname -m)
$ cd /tmp
$ curl -fsSLO "$BASE/$FILE"
$ curl -fsSLO "$BASE/$FILE.sha256"
$ sha256sum -c "$FILE.sha256"
mijin-init-tools-linux-x86_64: OK
$ sudo install -m 0755 -o root -g root "$FILE" /usr/local/bin/mijin-init-tools
$ rm -f "$FILE" "$FILE.sha256"
$ mijin-init-tools version

Warning

If sha256sum -c does not print OK, do not install the file; stop the work and contact support.

3.2.2.1.4. Step.2 Create the configuration file (all nodes)

Create the mijin-init-tools configuration file /etc/mijin/init.yml from the settings used when the stack was created (the cfn-init metadata).
$ sudo mijin-init-tools import-config
The command compares the metadata values with the values in the configuration files actually deployed on the node, and writes /etc/mijin/init.yml if there are no differences. The written content is displayed, so check that the hosts ( api_hosts, peer_hosts ) and the shared data storage location ( share_mode ) match the stack settings.
The version is always written as v100311, as in catapult_version: v10039 -> v100311 (written).

Warning

Run import-config on all nodes and confirm that there are no differences on any of them before proceeding to Step.3. If a difference is found on another node after you have started upgrading, the work stops with old and new nodes mixed.
If there are differences, error: the settings in the metadata do not match the configs deployed on this node is displayed followed by the differing values, and init.yml is not written. This happens, for example, when the stack parameters were changed later. Do not write init.yml by hand to proceed; contact support.

3.2.2.1.5. Step.3 Decide the fork height

Check the current block height with height in /chain/info, and decide the fork height N with the following formula. Use the same N on all nodes.
N = 今のブロック高 + (ノード数 × 1 台あたりの作業時間 ÷ ブロック生成時間) + 十分な余裕
For example, if you upgrade 5 nodes at 20 minutes per node and the block generation time is 15 seconds, take 5 × 1200 seconds ÷ 15 seconds = 400 blocks and add enough margin to finish in time even if checks take longer.
When upgrading from 1.0.3.6 through 1.0.3.8, operations that use aggregate transactions fail between the upgrade and the fork height, so do not leave too much margin.

Note

The height can also be written with ' separators, as in 5'405'000.
This height applies only to the new fork; the heights of earlier forks do not change.

3.2.2.1.6. Step.4 Upgrade (one node at a time)

Run it on one node at a time, starting from api1.
$ sudo mijin-init-tools upgrade --fork-height <N>
upgrade installs the packages, updates the configuration files, upgrades the MongoDB data (on api nodes), changes the file ownership, and restarts the node.
The upgrade is complete when [upgrade] done is displayed at the end.

Output

Meaning

fork heights from ...

The fork heights decided. From the second node on, the height recorded by the first node is used (even if --fork-height is passed, fork_height ignored is displayed and the value is not used)

[upgrade] mongo featureCompatibilityVersion -> 6.0 (mongo:6.0.26)

The MongoDB data is being upgraded one step at a time (when upgrading from 1.0.3.6)

finalization moved to round (E, P)

This node has returned to voting and finalization has advanced. You may proceed to the next node

Warning

On voting nodes, upgrade finally waits up to 10 minutes for finalization to advance. If it does not advance, it displays finalization did not move and exits with an error. The upgrade itself is complete, but do not proceed to the next node. Check whether any other voting node has stopped; if one has, fix it by following When mijin Catapult(v.2) Finalization Stops before proceeding.
If an error occurs midway, note the displayed error: line and contact support without proceeding to the next node. Running the same command again resumes from where it stopped.
After each node, confirm that the node is synchronized before proceeding to the next one. With /mijin/peersinfo you can check that the block heights and finalized heights of all nodes match.
$ curl -s http://localhost:3000/mijin/peersinfo | jq -r '.[] | [.host, .height, .latestFinalizedBlock.height] | @tsv'
peer1.mijin.internal    558     528
peer2.mijin.internal    558     528
api1.mijin.internal     558     528

3.2.2.1.7. Step.5 Confirm that the fork height has been passed

After all nodes have been upgraded, confirm that blocks and finalization continue to advance after the chain passes the fork height.
You can check the aggregate transaction version with transactionVersions in /mijin/forks. After the fork height, current becomes [3].
$ curl -s http://localhost:3000/mijin/forks | jq .transactionVersions

3.2.2.2. Upgrading to 1.0.3.9 or earlier

This is the procedure for upgrading by updating the docker container version.

Warning

Synchronization may fail if there is a major version upgrade or version differences.

Note

These steps assume Docker Compose v2 ( docker compose ). In environments running Compose v1, such as the free edition image, read it as docker-compose (with a hyphen). Note that the output format of the commands may differ depending on the Compose version.

3.2.2.2.1. Step.1

Remote login to the node.
If you want to log in to AWS MarketPlace’s mijin Catapult(v.2), you can use mijin Catapult(v.2) EC2 instance login how to.

3.2.2.2.2. Step.2

Switch to the ‘catapult’ user running mijin.

$ sudo su - catapult
catapult@api1:~$

3.2.2.2.3. Step.3

Go to the directory where the mijin startup files are located.
Note that the directories are different for API and PEER nodes.

Node

Directories

API/Dual

mijin-catapult-package/package/api/catapult/

PEER

mijin-catapult-package/package/peer/catapult/

For API nodes, move as follows

catapult@api1:~$ cd mijin-catapult-package/package/api/catapult/
catapult@api1:~/mijin-catapult-package/package/api/catapult$

3.2.2.2.4. Step.4

Mijin launches multiple containers by docker.
Check multiple containers.

3.2.2.2.4.1. For API nodes

Four containers are running. Make sure that all States are Up. If there is something wrong, the state will be Exit instead of Up and you will be in a down state.

catapult@api1:~/mijin-catapult-package/package/api/catapult$ docker compose ps
          Name                         Command               State           Ports
--------------------------------------------------------------------------------------------
catapult_api-node-broker_1   bash -c /bin/bash /scripts ...   Up
catapult_api-node_1          bash -c perl /scripts/wait ...   Up      0.0.0.0:7900->7900/tcp
catapult_db_1                docker-entrypoint.sh bash  ...   Up      27017/tcp
catapult_rest-gateway_1      docker-entrypoint.sh ash - ...   Up      0.0.0.0:3000->3000/tcp

3.2.2.2.4.2. For PEER node

One container is activated.
Make sure that all States are Up.
If there is some abnormality, it will be Exit instead of Up and will be in a down state.
catapult@peer1:~/mijin-catapult-package/package/peer/catapult$ docker compose ps
        Name                      Command               State           Ports
--------------------------------------------------------------------------------------
catapult_peer-node_1   bash -c /bin/bash /scripts ...   Up      0.0.0.0:7900->7900/tcp

3.2.2.2.5. Step.5

Stop all mijin containers using Docker Compose.

3.2.2.2.5.1. All containers stopped

catapult@api1:~/mijin-catapult-package/package/api/catapult$ docker compose down
Stopping catapult_rest-gateway_1 ... done
Stopping catapult_api-node_1     ... done
Stopping catapult_db_1           ... done
Removing catapult_api-node-broker_1 ... done
Removing catapult_rest-gateway_1    ... done
Removing catapult_api-node_1        ... done
Removing catapult_db_1              ... done
Removing network catapult_default

3.2.2.2.5.2. After stopping, check the lock file and delete it if any.

catapult@api1:~/mijin-catapult-package/package/api/catapult$ ls -la /mnt/mijin/blocks/data/*.lock
---------- 1 catapult catapult 0 Jul 14 02:17 /mnt/mijin/blocks/data/broker.lock
---------- 1 catapult catapult 0 Jul 14 02:17 /mnt/mijin/blocks/data/server.lock
If a lock file exists after the stop as shown above, it is considered to have stopped abnormally.
Therefore, delete the lock file.
$ rm -rf /mnt/mijin/blocks/data/broker.lock /mnt/mijin/blocks/data/server.lock

3.2.2.2.6. Step.6

Modify docker-compose.yml.
As an example, we will replace 1.0.0.0 with 1.0.0.1.
catapult@api1:~/mijin-catapult-package/package/api/catapult$ sed -i -e s/gcc-1.0.0.0/gcc-1.0.0.1/g docker-compose.yml

Note

Config file may need to be modified.
The procedure will be made available at the time of the upgrade announcement. (No version as of 9/20/20/2022)

3.2.2.2.7. Step.7

catapult@api1:~/mijin-catapult-package/package/api/catapult$ docker compose up -d
Creating network "catapult_default" with the default driver
Creating catapult_db_1 ... done
Creating catapult_rest-gateway_1    ... done
Creating catapult_api-node-broker_1 ... done
Creating catapult_api-node_1        ... done
After startup, execute the items in Step.4 and make sure all containers are Up.