testing changes batch

Signed-off-by: Ed Prosser <edward.prosser@r3.com>
This commit is contained in:
Ed Prosser 2019-07-02 14:43:17 +01:00 committed by Mike Hearn
parent a5ad24fc00
commit e3e16c0f52
2 changed files with 65 additions and 65 deletions

View File

@ -25,7 +25,7 @@ The first thing you need to do is clone a CorDapp template to modify.
Step Two: Creating states
-------------------------
Since the CorDapp models a car dealership network, a state must be created to represent cars.
Since the CorDapp models a car dealership network, a state must be created to represent cars. States are immutable objects representing on-ledger facts. A state might represent a physical asset like a car, or an intangible asset or agreement like an IOU. For more information on states, see the `state documentation <./key-concepts-states.html>`_.
1. From IntelliJ expand the source files and navigate to ``contracts > src > main > kotlin > com.template > states > TemplateState.kt``.
@ -46,13 +46,15 @@ Since the CorDapp models a car dealership network, a state must be created to re
* ``dealershipLocation`` of type ``String``
* ``linearId`` of type ``UniqueIdentifier``
Don't worry if you're not sure exactly how these should appear, you can check your code shortly.
5. Remove the ``data`` and ``participants`` parameters.
6. Add a body to the ``CarState`` class that overrides participants to contain a list of ``owningBank``, ``holdingDealer``, and ``manufacturer``.
7. The ``CarState`` file should now appear as follows:
.. container:: codeset
.. container:: codeset
.. sourcecode:: kotlin
@ -71,7 +73,7 @@ Since the CorDapp models a car dealership network, a state must be created to re
8. Save the ``CarState.kt`` file.
The ``CarState`` definition has now been created. It lists the properties required of all instances of this state and their types.
The ``CarState`` definition has now been created. It lists the properties and associated types required of all instances of this state.
Step Three: Creating contracts
@ -102,7 +104,7 @@ After creating a state, you must create a contract to dictate how the state can
9. The ``CarContract.kt`` file should look as follows:
.. container:: codeset
.. container:: codeset
.. sourcecode:: kotlin
@ -406,8 +408,6 @@ Now that the the CorDapp code has been completed and the build file updated, the
3. Run ``build/nodes/runNodes``
The nodes should open in terminal windows.
4. To run flows in your CorDapp, enter the following flow command from any node terminal window: ``flow start CarIssueInitiator owningBank: Bank of America, holdingDealer: Dealership, manufacturer: Manufacturer, vin:"abc", licensePlateNumber: "abc1234", make: "Honda", model: "Civic", dealershipLocation: "NYC"``
5. To check that the state was correctly issued, query the node using the following command:

View File

@ -38,4 +38,4 @@ Step Two: Run a CorDapp transaction
Next steps
----------
After deploying the example CorDapp, the next step is to start writing a CorDapp containing your own contract, states, and flows.
After deploying the example CorDapp, the next step is to start `writing a CorDapp <./quickstart-build.html>`_ containing your own contract, states, and flows.