Upgrading previous template based apps to 4.3
With the Corda 4.3 release we’ve also improved the Gradle toolchain around it. If you’re starting a new app today you’re not affected by this change as you’re getting the already updated code.
However if you’ve created a corDapp based on the previous versions of the cordapp-template-java or cordapp-template-kotlin, or started from the hello world app in our getting started guide, you’ll have to make some changes to upgrade to 4.3.
We’ll walk you through this process using the 4.1 version of the cordapp-template-java template.
Step 1: Code changes in build.gradle
- corda_release_version: signifies the Corda version the corDapp will use.
- corda_gradle_plugins_version: tells the which version of R3’s gradle plugin toolset the build process will use.
- corda_platform_version: indicates which platform version the corDapp will build to.
Note ⚠️: the corda_platform_version will always need to be the same or lower than the node’s platform version. The node platform version can be found by checking the nodeInfo in side the node’s running shell by typing:
The node will refuse to load any corDapp that is compiled against any higher platform version than the node’s current platform version. We will use this principle to test out version upgrade at the end.
Step 2: Upgrade the gradle download url in the gradle wrapper (Locate at gradle/wrapper/gradle-wrapper.properties):
New url: https://services.gradle.org/distributions/gradle-5.4.1-all.zip
This will download the compatible Gradle version for the build process.
Step3: Checking the updates
We can check whether our corDapp had updated to the desired version (in this case, 4.3) by starting the node up again. We should be able to see the desired version of Corda in node start-up shell. And the node should also load the corDapp during initiation.
As for now, we had successfully upgrade our corDapp to a desired version of Corda.
Thank you for reading and being part of this journey!
We’d love to hear about your experiences and answer any questions you have in our public slack channel: http://slack.corda.net/