mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
Updates tutorial to match template changes. (#4170)
* Updates tutorial to match template changes. * Updates hello, world tutorials to match new template structures.
This commit is contained in:
parent
ecbf23ab73
commit
9c508673cf
@ -40,7 +40,7 @@ FlowLogic
|
||||
---------
|
||||
All flows must subclass ``FlowLogic``. You then define the steps taken by the flow by overriding ``FlowLogic.call``.
|
||||
|
||||
Let's define our ``IOUFlow`` in either ``TemplateFlow.java`` or ``App.kt``. Delete the two existing flows in the
|
||||
Let's define our ``IOUFlow`` in either ``Initiator.java`` or ``Flows.kt``. Delete the two existing flows in the
|
||||
template (``Initiator`` and ``Responder``), and replace them with the following:
|
||||
|
||||
.. container:: codeset
|
||||
@ -55,7 +55,7 @@ template (``Initiator`` and ``Responder``), and replace them with the following:
|
||||
:start-after: DOCSTART 01
|
||||
:end-before: DOCEND 01
|
||||
|
||||
If you're following along in Java, you'll also need to rename ``TemplateFlow.java`` to ``IOUFlow.java``. Let's walk
|
||||
If you're following along in Java, you'll also need to rename ``Initiator.java`` to ``IOUFlow.java``. Let's walk
|
||||
through this code step-by-step.
|
||||
|
||||
We've defined our own ``FlowLogic`` subclass that overrides ``FlowLogic.call``. ``FlowLogic.call`` has a return type
|
||||
|
@ -51,7 +51,7 @@ The template has a number of files, but we can ignore most of them. We will only
|
||||
cordapp-contracts-states/src/main/java/com/template/TemplateState.java
|
||||
|
||||
// 2. The flow
|
||||
cordapp/src/main/java/com/template/TemplateFlow.java
|
||||
cordapp/src/main/java/com/template/Initiator.java
|
||||
|
||||
.. code-block:: kotlin
|
||||
|
||||
@ -59,15 +59,7 @@ The template has a number of files, but we can ignore most of them. We will only
|
||||
cordapp-contracts-states/src/main/kotlin/com/template/StatesAndContracts.kt
|
||||
|
||||
// 2. The flow
|
||||
cordapp/src/main/kotlin/com/template/App.kt
|
||||
|
||||
Clean up
|
||||
--------
|
||||
To prevent build errors later on, we should delete the following files before we begin:
|
||||
|
||||
* Java: ``cordapp/src/main/java/com/template/TemplateClient.java``
|
||||
|
||||
* Kotlin: ``cordapp/src/main/kotlin/com/template/Client.kt``
|
||||
cordapp/src/main/kotlin/com/template/Flows.kt
|
||||
|
||||
Progress so far
|
||||
---------------
|
||||
|
@ -17,7 +17,7 @@ We'll do this by modifying the flow we wrote in the previous tutorial.
|
||||
|
||||
Verifying the transaction
|
||||
-------------------------
|
||||
In ``IOUFlow.java``/``App.kt``, change the imports block to the following:
|
||||
In ``IOUFlow.java``/``Flows.kt``, change the imports block to the following:
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user