Regens docs.

This commit is contained in:
Joel Dudley
2017-01-06 17:38:23 +00:00
parent 60f72d4427
commit a8a371fcda
3783 changed files with 13414 additions and 13063 deletions

View File

@ -35,8 +35,8 @@
<link rel="top" title="R3 Corda latest documentation" href="index.html"/>
<link rel="next" title="Building Transactions" href="tutorial-building-transactions.html"/>
<link rel="prev" title="Integration Test Tutorial" href="tutorial-integration-testing.html"/>
<link rel="next" title="Building transactions" href="tutorial-building-transactions.html"/>
<link rel="prev" title="Integration testing" href="tutorial-integration-testing.html"/>
<script src="_static/js/modernizr.min.js"></script>
@ -98,7 +98,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="inthebox.html">What&#8217;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"><a class="reference internal" href="getting-set-up-fault-finding.html">Getting set up: troubleshooting</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting-set-up-fault-finding.html">Troubleshooting</a></li>
<li class="toctree-l1"><a class="reference internal" href="running-the-demos.html">Running the demos</a></li>
<li class="toctree-l1"><a class="reference internal" href="CLI-vs-IDE.html">CLI vs IDE</a></li>
</ul>
@ -108,17 +108,12 @@
<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>
<li class="toctree-l1"><a class="reference internal" href="clauses.html">Clauses key concepts</a></li>
<li class="toctree-l1"><a class="reference internal" href="clauses.html">Clauses</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">CorDapps Background</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>
<li class="toctree-l1"><a class="reference internal" href="tutorial-cordapp.html">The CorDapp Template</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-cordapp.html#building-the-cordapp-template">Building the CorDapp template</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-cordapp.html#running-the-cordapp-template">Running the CorDapp template</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-cordapp.html#interacting-with-the-cordapp-template">Interacting with the CorDapp template</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-cordapp.html#extending-the-cordapp-template">Extending the CorDapp template</a></li>
<li class="toctree-l1"><a class="reference internal" href="creating-a-cordapp.html">CorDapp basics</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-cordapp.html">The CorDapp template</a></li>
</ul>
<p class="caption"><span class="caption-text">The Corda node</span></p>
<ul>
@ -137,27 +132,24 @@
<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-integration-testing.html">Integration Test Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-integration-testing.html">Integration testing</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Client RPC API tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#registering-classes-from-your-cordapp-with-rpc-kryo">Registering classes from your CorDapp with RPC Kryo</a></li>
<li class="toctree-l2"><a class="reference internal" href="#security">Security</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-building-transactions.html">Building Transactions</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-building-transactions.html">Building transactions</a></li>
<li class="toctree-l1"><a class="reference internal" href="flow-state-machines.html">Writing flows</a></li>
<li class="toctree-l1"><a class="reference internal" href="flow-testing.html">Writing flow tests</a></li>
<li class="toctree-l1"><a class="reference internal" href="running-a-notary.html">Running a notary service</a></li>
<li class="toctree-l1"><a class="reference internal" href="using-a-notary.html">Using a notary service</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="oracles.html#implementing-an-oracle-with-continuously-varying-data">Implementing an oracle with continuously varying data</a></li>
<li class="toctree-l1"><a class="reference internal" href="oracles.html#using-an-oracle">Using an oracle</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="initial-margin-agreement.html">Initial margin agreements</a></li>
</ul>
<p class="caption"><span class="caption-text">Component library</span></p>
<ul>
@ -167,11 +159,9 @@
<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="setting-up-a-corda-network.html">Introduction - What is a corda network?</a></li>
<li class="toctree-l1"><a class="reference internal" href="setting-up-a-corda-network.html#setting-up-your-own-network">Setting up your own network</a></li>
<li class="toctree-l1"><a class="reference internal" href="setting-up-a-corda-network.html">What is a corda network?</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>
@ -234,32 +224,25 @@ simple visualisation on top. For an explanation on how the RPC works
see <a class="reference internal" href="clientrpc.html"><span class="doc">Client RPC</span></a>.</p>
<p>We start off by connecting to the node itself. For the purposes of the tutorial we will use the Driver to start up a notary and a node that issues/exits and moves Cash around for herself. To authenticate we will use the certificates of the nodes directly.</p>
<p>Note how we configure the node to create a user that has permission to start the CashFlow.</p>
<div class="highlight-kotlin"><div class="highlight"><pre><span></span>enum class PrintOrVisualise {
Print,
Visualise
}
<div class="highlight-kotlin"><div class="highlight"><pre><span></span><span class="k">enum</span> <span class="k">class</span> <span class="nc">PrintOrVisualise</span> <span class="p">{</span>
<span class="n">Print</span><span class="p">,</span>
<span class="n">Visualise</span>
<span class="p">}</span>
fun main(args: Array&lt;String&gt;) {
if (args.size &lt; 1) {
throw IllegalArgumentException(&quot;Usage: &lt;binary&gt; [Print|Visualise]&quot;)
}
val printOrVisualise = PrintOrVisualise.valueOf(args[0])
<span class="k">fun</span> <span class="nf">main</span><span class="p">(</span><span class="n">args</span><span class="p">:</span> <span class="n">Array</span><span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;)</span> <span class="p">{</span>
<span class="n">require</span><span class="p">(</span><span class="n">args</span><span class="p">.</span><span class="n">isNotEmpty</span><span class="p">())</span> <span class="p">{</span> <span class="s">&quot;Usage: &lt;binary&gt; [Print|Visualise]&quot;</span> <span class="p">}</span>
<span class="k">val</span> <span class="py">printOrVisualise</span> <span class="p">=</span> <span class="n">PrintOrVisualise</span><span class="p">.</span><span class="n">valueOf</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="m">0</span><span class="p">])</span>
val baseDirectory = Paths.get(&quot;build/rpc-api-tutorial&quot;)
val user = User(&quot;user&quot;, &quot;password&quot;, permissions = setOf(startFlowPermission&lt;CashFlow&gt;()))
<span class="k">val</span> <span class="py">baseDirectory</span> <span class="p">=</span> <span class="n">Paths</span><span class="p">.</span><span class="k">get</span><span class="p">(</span><span class="s">&quot;build/rpc-api-tutorial&quot;</span><span class="p">)</span>
<span class="k">val</span> <span class="py">user</span> <span class="p">=</span> <span class="n">User</span><span class="p">(</span><span class="s">&quot;user&quot;</span><span class="p">,</span> <span class="s">&quot;password&quot;</span><span class="p">,</span> <span class="n">permissions</span> <span class="p">=</span> <span class="n">setOf</span><span class="p">(</span><span class="n">startFlowPermission</span><span class="p">&lt;</span><span class="n">CashFlow</span><span class="p">&gt;()))</span>
driver(driverDirectory = baseDirectory) {
startNode(&quot;Notary&quot;, advertisedServices = setOf(ServiceInfo(ValidatingNotaryService.type)))
val node = startNode(&quot;Alice&quot;, rpcUsers = listOf(user)).get()
val sslConfig = object : NodeSSLConfiguration {
override val certificatesPath = baseDirectory / &quot;Alice&quot; / &quot;certificates&quot;
override val keyStorePassword = &quot;cordacadevpass&quot;
override val trustStorePassword = &quot;trustpass&quot;
}
<span class="n">driver</span><span class="p">(</span><span class="n">driverDirectory</span> <span class="p">=</span> <span class="n">baseDirectory</span><span class="p">)</span> <span class="p">{</span>
<span class="n">startNode</span><span class="p">(</span><span class="s">&quot;Notary&quot;</span><span class="p">,</span> <span class="n">advertisedServices</span> <span class="p">=</span> <span class="n">setOf</span><span class="p">(</span><span class="n">ServiceInfo</span><span class="p">(</span><span class="n">ValidatingNotaryService</span><span class="p">.</span><span class="n">type</span><span class="p">)))</span>
<span class="k">val</span> <span class="py">node</span> <span class="p">=</span> <span class="n">startNode</span><span class="p">(</span><span class="s">&quot;Alice&quot;</span><span class="p">,</span> <span class="n">rpcUsers</span> <span class="p">=</span> <span class="n">listOf</span><span class="p">(</span><span class="n">user</span><span class="p">)).</span><span class="k">get</span><span class="p">()</span>
</pre></div>
</div>
<p>Now we can connect to the node itself using a valid RPC login. We login using the configured user.</p>
<div class="highlight-kotlin"><div class="highlight"><pre><span></span> <span class="k">val</span> <span class="py">client</span> <span class="p">=</span> <span class="n">CordaRPCClient</span><span class="p">(</span><span class="n">FullNodeConfiguration</span><span class="p">(</span><span class="n">node</span><span class="p">.</span><span class="n">config</span><span class="p">).</span><span class="n">artemisAddress</span><span class="p">,</span> <span class="n">sslConfig</span><span class="p">)</span>
<div class="highlight-kotlin"><div class="highlight"><pre><span></span> <span class="k">val</span> <span class="py">client</span> <span class="p">=</span> <span class="n">node</span><span class="p">.</span><span class="n">rpcClientToNode</span><span class="p">()</span>
<span class="n">client</span><span class="p">.</span><span class="n">start</span><span class="p">(</span><span class="s">&quot;user&quot;</span><span class="p">,</span> <span class="s">&quot;password&quot;</span><span class="p">)</span>
<span class="k">val</span> <span class="py">proxy</span> <span class="p">=</span> <span class="n">client</span><span class="p">.</span><span class="n">proxy</span><span class="p">()</span>
@ -376,7 +359,7 @@ requests or responses with the <cite>Kryo</cite> instance RPC uses. Here&#8217;
<span class="p">}</span>
</pre></div>
</div>
<p>See more on plugins in <a class="reference internal" href="creating-a-cordapp.html"><span class="doc">CorDapps Background</span></a>.</p>
<p>See more on plugins in <a class="reference internal" href="creating-a-cordapp.html"><span class="doc">CorDapp basics</span></a>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">We will be replacing the use of Kryo in RPC with a stable message format and this will mean that this plugin
@ -424,7 +407,7 @@ Currently the only permission type defined is <em>StartFlow</em>, which defines
</pre></div>
</div>
<p>See more on security in <a class="reference internal" href="secure-coding-guidelines.html"><span class="doc">Secure coding guidelines</span></a>, node configuration in <a class="reference internal" href="corda-configuration-file.html"><span class="doc">Node configuration</span></a> and
Cordformation in <a class="reference internal" href="creating-a-cordapp.html"><span class="doc">CorDapps Background</span></a></p>
Cordformation in <a class="reference internal" href="creating-a-cordapp.html"><span class="doc">CorDapp basics</span></a></p>
</div>
</div>
@ -435,10 +418,10 @@ Cordformation in <a class="reference internal" href="creating-a-cordapp.html"><s
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="tutorial-building-transactions.html" class="btn btn-neutral float-right" title="Building Transactions" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="tutorial-building-transactions.html" class="btn btn-neutral float-right" title="Building transactions" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="tutorial-integration-testing.html" class="btn btn-neutral" title="Integration Test Tutorial" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
<a href="tutorial-integration-testing.html" class="btn btn-neutral" title="Integration testing" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>