Obtaining the CorDapp Template

When writing a new CorDapp, you’ll generally want to start from one of the following standard templates:

The CorDapp templates provide the boilerplate for developing a new CorDapp. CorDapps can be written in either Java or Kotlin. Sample code is provided in both languages throughout this tutorial.

Note that there’s no need to download and install Corda itself. The required libraries are automatically downloaded from an online Maven repository and cached locally.

Downloading the template

Open a terminal window in the directory where you want to download the CorDapp template, and run the following command:

git clone https://github.com/corda/cordapp-template-kotlin.git
git clone https://github.com/corda/cordapp-template-java.git

Once you have cloned the repository you wish to use, navigate to the correct subdirectory:

cd cordapp-template-kotlin
cd cordapp-template-java

Opening the template in IntelliJ

Once you have successfully cloned the CorDapp template, open the cordapp-template-kotlin or cordapp-template-java in IntelliJ IDEA. See the documentation on Running a sample CorDapp if you are unsure of how to open a CorDapp in IntelliJ.

Template structure

For this tutorial, you will only be modifying the following files:

// 1. The state
contracts/src/main/kotlin/com/template/states/TemplateState.kt

// 2. The flow
workflows/src/main/kotlin/com/template/flows/Flows.kt
// 1. The state
contracts/src/main/java/com/template/states/TemplateState.java

// 2. The flow
workflows/src/main/java/com/template/flows/Initiator.java

Progress so far

You now have a template that you can build upon to define your IOU CorDapp. Let’s start by defining the IOUState.

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.