Release fixes (#812)

* Small fixes in IRS and attachments demos.

* Docs fixes.

* Add information about `flow watch` command to documentation.

* Add note on IRS demo
This commit is contained in:
Katarzyna Streich 2017-06-08 14:31:35 +01:00 committed by GitHub
parent 1f28a60fca
commit 553ce9b2b2
5 changed files with 26 additions and 18 deletions

View File

@ -18,6 +18,8 @@ If any of the demos don't work, please raise an issue on GitHub.
.. note:: If you are running the demos from the command line in Linux (but not macOS), you may have to install xterm. .. note:: If you are running the demos from the command line in Linux (but not macOS), you may have to install xterm.
.. note:: If you would like to see flow activity on the nodes type in the node terminal ``flow watch``.
.. _trader-demo: .. _trader-demo:
Trader demo Trader demo
@ -31,18 +33,18 @@ To run from the command line in Unix:
1. Run ``./gradlew samples:trader-demo:deployNodes`` to create a set of configs and installs under ``samples/trader-demo/build/nodes`` 1. Run ``./gradlew samples:trader-demo:deployNodes`` to create a set of configs and installs under ``samples/trader-demo/build/nodes``
2. Run ``./samples/trader-demo/build/nodes/runnodes`` to open up four new terminals with the four nodes 2. Run ``./samples/trader-demo/build/nodes/runnodes`` to open up four new terminals with the four nodes
3. Run ``./gradlew samples:trader-demo:runBuyer`` to instruct the buyer node to request issuance of some cash from the Bank of Corda node. 3. Run ``./gradlew samples:trader-demo:runBuyer`` to instruct the buyer node to request issuance of some cash from the Bank of Corda node.
This step will display progress information related to the cash issuance process (in the bank of corda node log output) 4. Run ``./gradlew samples:trader-demo:runSeller`` to trigger the transaction. If you entered ``flow watch``
4. Run ``./gradlew samples:trader-demo:runSeller`` to trigger the transaction. You can see both sides of the you can see flows running on both sides of transaction. Additionally you should see final trade information displayed
trade print their progress and final transaction state in the bank node tabs/windows to your terminal.
To run from the command line in Windows: To run from the command line in Windows:
1. Run ``gradlew samples:trader-demo:deployNodes`` to create a set of configs and installs under ``samples\trader-demo\build\nodes`` 1. Run ``gradlew samples:trader-demo:deployNodes`` to create a set of configs and installs under ``samples\trader-demo\build\nodes``
2. Run ``samples\trader-demo\build\nodes\runnodes`` to open up four new terminals with the four nodes 2. Run ``samples\trader-demo\build\nodes\runnodes`` to open up four new terminals with the four nodes
3. Run ``gradlew samples:trader-demo:runBuyer`` to instruct the buyer node to request issuance of some cash from the Bank of Corda node. 3. Run ``gradlew samples:trader-demo:runBuyer`` to instruct the buyer node to request issuance of some cash from the Bank of Corda node.
This step will display progress information related to the cash issuance process (in the Bank of Corda node log output) 4. Run ``gradlew samples:trader-demo:runSeller`` to trigger the transaction. If you entered ``flow watch``
4. Run ``gradlew samples:trader-demo:runSeller`` to trigger the transaction. You can see both sides of the you can see flows running on both sides of transaction. Additionally you should see final trade information displayed
trade print their progress and final transaction state in the bank node tabs/windows to your terminal.
.. _irs-demo: .. _irs-demo:
@ -63,7 +65,7 @@ To run from the command line in Unix:
message be printed to the first node (the notary/oracle/network map node) saying that it has accepted the new message be printed to the first node (the notary/oracle/network map node) saying that it has accepted the new
interest rates interest rates
6. Now run ``./install/irs-demo/bin/irs-demo --role Trade 1``. The number is a trade ID. If you enter in node's terminal 6. Now run ``./install/irs-demo/bin/irs-demo --role Trade 1``. The number is a trade ID. If you enter in node's terminal
``run stateMachinesAndUpdates`` you should see lots of activity as the nodes set up the deal, notarise it, get it signed by the oracle, and so on ``flow watch`` you should see lots of activity as the nodes set up the deal, notarise it, get it signed by the oracle, and so on
7. Now run ``./install/irs-demo/bin/irs-demo --role Date 2017-12-12`` to roll the simulated clock forward and see some fixings take place 7. Now run ``./install/irs-demo/bin/irs-demo --role Date 2017-12-12`` to roll the simulated clock forward and see some fixings take place
To run from the command line in Windows: To run from the command line in Windows:
@ -76,7 +78,7 @@ To run from the command line in Windows:
message be printed to the first node (the notary/oracle/network map node) saying that it has accepted the new message be printed to the first node (the notary/oracle/network map node) saying that it has accepted the new
interest rates interest rates
6. Now run ``install\irs-demo\bin\irs-demo --role Trade 1``. The number is a trade ID. If you enter in node's terminal 6. Now run ``install\irs-demo\bin\irs-demo --role Trade 1``. The number is a trade ID. If you enter in node's terminal
``run stateMachinesAndUpdates`` you should see lots of activity as the nodes set up the deal, notarise it, get it signed by the oracle, and so on ``flow watch`` you should see lots of activity as the nodes set up the deal, notarise it, get it signed by the oracle, and so on
7. Now run ``install\irs-demo\bin\irs-demo --role Date 2017-12-12`` to roll the simulated clock forward and see some fixings take place 7. Now run ``install\irs-demo\bin\irs-demo --role Date 2017-12-12`` to roll the simulated clock forward and see some fixings take place
This demo also has a web app. To use this, run nodes and upload rates, then navigate to This demo also has a web app. To use this, run nodes and upload rates, then navigate to
@ -85,6 +87,9 @@ http://localhost:10007/web/irsdemo and http://localhost:10010/web/irsdemo to see
To use the web app, click the "Create Deal" button, fill in the form, then click the "Submit" button. You can then To use the web app, click the "Create Deal" button, fill in the form, then click the "Submit" button. You can then
use the time controls at the top left of the home page to run the fixings. Click any individual trade in the blotter to view it. use the time controls at the top left of the home page to run the fixings. Click any individual trade in the blotter to view it.
.. note:: The IRS web UI currently has a bug when changing the clock time where it may show no numbers or apply fixings consistently.
The issues will be addressed in M13 milestone release. Meanwhile, you can take a look at a simpler oracle example https://github.com/corda/oracle-example
Attachment demo Attachment demo
--------------- ---------------
@ -93,7 +98,7 @@ This demo brings up three nodes, and sends a transaction containing an attachmen
To run from the command line in Unix: To run from the command line in Unix:
1. Run ``./gradlew samples:attachment-demo:deployNodes`` to create a set of configs and installs under ``samples/attachment-demo/build/nodes`` 1. Run ``./gradlew samples:attachment-demo:deployNodes`` to create a set of configs and installs under ``samples/attachment-demo/build/nodes``
2. Run ``./samples/attachment-demo/build/nodes/runnodes`` to open up three new terminal tabs/windows with the three nodes 2. Run ``./samples/attachment-demo/build/nodes/runnodes`` to open up three new terminal tabs/windows with the three nodes and webserver for BankB
3. Run ``./gradlew samples:attachment-demo:runRecipient``, which will block waiting for a trade to start 3. Run ``./gradlew samples:attachment-demo:runRecipient``, which will block waiting for a trade to start
4. Run ``./gradlew samples:attachment-demo:runSender`` in another terminal window to send the attachment. Now look at the other windows to 4. Run ``./gradlew samples:attachment-demo:runSender`` in another terminal window to send the attachment. Now look at the other windows to
see the output of the demo see the output of the demo
@ -101,7 +106,7 @@ To run from the command line in Unix:
To run from the command line in Windows: To run from the command line in Windows:
1. Run ``gradlew samples:attachment-demo:deployNodes`` to create a set of configs and installs under ``samples\attachment-demo\build\nodes`` 1. Run ``gradlew samples:attachment-demo:deployNodes`` to create a set of configs and installs under ``samples\attachment-demo\build\nodes``
2. Run ``samples\attachment-demo\build\nodes\runnodes`` to open up three new terminal tabs/windows with the three nodes 2. Run ``samples\attachment-demo\build\nodes\runnodes`` to open up three new terminal tabs/windows with the three nodes and webserver for BankB
3. Run ``gradlew samples:attachment-demo:runRecipient``, which will block waiting for a trade to start 3. Run ``gradlew samples:attachment-demo:runRecipient``, which will block waiting for a trade to start
4. Run ``gradlew samples:attachment-demo:runSender`` in another terminal window to send the attachment. Now look at the other windows to 4. Run ``gradlew samples:attachment-demo:runSender`` in another terminal window to send the attachment. Now look at the other windows to
see the output of the demo see the output of the demo
@ -140,7 +145,8 @@ To run from the command line in Windows:
3. Run ``gradlew samples:notary-demo:notarise`` to make a call to the "Party" node to initiate notarisation requests 3. Run ``gradlew samples:notary-demo:notarise`` to make a call to the "Party" node to initiate notarisation requests
In a few seconds you will see a message "Notarised 10 transactions" with a list of transaction ids and the signer public keys In a few seconds you will see a message "Notarised 10 transactions" with a list of transaction ids and the signer public keys
To run the BFT SMaRt notary demo, use ``nodesBFT`` instead of ``nodesRaft`` in the path. For a single notary node, use ``nodesSingle``. To run the BFT SMaRt notary demo, use ``nodesBFT`` instead of ``nodesRaft`` in the path (you will see messages from notary nodes
trying to communicate each other sometime with connection errors, that's normal). For a single notary node, use ``nodesSingle``.
Notary nodes store consumed states in a replicated commit log, which is backed by a H2 database on each node. Notary nodes store consumed states in a replicated commit log, which is backed by a H2 database on each node.
You can ascertain that the commit log is synchronised across the cluster by accessing and comparing each of the nodes' backing stores You can ascertain that the commit log is synchronised across the cluster by accessing and comparing each of the nodes' backing stores
@ -183,7 +189,7 @@ To run from the command line in Unix:
2. Run ``./samples/bank-of-corda-demo/build/nodes/runnodes`` to open up three new terminal tabs/windows with the three nodes 2. Run ``./samples/bank-of-corda-demo/build/nodes/runnodes`` to open up three new terminal tabs/windows with the three nodes
3. Run ``./gradlew samples:bank-of-corda-demo:runRPCCashIssue`` to trigger a cash issuance request 3. Run ``./gradlew samples:bank-of-corda-demo:runRPCCashIssue`` to trigger a cash issuance request
4. Run ``./gradlew samples:bank-of-corda-demo:runWebCashIssue`` to trigger another cash issuance request. 4. Run ``./gradlew samples:bank-of-corda-demo:runWebCashIssue`` to trigger another cash issuance request.
Now look at the Bank of Corda terminal tab/window to see the output of the demo Now look at your terminal tab/window to see the output of the demo
To run from the command line in Windows: To run from the command line in Windows:
@ -191,7 +197,7 @@ To run from the command line in Windows:
2. Run ``samples\bank-of-corda-demo\build\nodes\runnodes`` to open up three new terminal tabs/windows with the three nodes 2. Run ``samples\bank-of-corda-demo\build\nodes\runnodes`` to open up three new terminal tabs/windows with the three nodes
3. Run ``gradlew samples:bank-of-corda-demo:runRPCCashIssue`` to trigger a cash issuance request 3. Run ``gradlew samples:bank-of-corda-demo:runRPCCashIssue`` to trigger a cash issuance request
4. Run ``gradlew samples:bank-of-corda-demo:runWebCashIssue`` to trigger another cash issuance request. 4. Run ``gradlew samples:bank-of-corda-demo:runWebCashIssue`` to trigger another cash issuance request.
Now look at the Bank of Corda terminal tab/window to see the output of the demo Now look at the your terminal tab/window to see the output of the demo
.. note:: To verify that the Bank of Corda node is alive and running, navigate to the following URL: .. note:: To verify that the Bank of Corda node is alive and running, navigate to the following URL:
http://localhost:10007/api/bank/date http://localhost:10007/api/bank/date
@ -206,7 +212,7 @@ In the window you run the command you should see (in case of Web, RPC is simmila
- Requesting Cash via Web ... - Requesting Cash via Web ...
- Successfully processed Cash Issue request - Successfully processed Cash Issue request
If you want to see flow activity enter in node's shell ``run stateMachinesAndUpdates``. It will display all state machines If you want to see flow activity enter in node's shell ``flow watch``. It will display all state machines
running currently on the node. running currently on the node.
Launch the Explorer application to visualize the issuance and transfer of cash for each node: Launch the Explorer application to visualize the issuance and transfer of cash for each node:

View File

@ -39,8 +39,9 @@ Starting flows and performing remote method calls
------------------------------------------------- -------------------------------------------------
**Flows** are the way the ledger is changed. If you aren't familiar with them, please review ":doc:`flow-state-machines`" **Flows** are the way the ledger is changed. If you aren't familiar with them, please review ":doc:`flow-state-machines`"
first. The ``flow list`` command can be used to list the flows understood by the node and ``flow start`` can be first. The ``flow list`` command can be used to list the flows understood by the node, ``flow watch`` shows all the flows
used to start them. The ``flow start`` command takes the class name of a flow, or *any unambiguous substring* and currently running on the node with the result (or error) information in a user friendly way, ``flow start`` can be
used to start flows. The ``flow start`` command takes the class name of a flow, or *any unambiguous substring* and
then the data to be passed to the flow constructor. The unambiguous substring feature is helpful for reducing then the data to be passed to the flow constructor. The unambiguous substring feature is helpful for reducing
the needed typing. If the match is ambiguous the possible matches will be printed out. If a flow has multiple the needed typing. If the match is ambiguous the possible matches will be printed out. If a flow has multiple
constructors then the names and types of the arguments will be used to try and determine which to use automatically. constructors then the names and types of the arguments will be used to try and determine which to use automatically.

View File

@ -169,7 +169,7 @@ private fun printHelp(parser: OptionParser) {
class AttachmentContract : Contract { class AttachmentContract : Contract {
override val legalContractReference: SecureHash override val legalContractReference: SecureHash
get() = TODO("not implemented") get() = SecureHash.zeroHash // TODO not implemented
override fun verify(tx: TransactionForContract) { override fun verify(tx: TransactionForContract) {
val state = tx.outputs.filterIsInstance<AttachmentContract.State>().single() val state = tx.outputs.filterIsInstance<AttachmentContract.State>().single()

View File

@ -27,6 +27,7 @@ class IRSDemoClientApi(private val hostAndPort: HostAndPort) {
val fileContents = IOUtils.toString(Thread.currentThread().contextClassLoader.getResourceAsStream("net/corda/irs/simulation/example.rates.txt"), Charsets.UTF_8.name()) val fileContents = IOUtils.toString(Thread.currentThread().contextClassLoader.getResourceAsStream("net/corda/irs/simulation/example.rates.txt"), Charsets.UTF_8.name())
val url = URL("http://$hostAndPort/upload/interest-rates") val url = URL("http://$hostAndPort/upload/interest-rates")
check(uploadFile(url, fileContents)) check(uploadFile(url, fileContents))
println("Rates successfully uploaded!")
} }
private companion object { private companion object {

View File

@ -73,6 +73,6 @@ class TraderDemoClientApi(val rpc: CordaRPCOps) {
// The line below blocks and waits for the future to resolve. // The line below blocks and waits for the future to resolve.
val stx = rpc.startFlow(::SellerFlow, otherParty, amount).returnValue.getOrThrow() val stx = rpc.startFlow(::SellerFlow, otherParty, amount).returnValue.getOrThrow()
logger.info("Sale completed - we have a happy customer!\n\nFinal transaction is:\n\n${Emoji.renderIfSupported(stx.tx)}") println("Sale completed - we have a happy customer!\n\nFinal transaction is:\n\n${Emoji.renderIfSupported(stx.tx)}")
} }
} }