Skip to content

Upgrading to Contour 7.0

This guide is for upgrading from Contour v6.1 to Contour v7.0, with assumption that Contour v6.1 is running on the recommended Corda Enterprise version (CE4.6).

Contour releases strive to be backwards compatible, and use Liquibase for the Database schema versioning. With Corda Enterprise and Springboot supporting Liquibase, upgrading a Contour node is fairly straightforward.

  • Corda Open Source (OS) doesn't support Liquibase. Therefore, if a node is running on Corda OS, the nodes needs to be upgraded to CE first, before upgrading Contour version.

Note: If you are using Corda Firewall with the node, it's recommended to upgrade it to Corda Firewall 4.8.1 (Available in the package /Corda Enterprise 4.8.1/corda-firewall/4.8.1) together with Contour 7.0 upgrade. There is no config change required if upgrade from Corda Firewall 4.* to 4.8.1.

Upgrading Contour consistis of the following steps:

  • Stop the node
  • [IMPORTANT] Back up the node directories AND database
  • Upgrade Corda Enterprise and Contour Cordapps
  • Upgrade Contour Web Apps

Step 1. Stop the node

Stop the node in the sequence that:

  1. Stop the Contour Web Application, e.g. systemctl stop contour.service if using systemd
  2. Drain the Corda node
    • Connect to the Corda Shell using the command ssh -p [sshd portNumber] [rpc username]@[host, e.g. localhost]
      • e.g. ssh -p 2222 cordau@localhost
    • Key in rpc userpassword as specified in the Corda node.conf
    • Run the command run setFlowsDrainingModeEnabled enabled: true to do a flow drain
    • Run the command run stateMachinesSnapshot to check that there is no in-flight flows
      • If the result is empty list [], it means all flows have completed, proceed to stop the Corda node
      • If the result is not an empty list, which means there are some in-flight flows as listed in the result, wait until these flows complete, and/or investigate why they are stuck and whether safe to kill.
  3. Once all flows have completed, stop the Corda node, e.g. systemctl stop corda.service if using systemd

Step 2. Backup the node

[IMPORTANT] Any upgrade, especially database schema migration, come with risk. Thus, it's very important that the node is back up before upgrading. With backup, a node can be restored fairly easily.

  1. Backup the Contour Web App folder directory, e.g. cp -R api-service/ api-service-<version>-backup/;
  2. Backup the Corda folder directory, e.g. cp -R corda/ corda-<version>-backup/;
  3. Backup the Contour Web App database and Corda database, Backup recommendations.

Reference to restore a corda node: Backup and restoration of a Corda node

Step 3. Upgrade Corda Enterprise and Contour Cordapps

Contour v7.0 runs on Corda Enterprise (CE) 4.8.1, upgraded from Corda Enterprise (CE) 4.6.1 used in Contour v6.1.

3.1. Replace Corda Jar

Under the corda directory, e.g. /opt/corda: 1. Delete the Corda Enterprise 4.6.1 jar, e.g. rm corda-4.6.1.jar 1. Copy & paste in Corda Enterprise 4.8.1 jar from Contour release package, contour-<version>/corda/corda-4.8.1.jar

3.2. Replace Cordapps Jars

Under the corda > cordapps directory, e.g. /opt/corda/cordapps:

  1. Delete the old version jars
    • All the Flow jars: rm contour-cordapp-<oldversion>.jar
    • All the Contracts and States jar: rm contour-cordapp-contracts-and-states-<oldversion>.jar
  2. Copy & paste in all the new version jars from Contour release package, contour-<version>/corda/cordapps/.
    • All the Flow jars:
      • contour-cordapp-<newversion>.jar
      • contour-business-tools-<newversion>.jar
      • corda-tools-metering-collector-<newversion>.jar
    • All the Contracts and States jar: contour-cordapp-contracts-and-states-<newversion>.jar

3.3. Update Cordapp config

The following two (2) flow jars require configurations:

  • contour-cordapp-<newversion>.jar
  • corda-tools-metering-collector-<newversion>.jar

Corda will automaticially match each flow jar to its configuration under the corda > cordapps > config directory (e.g. /opt/corda/cordapps/config), based on the flow jar name. Therefore, the configuration files must be named correctly, matching to the flow jar name. i.e.

  • contour-cordapp-<newversion>.conf for contour-cordapp-<newversion>.jar
  • corda-tools-metering-collector-<newversion>.conf for corda-tools-metering-collector-<newversion>.jar

Therefore, the steps to update the configuration will be:

  1. Rename the config file name for flow jar contour-cordapp-<newversion>.jar to match the new version, i.e. from contour-cordapp-<oldversion>.conf to contour-cordapp-7.0.0.conf.
    • No change in the contour-cordapp-<version>.conf in v7.0.0 required, compared to v6.1.0.
    • Refer to Contour Corda Config for more details about the configuration parameters
  2. No change for config file name for flow jar corda-tools-metering-collector-<version>.jar
    • No change in the contour-cordapp-<version>.conf in v7.0.0 required, compared to v6.1.0.
    • Refer to Contour Corda Config for more details about the configuration parameters

3.4. Update the database

Start the node with the run-migration-scripts sub-command with --core-schemas and --app-schemas.

  • Command: java -jar corda-4.8.1.jar run-migration-scripts --core-schemas --app-schemas

The node will perform any automatic data migrations required, which may take some time. If the migration process is interrupted it can be continued simply by starting the node again, without harm. The node will stop automatically when migration is complete.

3.5. Start Corda in the normal way

Start the Corda in the normal way, e.g.

  • java -jar corda-4.8.1.jar --base-directory /opt/corda --config-file /opt/corda/node.conf; or
  • systemctl start corda.service if using systemd

3.6. Undrain the node

You may now do any checks that you wish to perform, read the logs, and so on. When you are ready, use this command at the Corda shell: run setFlowsDrainingModeEnabled enabled: false

Step 4. Upgrade Contour WebApp

4.1. Replace Web App

Under the contour webapp directory, e.g. /opt/api-services:

  1. Delete the old version jar and static asset
    • Sprint Boot jar: rm contour-service-<oldversion>.jar; and
    • Static asset folder: rm -rf static/
  2. Copy & paste in the new version of Contour web app jar and static asset folder from Contour release package, contour-<version>/api-service/
    • Sprint Boot jar: contour-service-<newversion>.jar and
    • Static asset folder: static/

4.2. Update WebApp configuration

Update the Contour Web APP (Spring Boot) configuration (if necessary)

  • No config changes required when upgrading from 6.1 to 7.0.
  • Refer to Contour WebApp Config for more details about the configuration parameters

4.3. Start Contour Web App

Start the Contour web app as normal, e.g.

  • java -jar contour-service-<newversion>.jar -Dspring.profiles.active=local,CentralPortal,hascorda,prod,auth; or
  • systemctl start contour.service if using systemd

Spring Boot will handle the Liquibase database schema migration.