mirror of
https://github.com/corda/corda.git
synced 2024-12-24 15:16:45 +00:00
e5f314ffbf
Merged release/4 (Corda OS version 4.1) into a branch created from master (Corda OS version 4.3) Conflicts: build.gradle client/rpc/src/main/kotlin/net/corda/client/rpc/internal/ReconnectingCordaRPCOps.kt common/logging/build.gradle common/logging/src/main/kotlin/net/corda/common/logging/CordaVersion.kt constants.properties core-tests/src/test/kotlin/net/corda/coretests/utilities/ProgressTrackerTest.kt core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt docs/source/api-contract-constraints.rst docs/source/api-stability-guarantees.rst docs/source/app-upgrade-notes.rst docs/source/changelog.rst docs/source/clientrpc.rst docs/source/conf.py docs/source/corda-network/UAT.md docs/source/getting-set-up.rst docs/source/network-builder.rst docs/source/upgrading-cordapps.rst docs/source/versioning.rst node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcReconnectTests.kt serialization/src/main/kotlin/net/corda/serialization/internal/amqp/PropertyDescriptor.kt serialization/src/main/kotlin/net/corda/serialization/internal/model/LocalTypeInformationBuilder.kt tools/network-builder/src/main/resources/node-Dockerfile tools/network-builder/src/main/resources/notary-Dockerfile |
||
---|---|---|
.. | ||
src | ||
workflows-trader | ||
build.gradle | ||
README.md |
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:
- Run
./gradlew samples:trader-demo:deployNodes
to create a set of configs and installs undersamples/trader-demo/build/nodes
- Run
./samples/trader-demo/build/nodes/runnodes
to open up five new terminals with the five nodes - Run
./gradlew samples:trader-demo:runBank
to instruct the bank node to issue cash and commercial paper to the buyer and seller nodes respectively - Run
./gradlew samples:trader-demo:runSeller
to trigger the transaction. If you enteredflow 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:
- Run
gradlew samples:trader-demo:deployNodes
to create a set of configs and installs undersamples\trader-demo\build\nodes
- Run
samples\trader-demo\build\nodes\runnodes
to open up five new terminals with the five nodes - Run
gradlew samples:trader-demo:runBank
to instruct the buyer node to request issuance of some cash from the Bank of Corda node - Run
gradlew samples:trader-demo:runSeller
to trigger the transaction. If you enteredflow watch
, you can see flows running on both sides of transaction. Additionally you should see final trade information displayed to your terminal