Upgrading a CorDapp to Corda Enterprise Edition 4.11
Upgrading from Corda Community Edition
Before upgrading to Corda Enterprise Edition 4.11, upgrade your CorDapp to Corda Community Edition 4.11. See Upgrading CorDapps to newer platform versions for detailed instructions.
You don’t need to re-compile your CorDapp to Corda Enterprise for it to run on Corda Enterprise. If you want your CorDapp to be compatible with nodes running open source, then compile it against Corda Community Edition (formerly Open Source) 4.x. However, if you want to leverage specific features of Corda Enterprise, such as third-party commercial database support, and don’t envisage your CorDapp being run in an open source production environment, then follow the re-compiling for Corda Enterprise Edition 4.11 guide.
Re-compiling for Corda Enterprise Edition 4.11
To re-compile your CorDapp for Corda Enterprise Edition 4.11, you need to:
Update your Gradle build file as follows.
corda_release_distribution = 'com.r3.corda' corda_core_release_distribution = 'net.corda' corda_release_version = '4.11' corda_core_release_version = '4.11' corda_gradle_plugins_version = '5.0.12' kotlin_version = '1.2.71' quasar_version = '0.7.16_r3'
Specify an additional repository entry pointing to the location of the Corda Enterprise distribution and Corda dependencies. Any dependencies on
corda-core
and/orcorda-serialization
must use thecorda_core_release_distribution
andcorda_core_release_version
. As Corda is moving to an open core model, these core APIs are only available in open source and need to be imported from there. Therefore, a repository entry pointing to a matching Corda Community Edition version is required.Update your
quasar.jar
file. If your project is based on one of the official CordApp templates, you’ll likely have alib/quasar.jar
file checked in. You’ll only use this if you use the JUnit runner in IntelliJ. In the latest release of the CorDapp templates, this directory has been removed.For example:
repositories { // Example for Corda Enterprise maven { credentials { username "username" password "XXXXX" } url 'https://artifactory.mycompany.com/artifactory/corda-enterprise' } // Dependency on Corda Community Edition maven { url 'https://download.corda.net/maven/corda-releases' } maven { url 'https://download.corda.net/maven/corda-dependencies' } // Corda dependencies for the patched Quasar version maven { url "https://download.corda.net/maven/corda-dependencies" } // access to the patched Quasar version }
You can do either of the following:
- Upgrade your
quasar.jar
file to the version consistent with your Corda version. - Delete your
lib
directory and switch to using the Gradle test runner.
You can find instructions for both options in Running tests in IntelliJ.
- Upgrade your
Check you’re using Corda Gradle plugins version 5.0.12, and that Corda Enterprise dependencies are referenced with the right distribution.
For example:
cordaCompile "net.corda:corda-core:$corda_release_version" testCompile "net.corda:corda-node-driver:$corda_release_version"
Becomes:
cordaCompile "$corda_core_release_distribution:corda-core:$corda_core_release_version" // core depends on open source testCompile "$corda_release_distribution:corda-node-driver:$corda_release_version" // node based tests from Enterprise
Corda Enterprise Edition 4.11 binaries are not publicly available. To make the dependencies available for development, either create a mirror repository and upload them there, or add them to your local Maven repository.
You can request a copy of the Corda Enterprise Developer Pack (contains a Maven repository mirror of all Corda Enterprise artifacts and their dependencies) from your R3 support contact.
Version 4 of the finance CorDapp is split into the following two signed JAR files:
corda-finance-contracts.jar
corda-finance-workflows.jar
As there should only be one unique hashed version of corda-finance-contracts.jar
(the hash of a contract JAR file undergoes strict
security checking upon transaction resolution), only a single instance of corda-finance-contracts.jar
is published, and this is from the open source repository.
Please ensure any CorDapps that depend on corda-finance-contracts.jar
reference this open source dependency as follows:
cordapp "$os_corda_release_distribution:corda-finance-contracts:$os_corda_release_version"
Where:
- ext.os_corda_release_distribution = ’net.corda'.
- ext.os_corda_release_version = ‘4.0’.
Upgrading from Enterprise 4.3 or earlier
Corda Enterprise Edition 4.4 moved towards an open core strategy. Therefore, the common APIs are only available in Corda
open source, and Corda Enterprise has a binary dependency on the matching open source version. As a result, any CorDapps written against
Corda Enterprise Edition 4.4 or later will have to depend on the open source version of corda-core
.
Therefore, you have to add the following variables to your build configuration:
ext.corda_core_release_distribution = 'net.corda'
ext.corda_core_release_version = '4.11'
Any dependency on corda-core
(or corda-serialization
) has to use these new variables to depend on the open source version of those
libraries, as follows:
cordaCompile "$corda_release_distribution:corda-core:$corda_release_version"
Becomes:
cordaCompile "$ext.corda_core_release_distribution:corda-core:$ext.corda_core_release_version"
Upgrading from Corda Enterprise 3.x
You can only upgrade to Corda Enterprise Edition 4.11 from a previous 4.x version. To upgrade from 3.x, first upgrade to 4.x and then to 4.11. For example, 3.3 to 4.5, and then 4.5 to 4.11.
Was this page helpful?
Thanks for your feedback!
Chat with us
Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.
Propose documentation improvements directly
Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.
We're sorry this page wasn't helpful. Let us know how we can make it better!
Chat with us
Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.
Create an issue
Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.
Propose documentation improvements directly
Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.