Giter Site home page Giter Site logo

cordaontog's Introduction

CordaOntoG

Auto generation Tool to build Corda Distributed Applications using Semantic Knowledge Bases.

Set Up Database!

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

Generate Classes

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.

Run CorDapp

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.

Place Generated Files

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

Running network

to run the network

  1. Clean build the project
    $ ./gradlew clean deployNodes
  2. 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.

Sample Commands for Example Flows

# 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"

cordaontog's People

Contributors

quzair avatar

Stargazers

Manos Batsis avatar

Watchers

 avatar

Forkers

dgraux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.