2016-11-17 11:03:40 +00:00
|
|
|
# IRS Demo
|
2016-11-29 14:43:22 +00:00
|
|
|
|
2018-02-28 10:03:15 +00:00
|
|
|
This demo brings up three nodes: Bank A, Bank B and a node that simultaneously runs a notary, a network map and an
|
|
|
|
interest rates oracle. The two banks agree on an interest rate swap, and then do regular fixings of the deal as the
|
2017-10-25 08:29:32 +00:00
|
|
|
time on a simulated clock passes.
|
2016-11-29 14:43:22 +00:00
|
|
|
|
2018-02-28 10:03:15 +00:00
|
|
|
Functionality is split into two parts - CordApp which provides actual distributed ledger backend and Spring Boot
|
2017-10-25 15:40:21 +00:00
|
|
|
webapp which provides REST API and web frontend. Application communicate using Corda RPC protocol.
|
2016-11-29 14:43:22 +00:00
|
|
|
|
2017-10-25 15:40:21 +00:00
|
|
|
To run from the command line in Unix:
|
2018-02-28 10:03:15 +00:00
|
|
|
1. Run ``./gradlew samples:irs-demo:cordapp:deployNodes`` to install configs and a command line tool under
|
2018-01-03 14:19:03 +00:00
|
|
|
``samples/irs-demo/cordapp/build``
|
2017-10-25 15:40:21 +00:00
|
|
|
2. Run ``./gradlew samples:irs-demo:web:deployWebapps`` to install configs and tools for running webservers
|
|
|
|
3. Move to the ``samples/irs-demo/`` directory
|
|
|
|
4. Run ``./cordapp/build/nodes/runnodes`` to open up three new terminals with the three nodes (you may have to install xterm)
|
2018-12-20 12:31:16 +00:00
|
|
|
5. On Linux, run ``./web/build/webapps/runwebapps.sh`` to open three more terminals for associated webservers. On macOS,
|
2018-01-03 14:19:03 +00:00
|
|
|
use the following command instead: ``osascript ./web/build/webapps/runwebapps.scpt``
|
2017-10-25 08:29:32 +00:00
|
|
|
|
|
|
|
To run from the command line in Windows:
|
|
|
|
|
2018-02-28 10:03:15 +00:00
|
|
|
1. Run ``gradlew.bat samples:irs-demo:cordapp:deployNodes`` to install configs and a command line tool under
|
2017-10-25 08:29:32 +00:00
|
|
|
``samples\irs-demo\build``
|
2017-10-25 15:40:21 +00:00
|
|
|
2. Run ``gradlew.bat samples:irs-demo:web:deployWebapps`` to install configs and tools for running webservers
|
|
|
|
3. Run ``cd samples\irs-demo`` to change current working directory
|
2017-12-12 11:47:14 +00:00
|
|
|
4. Run ``cordapp\build\nodes\runnodes.bat`` to open up several 3 terminals for each nodes
|
2018-02-28 10:03:15 +00:00
|
|
|
5. Run ``web\build\webapps\runwebapps.bat`` to open up several 3 terminals for each nodes' webservers
|
2017-10-25 08:29:32 +00:00
|
|
|
|
2018-02-28 10:03:15 +00:00
|
|
|
This demo also has a web app. To use this, run nodes and then navigate to http://localhost:10007/ and
|
2017-10-25 15:40:21 +00:00
|
|
|
http://localhost:10010/ to see each node's view of the ledger.
|
2017-10-25 08:29:32 +00:00
|
|
|
|
2018-02-28 10:03:15 +00:00
|
|
|
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
|
2017-10-25 08:29:32 +00:00
|
|
|
view it.
|
|
|
|
|
2018-02-28 10:03:15 +00:00
|
|
|
*Note:* The IRS web UI currently has a bug when changing the clock time where it may show no numbers or apply fixings
|
2018-04-03 17:03:07 +00:00
|
|
|
inconsistently. The issues will be addressed in a future release. Meanwhile, you can take a look at a simpler oracle
|
|
|
|
example here: https://github.com/corda/oracle-example.
|
2018-02-05 11:42:20 +00:00
|
|
|
|
|
|
|
## Running the system test
|
|
|
|
|
2019-01-29 13:10:07 +00:00
|
|
|
The system test utilizes Docker. The amount of RAM required to run the IRS system test is around 2.5GB, so it is important
|
|
|
|
to make sure the appropriate system resources are allocated (On MacOS/Windows this may require explicit changes to your Docker configuration).
|
2018-02-05 11:42:20 +00:00
|
|
|
|
|
|
|
### Gradle
|
|
|
|
|
2019-01-29 13:10:07 +00:00
|
|
|
The system test is designed to exercise the entire stack, including Corda nodes and the web frontend. It uses [Docker](https://www.docker.com),
|
|
|
|
[docker-compose](https://docs.docker.com/compose/), and
|
|
|
|
[PhantomJS](http://phantomjs.org/). Docker and docker-compose need to be installed and configured to on the system path
|
|
|
|
(which happens by default). The PhantomJs binary has to be put in a known location and needs execution permissions enabled
|
|
|
|
(``chmod a+x phantomjs`` on *nix) and the full path to the binary needs to be available as system property named ``phantomjs.binary.path`` or
|
|
|
|
an environment variable named ``PHANTOMJS_BINARY_PATH``.
|
|
|
|
|
|
|
|
To start the test, run ``:samples:irs-demo:systemTest``.
|
2018-02-05 11:42:20 +00:00
|
|
|
|
|
|
|
### Other
|
|
|
|
|
2019-01-29 13:10:07 +00:00
|
|
|
In order to run the test by other means than the Gradle task - two more environment variables are expected -
|
|
|
|
``CORDAPP_DOCKER_COMPOSE`` and ``WEB_DOCKER_COMPOSE`` which should specify the full path for the docker-compose files for the IRS cordapp
|
|
|
|
and web frontend respectively. Those can be obtained by running the ``:samples:irs-demo:cordapp:prepareDockerNodes`` and
|
|
|
|
``web:generateDockerCompose`` Gradle tasks. The ``:samples:irs-demo:systemTest`` Gradle task simply executes these two tasks and sets up the
|
|
|
|
correct environment variables.
|
2018-02-05 11:42:20 +00:00
|
|
|
|