This article will take you through all you need to know before you have your first corDapp up and running. I have divided three steps into three different articles, and this is the first article describing the first step. Soon, I will publish the next steps in my upcoming articles.
If you are completely new to Corda then please refer my previous articles to understand what Corda is and use cases of Corda. So, you will get the answer to all your questions about Corda. Below is the link to the article.
And here is the other article, where I have tried to answer basic questions that arise on a learning path of Corda.
First, we need to ensure we have all the prerequisites are installed, which 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 of 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 online hotel booking services which allow its customer to book rooms online on HotelHeaven’s hotel chain. As per the agreement, BookMyStay collects certain information from its customer and sends it to HotelHeaven, HotelHeaven in return sends an acknowledgment to BookMyStay. So, here we are building an application BookingCorDapp for BookMyStay.
There are two parties in BookingCorDapp.
1. BookMyStay
2. HotelHeaven
BookMyStay will send the following details to HotelHeaven to book a stay as requested by their customer.
7 constraints should be met before sending booking detail to HotelHeaven:
1. Customer Age should be greater than 18.
2. Check-in and Check-Out date Should be Future Date.
3. The check-out date should be greater than a check-in date.
4. Room Type format is from this only: K, NK, DD, NDD
5. After commission price should 85% of Original room price.
6. The credit card number length should be 16.
7. Credit Card Exp date should not be in the past.
Let’s get our hands dirty: Now let us create our CorDapp using The CorDapp Template. For that, we have to download corda template from GitHub and import it into IntelliJ. The standard template can be downloaded from the below link:
Once the template is download, open it in IntelliJ by following the instructions here:
The Gradle project contains 3 main modules like in a bellow figure:
1. Contracts: It defines the contractual validity of the CorDapp. You can read more about it here. States are created in the same module, The actual information stored in the ledger.
2. Workflows: The flows enable automated agreeing to the ledger states. Detailed documentation can be found on the Corda website.
3. Clients: The client defines classes that can be used to interact with the CorDapp in a production environment.
Setup – CorDapp environment using build.gradle:
Define the Corda Network. Our Booking Application has two Parties and a Notary. So we define this network configuration in the deploy nodes task of the Gradle build file. From PartyA and PartyB, we will change it to BookMyStay and HotelHeaven.
Until now we have our platform ready, we are ready to code…
We will continue in the next article: “Steps to build BookingCorDapp “.
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular