CorDapp Standard Development Environment (CSDE)

The CorDapp Standard Development Environment (CSDE) makes the process of prototyping CorDapps on Beta 2 more straight-forward. The CSDE is obtained by cloning our CSDE-cordapp-template-kotlin or CSDE-cordapp-template-java repository to your local machine. The CSDE provides:

  • a prepared CorDapp project that you can use as a starting point to develop your own prototypes.
  • a base Gradle configuration that brings in the dependencies you need to write and test a Corda 5 CorDapp.
  • a set of Gradle helper tasks which speed up and simplify the development and deployment process; these are effectively wrappers over the Corda CLI.
  • debug configuration for debugging a local Corda cluster.
  • the MyFirstFlow code which forms the basis of the Getting Started documentation.
  • the utxoexample Chat CorDapp, which provides a basic, working UTXO Ledger CorDapp.
  • the ability to configure the members of the local Corda network.

Downloading the CSDE

  1. To obtain the CSDE template, clone the CSDE-cordapp-template-kotlin repository or CSDE-cordapp-template-java repository:

    git clone https://github.com/corda/CSDE-cordapp-template-kotlin.git <local-folder>
    
    git clone https://github.com/corda/CSDE-cordapp-template-java.git <local-folder>
    
  2. Change to the new folder and checkout the Beta 2 branch:

    git checkout release/corda-5-beta-2
    
  3. Initialise the git repo and change the remote so you do not inadvertently push your work back to our R3 repo.

  4. Open the project in IntelliJ and let the import process complete. When complete, the project structure looks as follows:

CSDE project in IntelliJ
CSDE project

Configuring the CSDE

The CSDE includes Gradle tasks to manage a local deployment of Corda. These Gradle tasks require Java Azul Zulu 11. To configure IntelliJ to use the correct Java version for Gradle, set Gradle JVM to Project SDK 11, as follows:

JVM version in IntelliJ for CSDE project
Gradle Java version

CSDE Overview

This section provides an overview of the content of CSDE. Other sections show you how to use it in the process of writing a CorDapp.

Project Structure

On the left, you can see the folder structure created, ready for CorDapps development.

CSDE folders in IntelliJ
CSDE folder structure

For Kotlin, write your flow code in workflows/src/main/kotlin/<your package path> and your contract and states code in /contracts/src/main/kotlin<your package path>.

For Java, use workflows/src/main/java/<your package path> and your contract and states code in /contracts/src/main/kotlin<your package path>.

For test code, use the corresponding test folder.

Gradle Helpers for the Combined Worker

On the right, you can see the Gradle tasks that we have included to help you work with a local deployment of Corda using the combined worker:

CSDE gradle tasks in IntelliJ
CSDE gradle helpers
The combined worker is a Corda cluster that runs all of the workers in one JVM process.

The helpers are split into three folders:

csde-corda

These tasks help with the lifecycle of your local Corda cluster.

Helper
Description
startCorda1. Downloads a copy of the combined worker JAR, if required.
2. Starts an instance of a Postgres Docker container. You will need Docker Engine or Docker Desktop running.
3. Starts the combined worker. The Combined Worker will continue to run in a ‘Run’ Console until it is shut down.
Note, Corda takes about one minute to start up. It is best to poll the cluster with one of the csde-query helpers until it responds to confirm if the cluster is live and ready to interact.
stopCorda1. Stops the Postgres database.
2. Stops the combined worker.

csde-cordapp

Helper
Description
1-createGroupPolicyCreates the Group policy which is required to set up the Application Network.
2-createKeyStoreCreates the signing keys for publishing the CPIs.
3-buildCPIsBuilds your CorDapp and wraps it in a signed CPI.
4-deployCPIsDeploys the CPI to your local Corda cluster. If the CPI has already been deployed to the nodes on the cluster, this task performs a forced upload and replaces the old CPI with the new one.
5-vNodeSetupSets up the Virtual Nodes specified in config/static-network-config.json on you local Corda cluster with the uploaded CPI.

Each of these tasks has a dependency on the previous. So, if you run 3, it also runs 1 and 2.

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.