2017-11-01 11:34:59 +00:00
|
|
|
|
Hello, World!
|
|
|
|
|
=============
|
|
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
:maxdepth: 1
|
|
|
|
|
|
|
|
|
|
hello-world-template
|
|
|
|
|
hello-world-state
|
|
|
|
|
hello-world-flow
|
|
|
|
|
hello-world-running
|
2017-06-16 13:05:52 +00:00
|
|
|
|
|
|
|
|
|
By this point, :doc:`your dev environment should be set up <getting-set-up>`, you've run
|
|
|
|
|
:doc:`your first CorDapp <tutorial-cordapp>`, and you're familiar with Corda's :doc:`key concepts <key-concepts>`. What
|
|
|
|
|
comes next?
|
|
|
|
|
|
2017-11-01 11:34:59 +00:00
|
|
|
|
If you're a developer, the next step is to write your own CorDapp. CorDapps are plugins that are installed on one or
|
|
|
|
|
more Corda nodes, and give the nodes' owners the ability to make their node conduct some new process - anything from
|
2017-06-16 13:05:52 +00:00
|
|
|
|
issuing a debt instrument to making a restaurant booking.
|
|
|
|
|
|
|
|
|
|
Our use-case
|
|
|
|
|
------------
|
2017-11-01 11:34:59 +00:00
|
|
|
|
Our CorDapp will model IOUs on-ledger. An IOU – short for “I O(we) (yo)U” – records the fact that one person owes
|
|
|
|
|
another person a given amount of money. Clearly this is sensitive information that we'd only want to communicate on
|
|
|
|
|
a need-to-know basis between the lender and the borrower. Fortunately, this is one of the areas where Corda excels.
|
|
|
|
|
Corda makes it easy to allow a small set of parties to agree on a shared fact without needing to share this fact with
|
|
|
|
|
everyone else on the network, as is the norm in blockchain platforms.
|
2017-06-16 13:05:52 +00:00
|
|
|
|
|
2017-11-01 11:34:59 +00:00
|
|
|
|
To serve any useful function, our CorDapp will need at least two things:
|
2017-06-16 13:05:52 +00:00
|
|
|
|
|
2017-11-01 11:34:59 +00:00
|
|
|
|
* **States**, the shared facts that Corda nodes reach consensus over and are then stored on the ledger
|
|
|
|
|
* **Flows**, which encapsulate the procedure for carrying out a specific ledger update
|
2017-06-16 13:05:52 +00:00
|
|
|
|
|
2017-11-01 11:34:59 +00:00
|
|
|
|
Our IOU CorDapp is no exception. It will define both a state and a flow:
|
2017-06-16 13:05:52 +00:00
|
|
|
|
|
2017-11-01 11:34:59 +00:00
|
|
|
|
The IOUState
|
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
Our state will be the ``IOUState``. It will store the value of the IOU, as well as the identities of the lender and the
|
|
|
|
|
borrower. We can visualize ``IOUState`` as follows:
|
2017-06-16 13:05:52 +00:00
|
|
|
|
|
|
|
|
|
.. image:: resources/tutorial-state.png
|
|
|
|
|
:scale: 25%
|
|
|
|
|
:align: center
|
|
|
|
|
|
2017-11-01 11:34:59 +00:00
|
|
|
|
The IOUFlow
|
|
|
|
|
^^^^^^^^^^^
|
|
|
|
|
Our flow will be the ``IOUFlow``. This flow will completely automate the process of issuing a new IOU onto a ledger. It
|
|
|
|
|
is composed of the following steps:
|
2017-06-16 13:05:52 +00:00
|
|
|
|
|
2017-07-07 11:06:28 +00:00
|
|
|
|
.. image:: resources/simple-tutorial-flow.png
|
2017-06-16 13:05:52 +00:00
|
|
|
|
:scale: 25%
|
|
|
|
|
:align: center
|
|
|
|
|
|
2017-11-01 11:34:59 +00:00
|
|
|
|
In traditional distributed ledger systems, where all data is broadcast to every network participant, you don’t need to
|
|
|
|
|
think about data flows – you simply package up your ledger update and send it to everyone else on the network. But in
|
|
|
|
|
Corda, where privacy is a core focus, flows allow us to carefully control who sees what during the process of
|
|
|
|
|
agreeing a ledger update.
|
2017-06-16 13:05:52 +00:00
|
|
|
|
|
|
|
|
|
Progress so far
|
|
|
|
|
---------------
|
2017-11-01 11:34:59 +00:00
|
|
|
|
We've sketched out a simple CorDapp that will allow nodes to confidentially issue new IOUs onto a ledger.
|
2017-06-16 13:05:52 +00:00
|
|
|
|
|
2017-11-01 11:34:59 +00:00
|
|
|
|
Next, we'll be taking a look at the template project we'll be using as the basis for our CorDapp.
|