Adding cordapps to R3 Corda network¶
1. Adding directly from build directory¶
Pre-requisites:¶
R3 Corda network deployed and network.yaml configuration file already set.
Build CorDapp jars¶
Build the CorDapp jars. If you have multiple jars, place them in a single location e.g. at path/to/cordapp-jars
.
Run playbook¶
The playbook deploy-cordapps.yaml is used to deploy cordapps over the existing R3 Corda network. This can be done manually using the following command
ansible-playbook platforms/r3-corda/configuration/deploy-cordapps.yaml -e "@path-to-network.yaml" -e "source_dir='path/to/cordapp-jars'"
2. Adding from a nexus repository¶
Pre-requisites:¶
Build the CorDapp jars. If you have multiple jars, place them in a single location e.g. at path/to/cordapp-jars
.
Publishing the CorDapp jars to the nexus repository.
In order to publish the jars add the following information in example\supplychain-app\corda\gradle.properties
file
# Repository URL e.g : https://alm.accenture.com/nexus/repository/AccentureBlockchainFulcrum_Release/
repoURI=nexus_repository_url
# Repository credentials
repoUser=repository_user_name
repoPassword=repository_user_password
example\supplychain-app\corda\build.gradle
file, change this file only if you need to add or remove jars other that the ones mentioned below
publishing{
publications {
maven1(MavenPublication) {
artifactId = 'cordapp-supply-chain'
artifact('build/cordapp-supply-chain-0.1.jar')
}
maven2(MavenPublication) {
artifactId = 'cordapp-contracts-states'
artifact('build/cordapp-contracts-states-0.1.jar')
}
}
repositories {
maven {
url project.repoURI
credentials {
username project.repoUser
password project.repoPassword
}
}
}
}
Example given in the sample configuration file
platforms/r3-corda/configuration/samples/network-cordav2.yaml
The snapshot from the sample configuration file with the example values is below
# Cordapps Repository details (optional use if cordapps jar are store in a repository)
cordapps:
jars:
- jar:
# e.g https://alm.accenture.com/nexus/repository/AccentureBlockchainFulcrum_Release/com/supplychain/bcc/cordapp-supply-chain/0.1/cordapp-supply-chain-0.1.jar
url:
- jar:
# e.g https://alm.accenture.com/nexus/repository/AccentureBlockchainFulcrum_Release/com/supplychain/bcc/cordapp-contracts-states/0.1/cordapp-contracts-states-0.1.jar
url:
username: "cordapps_repository_username"
password: "cordapps_repository_password"
Adding the jars by deploying the network¶
After the configuration file is updated and saved, run the following command from the bevel folder to deploy your network.
This will deploy the network and add the cordapps.