mirror of
https://github.com/corda/corda.git
synced 2024-12-24 15:16:45 +00:00
383 lines
20 KiB
HTML
383 lines
20 KiB
HTML
|
|
|
|
<!DOCTYPE html>
|
|
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
|
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
|
<head>
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title>Running the demos — R3 Corda latest documentation</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="_static/css/custom.css" type="text/css" />
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="top" title="R3 Corda latest documentation" href="index.html"/>
|
|
<link rel="next" title="Data model" href="data-model.html"/>
|
|
<link rel="prev" title="Getting set up" href="getting-set-up.html"/>
|
|
|
|
|
|
<script src="_static/js/modernizr.min.js"></script>
|
|
|
|
</head>
|
|
|
|
<body class="wy-body-for-nav" role="document">
|
|
|
|
<div class="wy-grid-for-nav">
|
|
|
|
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
<div class="wy-side-scroll">
|
|
<div class="wy-side-nav-search">
|
|
|
|
|
|
|
|
|
|
<a href="index.html" class="icon icon-home"> R3 Corda
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<div class="version">
|
|
latest
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div role="search">
|
|
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
|
<input type="text" name="q" placeholder="Search docs" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
</div>
|
|
|
|
|
|
<br>
|
|
<a href="api/index.html">API reference</a>
|
|
|
|
</div>
|
|
|
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
|
|
|
|
|
|
<p class="caption"><span class="caption-text">Getting started</span></p>
|
|
<ul class="current">
|
|
<li class="toctree-l1"><a class="reference internal" href="inthebox.html">What’s included?</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="getting-set-up.html">Getting set up</a></li>
|
|
<li class="toctree-l1 current"><a class="current reference internal" href="#">Running the demos</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="#trader-demo">Trader demo</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="#irs-demo">IRS demo</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="#attachment-demo">Attachment demo</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="#simm-and-portfolio-demo">SIMM and Portfolio Demo</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<p class="caption"><span class="caption-text">Key concepts</span></p>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="data-model.html">Data model</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="transaction-data-types.html">Data types</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="merkle-trees.html">Transaction Tear-offs</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="consensus.html">Consensus model</a></li>
|
|
</ul>
|
|
<p class="caption"><span class="caption-text">The Corda node</span></p>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="clientrpc.html">Client RPC</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="messaging.html">Networking and messaging</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="persistence.html">Persistence</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="node-administration.html">Node administration</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="corda-configuration-files.html">The Corda Configuration File</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="node-services.html">A Brief Introduction To The Node Services</a></li>
|
|
</ul>
|
|
<p class="caption"><span class="caption-text">CorDapps</span></p>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="creating-a-cordapp.html">Creating a Cordapp</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="creating-a-cordapp.html#gradle-plugins-for-cordapps">Gradle Plugins for Cordapps</a></li>
|
|
</ul>
|
|
<p class="caption"><span class="caption-text">Tutorials</span></p>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="where-to-start.html">Where to start</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="tutorial-contract.html">Writing a contract</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="tutorial-contract-clauses.html">Writing a contract using clauses</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="tutorial-test-dsl.html">Writing a contract test</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="tutorial-clientrpc-api.html">Client RPC API Tutorial</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="flow-state-machines.html">Flow state machines</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="oracles.html">Writing oracle services</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="tutorial-attachments.html">Using attachments</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="event-scheduling.html">Event scheduling</a></li>
|
|
</ul>
|
|
<p class="caption"><span class="caption-text">Other</span></p>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="network-simulator.html">Network Simulator</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="node-explorer.html">Node Explorer</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="initial-margin-agreement.html">Initial Margin Agreements</a></li>
|
|
</ul>
|
|
<p class="caption"><span class="caption-text">Component library</span></p>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="contract-catalogue.html">Contract catalogue</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="contract-irs.html">Interest Rate Swaps</a></li>
|
|
</ul>
|
|
<p class="caption"><span class="caption-text">Appendix</span></p>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="loadtesting.html">Load testing</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="secure-coding-guidelines.html">Secure coding guidelines</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="release-process.html">Release process</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="release-process.html#steps-to-cut-a-release">Steps to cut a release</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="release-notes.html">Release notes</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="codestyle.html">Code style guide</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="building-the-docs.html">Building the documentation</a></li>
|
|
</ul>
|
|
<p class="caption"><span class="caption-text">Glossary</span></p>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary</a></li>
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
|
|
|
|
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
<a href="index.html">R3 Corda</a>
|
|
</nav>
|
|
|
|
|
|
|
|
<div class="wy-nav-content">
|
|
<div class="rst-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
<ul class="wy-breadcrumbs">
|
|
<li><a href="index.html">Docs</a> »</li>
|
|
|
|
<li>Running the demos</li>
|
|
<li class="wy-breadcrumbs-aside">
|
|
|
|
|
|
<a href="_sources/running-the-demos.txt" rel="nofollow"> View page source</a>
|
|
|
|
|
|
</li>
|
|
</ul>
|
|
<hr/>
|
|
</div>
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
<div itemprop="articleBody">
|
|
|
|
<div class="section" id="running-the-demos">
|
|
<h1>Running the demos<a class="headerlink" href="#running-the-demos" title="Permalink to this headline">¶</a></h1>
|
|
<p>The repository contains a small number of demo programs that run two-node networks, demonstrating functionality developed
|
|
so far. We have:</p>
|
|
<ol class="arabic simple">
|
|
<li>The trader demo, which shows a delivery-vs-payment atomic swap of commercial paper for cash. You can learn more about
|
|
how this works in <a class="reference internal" href="flow-state-machines.html"><span class="doc">Flow state machines</span></a>.</li>
|
|
<li>The IRS demo, which shows two nodes establishing an interest rate swap between them and performing fixings with a
|
|
rates oracle, all driven via the HTTP API.</li>
|
|
<li>The IRS demo web interface - a web interface to the IRS demo.</li>
|
|
<li>The attachment demo, which demonstrates uploading attachments to nodes.</li>
|
|
<li>The SIMM valuation demo, a large demo which shows two nodes agreeing on a portfolio and valuing the initial margin
|
|
using the Standard Initial Margin Model.</li>
|
|
</ol>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">If any demos don’t work please jump on our mailing list and let us know.</p>
|
|
</div>
|
|
<p>The demos can be run either from the command line, or from inside IntelliJ. Running from the command line is
|
|
recommended if you are just wanting to see them run, using IntelliJ can be helpful if you want to debug or
|
|
develop the demos themselves.</p>
|
|
<div class="section" id="trader-demo">
|
|
<h2>Trader demo<a class="headerlink" href="#trader-demo" title="Permalink to this headline">¶</a></h2>
|
|
<p>This demo brings up three nodes: Bank A, Bank B and a notary/network map node that they both use. Bank A will
|
|
be the buyer, and self-issues some cash in order to acquire the commercial paper from Bank B, the seller.</p>
|
|
<p>To run from the command line:</p>
|
|
<ol class="arabic simple">
|
|
<li>Run <code class="docutils literal"><span class="pre">./gradlew</span> <span class="pre">samples:trader-demo:deployNodes</span></code> to create a set of configs and installs under <code class="docutils literal"><span class="pre">samples/trader-demo/build/nodes</span></code></li>
|
|
<li>Run <code class="docutils literal"><span class="pre">./samples/trader-demo/build/nodes/runnodes</span></code> (or <code class="docutils literal"><span class="pre">runnodes.bat</span></code> on Windows) to open up three new terminals with the three nodes.</li>
|
|
<li>Run <code class="docutils literal"><span class="pre">./gradlew</span> <span class="pre">samples:trader-demo:runBuyer</span></code> to set up the buyer node with some self-issued cash. This step
|
|
is not expected to print much.</li>
|
|
<li>Run <code class="docutils literal"><span class="pre">./gradlew</span> <span class="pre">samples:trader-demo:runSeller</span></code> 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.</li>
|
|
</ol>
|
|
<p>To run from IntelliJ:</p>
|
|
<ol class="arabic simple">
|
|
<li>Open the Corda project in IntelliJ and run the “Install” configuration</li>
|
|
<li>Open the Corda samples project in IntelliJ and run the “Trader Demo: Run Nodes” configuration</li>
|
|
<li>Run “Trader Demo: Run Buyer”</li>
|
|
<li>Run “Trader Demo: Run Seller”</li>
|
|
</ol>
|
|
<p>In the “Trader Demo: Run Nodes” windows you should see some log lines scroll past, and within a few seconds the messages
|
|
“Purchase complete - we are a happy customer!” and “Sale completed - we have a happy customer!” should be printed.</p>
|
|
</div>
|
|
<div class="section" id="irs-demo">
|
|
<h2>IRS demo<a class="headerlink" href="#irs-demo" title="Permalink to this headline">¶</a></h2>
|
|
<p>This demo brings up three nodes: Bank A, Bank B and a node that runs a notary, a network map and an interest rates
|
|
oracle together. The two banks agree on an interest rate swap, and then do regular fixings of the deal as the time
|
|
on a simulated clock passes.</p>
|
|
<p>To run from the command line:</p>
|
|
<ol class="arabic simple">
|
|
<li>Run <code class="docutils literal"><span class="pre">./gradlew</span> <span class="pre">samples:irs-demo:deployNodes</span> <span class="pre">samples:irs-demo:installDist</span></code> to install configs and a command line tool under <code class="docutils literal"><span class="pre">samples/irs-demo/build</span></code>.</li>
|
|
<li>Change to the <code class="docutils literal"><span class="pre">samples/irs-demo/build</span></code> directory.</li>
|
|
<li>Run <code class="docutils literal"><span class="pre">./nodes/runnodes</span></code> (or <code class="docutils literal"><span class="pre">runnodes.bat</span></code> on Windows) to open up three new terminals with the three nodes.</li>
|
|
<li>Run <code class="docutils literal"><span class="pre">./install/irs-demo/bin/irs-demo</span> <span class="pre">--role</span> <span class="pre">UploadRates</span></code> (or use <code class="docutils literal"><span class="pre">irs-demo.bat</span></code> on Windows). You should see a
|
|
message be printed to the first node (the notary/oracle/network map node) saying that it has accepted some new
|
|
interest rates.</li>
|
|
<li>Now run <code class="docutils literal"><span class="pre">irs-demo</span></code> as in step 4, but this time with <code class="docutils literal"><span class="pre">--role</span> <span class="pre">Trade</span> <span class="pre">1</span></code>. The number is a trade ID. You should
|
|
see lots of activity as the nodes set up the deal, notarise it, get it signed by the oracle and so on.</li>
|
|
<li>Now run <code class="docutils literal"><span class="pre">irs-demo</span> <span class="pre">--role</span> <span class="pre">Date</span> <span class="pre">2016-12-12</span></code> to roll the simulated clock forward and see some fixings take place.</li>
|
|
</ol>
|
|
<p>To run from IntelliJ:</p>
|
|
<ol class="arabic simple">
|
|
<li>Open the Corda project in IntelliJ and run the “Install” configuration</li>
|
|
<li>Open the Corda samples project in IntelliJ and run the “IRS Demo: Run Nodes” configuration</li>
|
|
<li>Run “IRS Demo: Run Upload Rates” to upload rates to the oracle.</li>
|
|
<li>Run “IRS Demo: Run Trade” to have nodes agree on a trade.</li>
|
|
<li>Run “IRS Demo: Run Date Change” to run the fixings.</li>
|
|
</ol>
|
|
<p>In the “IRS Demo: Run Nodes” window you’ll see a lot of activity when you run the trade and when you run the date change.
|
|
The date change rolls the clock forwards and causes the nodes to agree on the fixings over a period.</p>
|
|
<p>There is also an web app as part of this demo. To use this set up the trades and then navigate to
|
|
<a class="reference external" href="http://localhost:10005/web/irsdemo">http://localhost:10005/web/irsdemo</a> and <a class="reference external" href="http://localhost:10007/web/irsdemo">http://localhost:10007/web/irsdemo</a> to see both node’s view of the ledger.</p>
|
|
<p>To use the demos click the “Create Deal” button, fill in the form, then click the “Submit” button. Now you will be
|
|
able to 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.</p>
|
|
</div>
|
|
<div class="section" id="attachment-demo">
|
|
<h2>Attachment demo<a class="headerlink" href="#attachment-demo" title="Permalink to this headline">¶</a></h2>
|
|
<p>This demo brings up three nodes, and sends a transaction containing an attachment from one to the other. To run
|
|
it from the command line (recommended for Mac/UNIX users!):</p>
|
|
<ol class="arabic simple">
|
|
<li>Run <code class="docutils literal"><span class="pre">./gradlew</span> <span class="pre">samples:attachment-demo:deployNodes</span></code> to create a set of configs and installs under <code class="docutils literal"><span class="pre">samples/attachment-demo/build/nodes</span></code></li>
|
|
<li>Run <code class="docutils literal"><span class="pre">./samples/attachment-demo/build/nodes/runnodes</span></code> to open up three new terminal tabs/windows with the three nodes.</li>
|
|
<li>Run <code class="docutils literal"><span class="pre">./gradlew</span> <span class="pre">samples:attachment-demo:runRecipient</span></code>, which will block waiting for something to happen.</li>
|
|
<li>Run <code class="docutils literal"><span class="pre">./gradlew</span> <span class="pre">samples:attachment-demo:runSender</span></code> in another terminal window to trigger the transaction.
|
|
Now look at the other windows to see the output of the demo.</li>
|
|
</ol>
|
|
<p>Or you can run them from inside IntelliJ, but when done this way, all the node output is printed to a single console.</p>
|
|
<ol class="arabic simple">
|
|
<li>Open the Corda project in IntelliJ and run the “Install” configuration</li>
|
|
<li>Open the Corda samples project in IntelliJ and run the “Attachment Demo: Run Nodes” configuration</li>
|
|
<li>Run “Attachment Demo: Run Recipient” - this waits for a trade to start</li>
|
|
<li>Run “Attachment Demo: Run Sender” - sends the attachment</li>
|
|
</ol>
|
|
<p>In the “Attachment Demo: Run Nodes” window you should see some log lines scroll past, and within a few seconds the
|
|
message “File received - we’re happy!” should be printed.</p>
|
|
</div>
|
|
<div class="section" id="simm-and-portfolio-demo">
|
|
<h2>SIMM and Portfolio Demo<a class="headerlink" href="#simm-and-portfolio-demo" title="Permalink to this headline">¶</a></h2>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">Read more about this demo at <a class="reference internal" href="initial-margin-agreement.html"><span class="doc">Initial Margin Agreements</span></a>.</p>
|
|
</div>
|
|
<p>To run the demo run:</p>
|
|
<ol class="arabic simple">
|
|
<li>Open the Corda project in IntelliJ and run the “Install” configuration</li>
|
|
<li>Open the Corda samples project in IntelliJ and run the “Simm Valuation Demo” configuration</li>
|
|
</ol>
|
|
<p>Now open <a class="reference external" href="http://localhost:10005/web/simmvaluationdemo">http://localhost:10005/web/simmvaluationdemo</a> and <a class="reference external" href="http://localhost:10007/web/simmvaluationdemo">http://localhost:10007/web/simmvaluationdemo</a> to view the two nodes that this
|
|
will have started respectively. You can now use the demo by creating trades and agreeing the valuations.</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<footer>
|
|
|
|
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
|
|
<a href="data-model.html" class="btn btn-neutral float-right" title="Data model" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
|
|
|
|
|
|
<a href="getting-set-up.html" class="btn btn-neutral" title="Getting set up" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
|
|
|
</div>
|
|
|
|
|
|
<hr/>
|
|
|
|
<div role="contentinfo">
|
|
<p>
|
|
© Copyright 2016, Distributed Ledger Group, LLC.
|
|
|
|
</p>
|
|
</div>
|
|
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT:'./',
|
|
VERSION:'latest',
|
|
COLLAPSE_INDEX:false,
|
|
FILE_SUFFIX:'.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="_static/js/theme.js"></script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
jQuery(function () {
|
|
SphinxRtdTheme.StickyNav.enable();
|
|
});
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html> |