From 553ce9b2b2ba1bf6d6d08cb3b9763af5576a294c Mon Sep 17 00:00:00 2001 From: Katarzyna Streich Date: Thu, 8 Jun 2017 14:31:35 +0100 Subject: [PATCH] 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 --- docs/source/running-the-demos.rst | 34 +++++++++++-------- docs/source/shell.rst | 5 +-- .../corda/attachmentdemo/AttachmentDemo.kt | 2 +- .../net/corda/irs/api/IrsDemoClientApi.kt | 1 + .../corda/traderdemo/TraderDemoClientApi.kt | 2 +- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/docs/source/running-the-demos.rst b/docs/source/running-the-demos.rst index 53cb7529b1..653436be44 100644 --- a/docs/source/running-the-demos.rst +++ b/docs/source/running-the-demos.rst @@ -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 would like to see flow activity on the nodes type in the node terminal ``flow watch``. + .. _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`` 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. - 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. You can see both sides of the - trade print their progress and final transaction state in the bank node tabs/windows +4. Run ``./gradlew samples:trader-demo:runSeller`` to trigger the transaction. If you entered ``flow watch`` +you can see flows running on both sides of transaction. Additionally you should see final trade information displayed +to your terminal. 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`` 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. - 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. You can see both sides of the - trade print their progress and final transaction state in the bank node tabs/windows +4. Run ``gradlew samples:trader-demo:runSeller`` to trigger the transaction. If you entered ``flow watch`` +you can see flows running on both sides of transaction. Additionally you should see final trade information displayed +to your terminal. .. _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 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 - ``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 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 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 - ``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 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 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 --------------- @@ -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: 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 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 @@ -101,7 +106,7 @@ To run from the command line in Unix: 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`` -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 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 @@ -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 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. 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 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. - 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: @@ -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 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. - 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: 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 ... - 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. Launch the Explorer application to visualize the issuance and transfer of cash for each node: diff --git a/docs/source/shell.rst b/docs/source/shell.rst index 3e53ae1113..42618101ba 100644 --- a/docs/source/shell.rst +++ b/docs/source/shell.rst @@ -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`" -first. The ``flow list`` command can be used to list the flows understood by the node and ``flow start`` can be -used to start them. The ``flow start`` command takes the class name of a flow, or *any unambiguous substring* and +first. The ``flow list`` command can be used to list the flows understood by the node, ``flow watch`` shows all the flows +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 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. diff --git a/samples/attachment-demo/src/main/kotlin/net/corda/attachmentdemo/AttachmentDemo.kt b/samples/attachment-demo/src/main/kotlin/net/corda/attachmentdemo/AttachmentDemo.kt index ad2bce7ed5..f653e2b4c3 100644 --- a/samples/attachment-demo/src/main/kotlin/net/corda/attachmentdemo/AttachmentDemo.kt +++ b/samples/attachment-demo/src/main/kotlin/net/corda/attachmentdemo/AttachmentDemo.kt @@ -169,7 +169,7 @@ private fun printHelp(parser: OptionParser) { class AttachmentContract : Contract { override val legalContractReference: SecureHash - get() = TODO("not implemented") + get() = SecureHash.zeroHash // TODO not implemented override fun verify(tx: TransactionForContract) { val state = tx.outputs.filterIsInstance().single() diff --git a/samples/irs-demo/src/main/kotlin/net/corda/irs/api/IrsDemoClientApi.kt b/samples/irs-demo/src/main/kotlin/net/corda/irs/api/IrsDemoClientApi.kt index 2a179ec611..0d70e065ed 100644 --- a/samples/irs-demo/src/main/kotlin/net/corda/irs/api/IrsDemoClientApi.kt +++ b/samples/irs-demo/src/main/kotlin/net/corda/irs/api/IrsDemoClientApi.kt @@ -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 url = URL("http://$hostAndPort/upload/interest-rates") check(uploadFile(url, fileContents)) + println("Rates successfully uploaded!") } private companion object { diff --git a/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/TraderDemoClientApi.kt b/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/TraderDemoClientApi.kt index 6b445e2b69..aca2ca11da 100644 --- a/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/TraderDemoClientApi.kt +++ b/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/TraderDemoClientApi.kt @@ -73,6 +73,6 @@ class TraderDemoClientApi(val rpc: CordaRPCOps) { // The line below blocks and waits for the future to resolve. 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)}") } }