mirror of
https://github.com/corda/corda.git
synced 2025-06-12 20:28:18 +00:00
Regen docsite
This commit is contained in:
91
docs/build/html/tutorial-clientrpc-api.html
vendored
91
docs/build/html/tutorial-clientrpc-api.html
vendored
@ -31,8 +31,8 @@
|
||||
|
||||
|
||||
<link rel="top" title="R3 Corda latest documentation" href="index.html"/>
|
||||
<link rel="next" title="Writing flows" href="flow-state-machines.html"/>
|
||||
<link rel="prev" title="Writing a contract test" href="tutorial-test-dsl.html"/>
|
||||
<link rel="next" title="Building Transactions" href="tutorial-building-transactions.html"/>
|
||||
<link rel="prev" title="Integration Test Tutorial" href="tutorial-integration-testing.html"/>
|
||||
|
||||
|
||||
<script src="_static/js/modernizr.min.js"></script>
|
||||
@ -89,7 +89,9 @@
|
||||
<ul>
|
||||
<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"><a class="reference internal" href="getting-set-up-fault-finding.html">Getting Set Up : Faultfinding</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>
|
||||
<p class="caption"><span class="caption-text">Key concepts</span></p>
|
||||
<ul>
|
||||
@ -97,6 +99,16 @@
|
||||
<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>
|
||||
</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-sample-cordapp">Running the Sample CorDapp</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-cordapp.html#using-the-sample-cordapp">Using the sample CorDapp</a></li>
|
||||
</ul>
|
||||
<p class="caption"><span class="caption-text">The Corda node</span></p>
|
||||
<ul>
|
||||
@ -110,26 +122,25 @@
|
||||
<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="permissioning.html">Network permissioning</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 class="current">
|
||||
<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-integration-testing.html">Integration Test Tutorial</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="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>
|
||||
@ -146,6 +157,8 @@
|
||||
<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="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>
|
||||
@ -298,9 +311,14 @@ fun main(args: Array<String>) {
|
||||
fun getVaultTransactionNotes(txnId: SecureHash): Iterable<String>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="admonition warning">
|
||||
<p class="first admonition-title">Warning</p>
|
||||
<p class="last">This API is evolving and will continue to grow as new functionality and features added to Corda are made available to RPC clients.</p>
|
||||
</div>
|
||||
<p>The one we need in order to dump the transaction graph is <code class="docutils literal"><span class="pre">verifiedTransactions</span></code>. The type signature tells us that the
|
||||
RPC will return a list of transactions and an Observable stream. This is a general pattern, we query some data and the
|
||||
node will return the current snapshot and future updates done to it.</p>
|
||||
node will return the current snapshot and future updates done to it. Observables are described in further detail in
|
||||
<a class="reference internal" href="clientrpc.html"><span class="doc">Client RPC</span></a></p>
|
||||
<div class="highlight-kotlin"><div class="highlight"><pre><span></span> val (transactions: List<SignedTransaction>, futureTransactions: Observable<SignedTransaction>) = proxy.verifiedTransactions()
|
||||
</pre></div>
|
||||
</div>
|
||||
@ -351,9 +369,9 @@ latter.</p>
|
||||
<p>Then in a loop we generate randomly either an Issue, a Pay or an Exit transaction.</p>
|
||||
<p>The RPC we need to initiate a Cash transaction is <code class="docutils literal"><span class="pre">startFlowDynamic</span></code> which may start an arbitrary flow, given sufficient permissions to do so. We won’t use this function directly, but rather a type-safe wrapper around it <code class="docutils literal"><span class="pre">startFlow</span></code> that type-checks the arguments for us.</p>
|
||||
<p>Finally we have everything in place: we start a couple of nodes, connect to them, and start creating transactions while listening on successfully created ones, which are dumped to the console. We just need to run it!:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># Build the example</span>
|
||||
<div class="highlight-text"><div class="highlight"><pre><span></span># Build the example
|
||||
./gradlew docs/source/example-code:installDist
|
||||
<span class="c1"># Start it</span>
|
||||
# Start it
|
||||
./docs/source/example-code/build/install/docs/source/example-code/bin/client-rpc-tutorial Print
|
||||
</pre></div>
|
||||
</div>
|
||||
@ -400,13 +418,56 @@ requests or responses with the <cite>Kryo</cite> instance RPC uses. Here’
|
||||
<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">Creating a CorDapp</span></a>.</p>
|
||||
<p>See more on plugins in <a class="reference internal" href="creating-a-cordapp.html"><span class="doc">CorDapps Background</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
|
||||
customisation point will either go away completely or change.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="security">
|
||||
<h2>Security<a class="headerlink" href="#security" title="Permalink to this headline">¶</a></h2>
|
||||
<p>RPC credentials associated with a Client must match the permission set configured on the server Node.
|
||||
This refers to both authentication (username and password) and role-based authorisation (a permissioned set of RPC operations an
|
||||
authenticated user is entitled to run).</p>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">Permissions are represented as <em>String’s</em> to allow RPC implementations to add their own permissioning.
|
||||
Currently the only permission type defined is <em>StartFlow</em>, which defines a list of whitelisted flows an authenticated use may execute.</p>
|
||||
</div>
|
||||
<p>In the instructions above the server node permissions are configured programmatically in the driver code:</p>
|
||||
<div class="highlight-text"><div class="highlight"><pre><span></span>driver(driverDirectory = baseDirectory) {
|
||||
val user = User("user", "password", permissions = setOf(startFlowPermission<CashFlow>()))
|
||||
val node = startNode("Alice", rpcUsers = listOf(user)).get()
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>When starting a standalone node using a configuration file we must supply the RPC credentials as follows:</p>
|
||||
<div class="highlight-text"><div class="highlight"><pre><span></span>rpcUsers : [
|
||||
{ user=user, password=password, permissions=[ StartFlow.net.corda.flows.CashFlow ] }
|
||||
]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>When using the gradle Cordformation plugin to configure and deploy a node you must supply the RPC credentials in a similar manner:</p>
|
||||
<div class="highlight-text"><div class="highlight"><pre><span></span>rpcUsers = [
|
||||
['user' : "user",
|
||||
'password' : "password",
|
||||
'permissions' : ["StartFlow.net.corda.flows.CashFlow"]]
|
||||
]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>You can then deploy and launch the nodes (Notary and Alice) as follows:</p>
|
||||
<div class="highlight-text"><div class="highlight"><pre><span></span># to create a set of configs and installs under ``docs/source/example-code/build/nodes`` run
|
||||
./gradlew docs/source/example-code:deployNodes
|
||||
# to open up two new terminals with the two nodes run
|
||||
./docs/source/example-code/build/nodes/runnodes
|
||||
# followed by the same commands as before:
|
||||
./docs/source/example-code/build/install/docs/source/example-code/bin/client-rpc-tutorial Print
|
||||
./docs/source/example-code/build/install/docs/source/example-code/bin/client-rpc-tutorial Visualise
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -416,10 +477,10 @@ customisation point will either go away completely or change.</p>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
|
||||
<a href="flow-state-machines.html" class="btn btn-neutral float-right" title="Writing flows" 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-test-dsl.html" class="btn btn-neutral" title="Writing a contract test" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</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>
|
||||
|
||||
</div>
|
||||
|
||||
@ -428,7 +489,7 @@ customisation point will either go away completely or change.</p>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2016, Distributed Ledger Group, LLC.
|
||||
© Copyright 2016, R3 Limited.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user