Auto generation Tool to build Corda Distributed Applications using Semantic Knowledge Bases.
The Code Generator needs to point to a database containing the triple statements from which to generate the CorDapp classes. We recommend using a database that has RDF* and SPARQL* enabled, such as Stardog: Set Up Stardog
Sample Knowledge bases can be found at Sample Knowledge Bases
- IOU Contract
- Clinical Trial Patient
- Car Registration
To generate the classes we replace the database URL in src/main/java/queryDB/QueryDB.java -> dbUrl
which the RDF* and SPARQL* database
Then we run the main class in src/main/java/compilers/MainGenerator.java
.
Once the files have been generated you should find them at the `` folder. To simulate a Corda network locally and test the CorDapp, clone the following Corda Network Template Repo.
Continue to place state and contract classes in relevant folders. cordapp-template-java/contracts/src/main/java/com/template/states
and cordapp-template-java/contracts/src/main/java/com/template/contracts
.
Then place the Flow classes in cordapp-template-java/workflows/src/main/java/com/template/flows
to run the network
- Clean build the project
$ ./gradlew clean deployNodes
- Deploy Nodes in a non-IDE terminal (its going ot open multiple tabs for each node in network)
$ build/nodes/runnodes
If you get stuff you should be able to find more step by step solutions here Running a CorDapp.
# Issue $1000 Cash to node
$ flow start net.corda.finance.flows.CashIssueFlow amount: "$1000", issuerBankPartyRef: "00", notary: "O=Notary,L=London,C=GB"
# Issue and IOU of $10 with PartyA as Borrower (Execute in PartyB terminal)
$ start IssueFlow$Initiator amount: $10, lender: "O=PartyB,L=New York,C=US", borrower: "O=PartyA,L=London,C=GB" , externalId: "1234"
# Query Nodes Vault for IOUState
$ run vaultQuery contractStateType: com.template.states.IOUState
$ run vaultQuery contractStateType: com.template.states.<anyState defined in CorDapp>
# Settle IOU with linearId
$ flow start SettleFlow$Initiator linearId: "<get linearId from vault>", amount: "$10”, lender: "O=PartyB,L=New York,C=US"