April 17, 2020
Prepared By: Sonal Dhinoja
Reviewed By: Birender Saini and Rajapandian Chellimuthu
The article is part one of a series on building a CorDapp. It will take you through all you need to know to develop your first CorDapp (application built on Corda).
If you are completely new to Corda, I wrote a previous article on Linkedin that answers more questions about Corda as well.
And here is the other article, where I have tried to answer basic questions on a learning path for Corda. “How to Get started learning Corda: 10 Beginners FAQs“.
First, we need to ensure we have all the pre-requisites installed. Those are:
Java 8 JVK – We require at least version 8u171, but do not currently support Java 9 or higher.
IntelliJ IDEA – IntelliJ is an IDE that offers strong support for Kotlin and Java development. We support versions 2017.x, 2018.x and 2019.x (with Kotlin plugin version 1.2.71).
Git – Git to download the templates and push your CorDapp as a repository.
Gradle – Install Gradle version 5.4.1. If you are using a supported Corda sample, the included gradle script should install Gradle automatically.
BookMyStay is an online hotel booking service which allows its customer to book rooms online with HotelHeaven’s hotel chain. As per the agreement, BookMyStay collects certain information from its customers and sends it to HotelHeaven. HotelHeaven in return sends an acknowledgement to BookMyStay. So, here I demonstrate how to build an application ‘BookingCorDapp’ for BookMyStay.
There are two parties in BookingCorDapp.
BookMyStay will send the following details to HotelHeaven to book a stay as requested by the customer.
7 constraints should be met before sending booking details to HotelHeaven:
Let’s get our hands dirty: Now, let us create our CorDapp using The CorDapp Template. For that, we have to download the Corda template from GitHub and import into IntelliJ. The standard template can be downloaded from the below link:
Once the template is downloaded, open it in IntelliJ by following the instructions here:
The Gradle project contains 3 main modules:
Setup – CorDapp environment using build.gradle:
Define the Corda Network. Our Booking Application has two Parties and a Notary. We define this network configuration in the deployNodes task of the gradle build file. From PartyA and PartyB, we will change it to BookMyStay and HotelHeaven.
Now we have our platform ready and we are ready to code!
We will continue in the next article: “Steps to build BookingCorDapp “.
Share this post
July 01, 2020
June 29, 2020
Stay up to date on the latest news and articles related to Corda.