<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>
<olclass="arabic simple">
<li>Run <codeclass="docutils literal"><spanclass="pre">./gradlew</span><spanclass="pre">samples:trader-demo:deployNodes</span></code> to create a set of configs and installs under <codeclass="docutils literal"><spanclass="pre">samples/trader-demo/build/nodes</span></code></li>
<li>Run <codeclass="docutils literal"><spanclass="pre">./samples/trader-demo/build/nodes/runnodes</span></code> (or <codeclass="docutils literal"><spanclass="pre">runnodes.bat</span></code> on Windows) to open up three new terminals with the three nodes.</li>
<li>Run <codeclass="docutils literal"><spanclass="pre">./gradlew</span><spanclass="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 <codeclass="docutils literal"><spanclass="pre">./gradlew</span><spanclass="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>
<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>
<olclass="arabic simple">
<li>Run <codeclass="docutils literal"><spanclass="pre">./gradlew</span><spanclass="pre">samples:irs-demo:deployNodes</span><spanclass="pre">samples:irs-demo:installDist</span></code> to install configs and a command line tool under <codeclass="docutils literal"><spanclass="pre">samples/irs-demo/build</span></code>.</li>
<li>Change to the <codeclass="docutils literal"><spanclass="pre">samples/irs-demo/build</span></code> directory.</li>
<li>Run <codeclass="docutils literal"><spanclass="pre">./nodes/runnodes</span></code> (or <codeclass="docutils literal"><spanclass="pre">runnodes.bat</span></code> on Windows) to open up three new terminals with the three nodes.</li>
<li>Run <codeclass="docutils literal"><spanclass="pre">./install/irs-demo/bin/irs-demo</span><spanclass="pre">--role</span><spanclass="pre">UploadRates</span></code> (or use <codeclass="docutils literal"><spanclass="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 <codeclass="docutils literal"><spanclass="pre">irs-demo</span></code> as in step 4, but this time with <codeclass="docutils literal"><spanclass="pre">--role</span><spanclass="pre">Trade</span><spanclass="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 <codeclass="docutils literal"><spanclass="pre">irs-demo</span><spanclass="pre">--role</span><spanclass="pre">Date</span><spanclass="pre">2016-12-12</span></code> to roll the simulated clock forward and see some fixings take place.</li>
<aclass="reference external"href="http://localhost:10005/web/irsdemo">http://localhost:10005/web/irsdemo</a> and <aclass="reference external"href="http://localhost:10007/web/irsdemo">http://localhost:10007/web/irsdemo</a> to see both node’s view of the ledger.</p>
<li>Run <codeclass="docutils literal"><spanclass="pre">./gradlew</span><spanclass="pre">samples:attachment-demo:deployNodes</span></code> to create a set of configs and installs under <codeclass="docutils literal"><spanclass="pre">samples/attachment-demo/build/nodes</span></code></li>
<li>Run <codeclass="docutils literal"><spanclass="pre">./samples/attachment-demo/build/nodes/runnodes</span></code> to open up three new terminal tabs/windows with the three nodes.</li>
<li>Run <codeclass="docutils literal"><spanclass="pre">./gradlew</span><spanclass="pre">samples:attachment-demo:runRecipient</span></code>, which will block waiting for something to happen.</li>
<li>Run <codeclass="docutils literal"><spanclass="pre">./gradlew</span><spanclass="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>
<pclass="last">Read more about this demo at <aclass="reference internal"href="initial-margin-agreement.html"><spanclass="doc">Initial margin agreements</span></a>.</p>
<p>Now open <aclass="reference external"href="http://localhost:10005/web/simmvaluationdemo">http://localhost:10005/web/simmvaluationdemo</a> and <aclass="reference external"href="http://localhost:10007/web/simmvaluationdemo">http://localhost:10007/web/simmvaluationdemo</a> to view the two nodes that this
<spanid="notary-demo"></span><h2>Distributed Notary demo<aclass="headerlink"href="#distributed-notary-demo"title="Permalink to this headline">¶</a></h2>
<p>This is a simple demonstration showing a party getting transactions notarised by a distributed <aclass="reference external"href="https://raft.github.io/">Raft</a>-based notary service.
The demo will start three distributed notary nodes, and two counterparty nodes. One of the parties will generate transactions
that move a self-issued asset to the other party, and submit them for notarisation.</p>
<p>The output will display a list of notarised transaction ids and corresponding signer public keys. In the Raft distributed notary
every node in the cluster services client requests, and one signature is sufficient to satisfy the notary composite key requirement.
You will notice that subsequent transactions get signed by different members of the cluster (usually allocated in a random order).</p>
<p>To run from IntelliJ:</p>
<olclass="arabic simple">
<li>Open the Corda samples project in IntelliJ and run the <codeclass="docutils literal"><spanclass="pre">Notary</span><spanclass="pre">Demo:</span><spanclass="pre">Run</span><spanclass="pre">Nodes</span></code> configuration to start the nodes.
Once all nodes are started you will see several “Node started up and registered in ...” messages.</li>
<li>Run <codeclass="docutils literal"><spanclass="pre">Notary</span><spanclass="pre">Demo:</span><spanclass="pre">Run</span><spanclass="pre">Notarisation</span></code> 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.</li>
</ol>
<p>To run from the command line:</p>
<olclass="arabic simple">
<li>Run <codeclass="docutils literal"><spanclass="pre">./gradlew</span><spanclass="pre">samples:raft-notary-demo:deployNodes</span></code>, which will create node directories with configs under <codeclass="docutils literal"><spanclass="pre">samples/raft-notary-demo/build/nodes</span></code>.</li>
<li>Run <codeclass="docutils literal"><spanclass="pre">./samples/raft-notary-demo/build/nodes/runnodes</span></code>, which will start the nodes in separate terminal windows/tabs.
Wait until a “Node started up and registered in ...” appears on each of the terminals.</li>
<li>Run <codeclass="docutils literal"><spanclass="pre">./gradlew</span><spanclass="pre">samples:raft-notary-demo:notarise</span></code> 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.</li>
</ol>
<p>Notary nodes store consumed states in a replicated commit log, which is backed by a H2 database on each node.
To ascertain that the commit log is synchronised across the cluster you access and compare each of the nodes’ backing stores
by using the H2 web console:</p>
<ul>
<li><pclass="first">Firstly, download <aclass="reference external"href="http://www.h2database.com/html/download.html">H2 web console</a> (download the “platform-independent zip”),
and start it using a script in the extracted folder: <codeclass="docutils literal"><spanclass="pre">h2/bin/h2.sh</span></code> (or <codeclass="docutils literal"><spanclass="pre">h2.bat</span></code> for Windows)</p>
</li>
<li><pclass="first">The H2 web console should start up in a web browser tab. To connect we first need to obtain a JDBC connection string.
Each node outputs its connection string in the terminal window as it starts up. In a terminal window where a node is running,
<p>You can use the string on the right to connect to the h2 database: just paste it in to the <cite>JDBC URL</cite> field and click <em>Connect</em>.
You will be presented with a web application that enumerates all the available tables and provides an interface for you to query them using SQL.</p>
</li>
<li><pclass="first">The committed states are stored in the <codeclass="docutils literal"><spanclass="pre">NOTARY_COMMITTED_STATES</span></code> table. Note that the raw data is not human-readable,
but we’re only interested in the row count for this demo.</p>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.