corda/samples/trader-demo
Christian Sailer e38cd9ec63
ENT-5043 separate out test utils (#5998)
* Remove unused dependencies from test-common

* Explicit imports and formatting

* Add core-test-utils project

* Add dependency

* Move Kryo serialization context to node-api (not serialization as we do not want to pull kryo into the serialization lib)

* Move AMQP server serialization scheme to node api

* Move serialization tests to node-api

* Move internal test helpers without further dependencies.

* Move out some types from RPCClientProxyHandler to node-api in preparation for moving the AMQP scheme

* Move client AMQP context to node-api so we can move the test serialization rule out.

* Move InternalSerializationTestHelpers to core-test-utils

* Moved testing.core to core-test-utils

* Make detekt happy

* Add api-scanner to core-test-utils

* Remove inlined package names introduced by IntelliJ refactoring

* Update api-current.txt to account for reordering.

* Add core-test-utils to list of published artifacts.

* Add missing import

* Location of things in api text has moved again (publish name of artefact?)

* Revert all additions to the API, leaving just the reordering

* Code review: fix up core-test-utils build.gradle and introduce kryo version constant.

* Remove OpenSsl flag from ssl config stub (can't be used from node-api)

* Suppress detekt warning

* Move core test util tests to the right module

* Expose kotlin test as a transient dependency - projects have come to rely on that.

* Fix typo in package name
2020-03-03 15:55:17 +00:00
..
src add timeouts to all tests (#5875) 2020-02-11 10:14:05 +00:00
workflows-trader ENT-5043 separate out test utils (#5998) 2020-03-03 15:55:17 +00:00
build.gradle CORDA-2893, ENT-3422: Tweak JUnit 5 configurations to keep vintage engine off compile classpaths. (#5138) 2019-05-20 11:57:56 +01:00
README.md make usage of flow overrides more explicit in documentation for trader-demo 2019-01-17 11:22:06 +00:00

Trader demo

This demo brings up five nodes: Bank A, Bank B, Bank Of Corda, NonLogging Bank and a notary node that they all use. Bank A will be the buyer, and requests some cash from the Bank of Corda in order to acquire commercial paper from Bank B, the seller.

The NonLogging Bank node is present to demonstrate the usage of the "Configuring Responder Flows" feature of Corda described here. The override is defined within the deployNodes section of the build.gradle. In this case, we are overriding the default responder for net.corda.traderdemo.flow.SellerFlow to be a version that does not print out information about the transaction.

    node {
        name "O=NonLogging Bank,L=London,C=GB"
        p2pPort 10025
        rpcUsers = ext.rpcUsers
        rpcSettings {
            address "localhost:10026"
            adminAddress "localhost:10027"
        }
        extraConfig = ['h2Settings.address' : 'localhost:10035']
        flowOverride("net.corda.traderdemo.flow.SellerFlow", "net.corda.traderdemo.flow.BuyerFlow")
    }

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 five new terminals with the five nodes
  3. Run ./gradlew samples:trader-demo:runBank to instruct the bank node to issue cash and commercial paper to the buyer and seller nodes respectively
  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 five new terminals with the five nodes
  3. Run gradlew samples:trader-demo:runBank to instruct the buyer node to request issuance of some cash from the Bank of Corda node
  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