mirror of
https://github.com/corda/corda.git
synced 2025-02-20 09:26:41 +00:00
Regen docsite
This commit is contained in:
parent
3bec44cd65
commit
784946983f
BIN
docs/build/doctrees/clientrpc.doctree
vendored
BIN
docs/build/doctrees/clientrpc.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/consensus.doctree
vendored
BIN
docs/build/doctrees/consensus.doctree
vendored
Binary file not shown.
Binary file not shown.
BIN
docs/build/doctrees/creating-a-cordapp.doctree
vendored
BIN
docs/build/doctrees/creating-a-cordapp.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/data-model.doctree
vendored
BIN
docs/build/doctrees/data-model.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/environment.pickle
vendored
BIN
docs/build/doctrees/environment.pickle
vendored
Binary file not shown.
BIN
docs/build/doctrees/event-scheduling.doctree
vendored
BIN
docs/build/doctrees/event-scheduling.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/flow-state-machines.doctree
vendored
Normal file
BIN
docs/build/doctrees/flow-state-machines.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/build/doctrees/further-notes-on-kotlin.doctree
vendored
Normal file
BIN
docs/build/doctrees/further-notes-on-kotlin.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/build/doctrees/getting-set-up-fault-finding.doctree
vendored
Normal file
BIN
docs/build/doctrees/getting-set-up-fault-finding.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/build/doctrees/getting-set-up.doctree
vendored
BIN
docs/build/doctrees/getting-set-up.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/glossary.doctree
vendored
Normal file
BIN
docs/build/doctrees/glossary.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/build/doctrees/index.doctree
vendored
BIN
docs/build/doctrees/index.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/initial-margin-agreement.doctree
vendored
Normal file
BIN
docs/build/doctrees/initial-margin-agreement.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/build/doctrees/inthebox.doctree
vendored
BIN
docs/build/doctrees/inthebox.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/loadtesting.doctree
vendored
BIN
docs/build/doctrees/loadtesting.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/merkle-trees.doctree
vendored
BIN
docs/build/doctrees/merkle-trees.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/messaging.doctree
vendored
BIN
docs/build/doctrees/messaging.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/network-simulator.doctree
vendored
BIN
docs/build/doctrees/network-simulator.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/node-administration.doctree
vendored
BIN
docs/build/doctrees/node-administration.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/node-explorer.doctree
vendored
BIN
docs/build/doctrees/node-explorer.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/node-services.doctree
vendored
Normal file
BIN
docs/build/doctrees/node-services.doctree
vendored
Normal file
Binary file not shown.
BIN
docs/build/doctrees/persistence.doctree
vendored
BIN
docs/build/doctrees/persistence.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/running-the-demos.doctree
vendored
BIN
docs/build/doctrees/running-the-demos.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/secure-coding-guidelines.doctree
vendored
BIN
docs/build/doctrees/secure-coding-guidelines.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/transaction-data-types.doctree
vendored
BIN
docs/build/doctrees/transaction-data-types.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/tutorial-attachments.doctree
vendored
BIN
docs/build/doctrees/tutorial-attachments.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/tutorial-clientrpc-api.doctree
vendored
BIN
docs/build/doctrees/tutorial-clientrpc-api.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/tutorial-contract.doctree
vendored
BIN
docs/build/doctrees/tutorial-contract.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/where-to-start.doctree
vendored
BIN
docs/build/doctrees/where-to-start.doctree
vendored
Binary file not shown.
2
docs/build/html/.buildinfo
vendored
2
docs/build/html/.buildinfo
vendored
@ -1,4 +1,4 @@
|
||||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: 02da61908148262295ef57918c434b8d
|
||||
config: ad4aa434cfebd269fdbb85815bc6eb43
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
BIN
docs/build/html/_images/composite-key-2.png
vendored
Normal file
BIN
docs/build/html/_images/composite-key-2.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
BIN
docs/build/html/_images/composite-key.png
vendored
Normal file
BIN
docs/build/html/_images/composite-key.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
BIN
docs/build/html/_images/unlinked-gradle.png
vendored
Normal file
BIN
docs/build/html/_images/unlinked-gradle.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
12
docs/build/html/_sources/clientrpc.txt
vendored
12
docs/build/html/_sources/clientrpc.txt
vendored
@ -80,5 +80,17 @@ Wire protocol
|
||||
The client RPC wire protocol is not currently documented. To use it you must use the client library provided.
|
||||
This is likely to change in a future release.
|
||||
|
||||
Registering Classes With RPC Kryo
|
||||
---------------------------------
|
||||
|
||||
In the present implementation of the node we use Kryo to generate the *on the wire* representation of contracts states
|
||||
or any other classes that form part of the RPC arguments or response. To avoid the RPC interface being wide open to all
|
||||
classes on the classpath, Cordapps will currently have to register any classes or custom serialisers they require with Kryo
|
||||
if they are not one of those registered by default in ``RPCKryo`` via the plugin architecture. See :doc:`creating-a-cordapp`.
|
||||
This will require some familiarity with Kryo. An example is shown in :doc:`tutorial-clientrpc-api`.
|
||||
|
||||
.. warning:: 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.
|
||||
|
||||
.. _CordaRPCClient: api/net.corda.client/-corda-r-p-c-client/index.html
|
||||
.. _CordaRPCOps: api/net.corda.node.services.messaging/-corda-r-p-c-ops/index.html
|
||||
|
26
docs/build/html/_sources/consensus.txt
vendored
26
docs/build/html/_sources/consensus.txt
vendored
@ -59,18 +59,18 @@ Ensuring that all input states point to the same notary is the responsibility of
|
||||
Changing notaries
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
To change the notary for an input state, use the ``NotaryChangeProtocol``. For example:
|
||||
To change the notary for an input state, use the ``NotaryChangeFlow``. For example:
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
@Suspendable
|
||||
fun changeNotary(originalState: StateAndRef<ContractState>,
|
||||
newNotary: Party): StateAndRef<ContractState> {
|
||||
val protocol = NotaryChangeProtocol.Instigator(originalState, newNotary)
|
||||
return subProtocol(protocol)
|
||||
val flow = NotaryChangeFlow.Instigator(originalState, newNotary)
|
||||
return subFlow(flow)
|
||||
}
|
||||
|
||||
The protocol will:
|
||||
The flow will:
|
||||
|
||||
1. Construct a transaction with the old state as the input and the new state as the output
|
||||
|
||||
@ -152,10 +152,10 @@ At present we have two basic implementations that store committed input states i
|
||||
Obtaining a signature
|
||||
---------------------
|
||||
|
||||
Once a transaction is built and ready to be finalised, normally you would call ``FinalityProtocol`` passing in a
|
||||
Once a transaction is built and ready to be finalised, normally you would call ``FinalityFlow`` passing in a
|
||||
``SignedTransaction`` (including signatures from the participants) and a list of participants to notify. This requests a
|
||||
notary signature if needed, and then sends a copy of the notarised transaction to all participants for them to store.
|
||||
``FinalityProtocol`` delegates to ``NotaryProtocol.Client`` followed by ``BroadcastTransactionProtocol`` to do the
|
||||
``FinalityFlow`` delegates to ``NotaryFlow.Client`` followed by ``BroadcastTransactionFlow`` to do the
|
||||
actual work of notarising and broadcasting the transaction. For example:
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
@ -165,21 +165,21 @@ actual work of notarising and broadcasting the transaction. For example:
|
||||
// We conclusively cannot have all the signatures, as the notary has not signed yet
|
||||
val tx = ptx.toSignedTransaction(checkSufficientSignatures = false)
|
||||
// The empty set would be the trigger events, which are not used here
|
||||
val protocol = FinalityProtocol(tx, emptySet(), participants)
|
||||
return serviceHub.startProtocol("protocol.finalisation", protocol)
|
||||
val flow = FinalityFlow(tx, emptySet(), participants)
|
||||
return serviceHub.startFlow("flow.finalisation", flow)
|
||||
}
|
||||
|
||||
To manually obtain a signature from a notary you can call ``NotaryProtocol.Client`` directly. The protocol will work out
|
||||
To manually obtain a signature from a notary you can call ``NotaryFlow.Client`` directly. The flow will work out
|
||||
which notary needs to be called based on the input states and the timestamp command. For example, the following snippet
|
||||
can be used when writing a custom protocol:
|
||||
can be used when writing a custom flow:
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
fun getNotarySignature(wtx: WireTransaction): DigitalSignature.LegallyIdentifiable {
|
||||
return subProtocol(NotaryProtocol.Client(wtx))
|
||||
return subFlow(NotaryFlow.Client(wtx))
|
||||
}
|
||||
|
||||
On conflict the ``NotaryProtocol`` with throw a ``NotaryException`` containing the conflict details:
|
||||
On conflict the ``NotaryFlow`` with throw a ``NotaryException`` containing the conflict details:
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
@ -192,4 +192,4 @@ On conflict the ``NotaryProtocol`` with throw a ``NotaryException`` containing t
|
||||
*/
|
||||
data class ConsumingTx(val id: SecureHash, val inputIndex: Int, val requestingParty: Party)
|
||||
|
||||
Conflict handling and resolution is currently the responsibility of the protocol author.
|
||||
Conflict handling and resolution is currently the responsibility of the flow author.
|
||||
|
@ -96,6 +96,10 @@ Configuration File Fields
|
||||
|
||||
:extraAdvertisedServiceIds: A list of ServiceType id strings to be advertised to the NetworkMapService and thus be available when other nodes query the NetworkMapCache for supporting nodes. This can also include plugin services loaded from .jar files in the plugins folder.
|
||||
|
||||
:notaryNodeAddress: The host and port to which to bind the embedded Raft server. Required only when running a distributed notary service. A group of Corda nodes can run a distributed notary service by each running an embedded Raft server and joining them to the same cluster to replicate the committed state log. Note that the Raft cluster uses a separate transport layer for communication that does not integrate with ArtemisMQ messaging services.
|
||||
|
||||
:notaryClusterAddresses: List of Raft cluster member addresses used to joining the cluster. At least one of the specified members must be active and be able to communicate with the cluster leader for joining. If empty, a new cluster will be bootstrapped. Required only when running a distributed notary service.
|
||||
|
||||
:networkMapAddress: If `null`, or missing the node is declaring itself as the NetworkMapService host. Otherwise the configuration value is the remote HostAndPort string for the ArtemisMQ service on the hosting node.
|
||||
|
||||
:useHTTPS: If false the node's web server will be plain HTTP. If true the node will use the same certificate and private key from the ``<workspace>/certificates/sslkeystore.jks`` file as the ArtemisMQ port for HTTPS. If HTTPS is enabled then unencrypted HTTP traffic to the node's **webAddress** port is not supported.
|
||||
|
@ -12,16 +12,17 @@ App Plugins
|
||||
To create an app plugin you must you must extend from `CordaPluginRegistry`_. The JavaDoc contains
|
||||
specific details of the implementation, but you can extend the server in the following ways:
|
||||
|
||||
1. Required protocols: Specify which protocols will be whitelisted for use in your web APIs.
|
||||
1. Required flows: Specify which flows will be whitelisted for use in your web APIs.
|
||||
2. Service plugins: Register your services (see below).
|
||||
3. Web APIs: You may register your own endpoints under /api/ of the built-in web server.
|
||||
4. Static web endpoints: You may register your own static serving directories for serving web content.
|
||||
5. Registering your additional classes used in RPC.
|
||||
|
||||
Services
|
||||
--------
|
||||
|
||||
Services are classes which are constructed after the node has started. It is provided a `ServiceHubInternal`_ which
|
||||
allows a richer API than the `ServiceHub`_ exposed to contracts. It enables adding protocols, registering
|
||||
allows a richer API than the `ServiceHub`_ exposed to contracts. It enables adding flows, registering
|
||||
message handlers and more. The service does not run in a separate thread, so the only entry point to the service is during
|
||||
construction, where message handlers should be registered and threads started.
|
||||
|
||||
|
2
docs/build/html/_sources/data-model.txt
vendored
2
docs/build/html/_sources/data-model.txt
vendored
@ -254,7 +254,7 @@ including things like the shape of the transaction. It may seem that it's an ove
|
||||
just immediately respend the big output back to yourself in order to split it? And yes, you could, until you hit
|
||||
scenarios like "the machine requesting the payment doesn't have the keys needed to spend it",
|
||||
which turn out to be very common. So it's really more effective for a recipient to be able to say to the
|
||||
sender, "here's the kind of transaction I want you to send me". The :doc:`protocol framework <protocol-state-machines>`
|
||||
sender, "here's the kind of transaction I want you to send me". The :doc:`flow framework <flow-state-machines>`
|
||||
may provide a vehicle to make such negotiations simpler.
|
||||
|
||||
A further challenge is privacy. Whilst our goal of not sending transactions to nodes that don't "need to know"
|
||||
|
24
docs/build/html/_sources/event-scheduling.txt
vendored
24
docs/build/html/_sources/event-scheduling.txt
vendored
@ -28,8 +28,8 @@ due. If a contract state is consumed in the UTXO model, then what *was* the nex
|
||||
and the next time sensitive event is determined by any successor contract state.
|
||||
|
||||
Knowing when the next time sensitive event is due to occur is useful, but typically some *activity* is expected to take
|
||||
place when this event occurs. We already have a model for business processes in the form of :doc:`protocols <protocol-state-machines>`,
|
||||
so in the platform we have introduced the concept of *scheduled activities* that can invoke protocol state machines
|
||||
place when this event occurs. We already have a model for business processes in the form of :doc:`flows <flow-state-machines>`,
|
||||
so in the platform we have introduced the concept of *scheduled activities* that can invoke flow state machines
|
||||
at a scheduled time. A contract state can optionally described the next scheduled activity for itself. If it omits
|
||||
to do so, then nothing will be scheduled.
|
||||
|
||||
@ -40,18 +40,18 @@ There are two main steps to implementing scheduled events:
|
||||
|
||||
* Have your ``ContractState`` implementation also implement ``SchedulableState``. This requires a method named
|
||||
``nextScheduledActivity`` to be implemented which returns an optional ``ScheduledActivity`` instance.
|
||||
``ScheduledActivity`` captures what ``ProtocolLogic`` instance each node will run, to perform the activity, and when it
|
||||
``ScheduledActivity`` captures what ``FlowLogic`` instance each node will run, to perform the activity, and when it
|
||||
will run is described by a ``java.time.Instant``. Once your state implements this interface and is tracked by the
|
||||
wallet, it can expect to be queried for the next activity when committed to the wallet.
|
||||
* If nothing suitable exists, implement a ``ProtocolLogic`` to be executed by each node as the activity itself.
|
||||
* If nothing suitable exists, implement a ``FlowLogic`` to be executed by each node as the activity itself.
|
||||
The important thing to remember is that in the current implementation, each node that is party to the transaction
|
||||
will execute the same ``ProtocolLogic``, so it needs to establish roles in the business process based on the contract
|
||||
will execute the same ``FlowLogic``, so it needs to establish roles in the business process based on the contract
|
||||
state and the node it is running on. Each side will follow different but complementary paths through the business logic.
|
||||
|
||||
.. note:: The scheduler's clock always operates in the UTC time zone for uniformity, so any time zone logic must be
|
||||
performed by the contract, using ``ZonedDateTime``.
|
||||
|
||||
In the short term, until we have automatic protocol session set up, you will also likely need to install a network
|
||||
In the short term, until we have automatic flow session set up, you will also likely need to install a network
|
||||
handler to help with obtaining a unqiue and secure random session. An example is described below.
|
||||
|
||||
The production and consumption of ``ContractStates`` is observed by the scheduler and the activities associated with
|
||||
@ -73,30 +73,30 @@ Let's take an example of the interest rate swap fixings for our scheduled events
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
override fun nextScheduledActivity(thisStateRef: StateRef,
|
||||
protocolLogicRefFactory: ProtocolLogicRefFactory): ScheduledActivity? {
|
||||
flowLogicRefFactory: FlowLogicRefFactory): ScheduledActivity? {
|
||||
val nextFixingOf = nextFixingOf() ?: return null
|
||||
|
||||
val (instant, duration) = suggestInterestRateAnnouncementTimeWindow(index = nextFixingOf.name,
|
||||
source = floatingLeg.indexSource,
|
||||
date = nextFixingOf.forDay)
|
||||
return ScheduledActivity(protocolLogicRefFactory.create(TwoPartyDealProtocol.FixingRoleDecider::class.java,
|
||||
return ScheduledActivity(flowLogicRefFactory.create(TwoPartyDealFlow.FixingRoleDecider::class.java,
|
||||
thisStateRef, duration), instant)
|
||||
}
|
||||
|
||||
The first thing this does is establish if there are any remaining fixings. If there are none, then it returns ``null``
|
||||
to indicate that there is no activity to schedule. Otherwise it calculates the ``Instant`` at which the interest rate
|
||||
should become available and schedules an activity at that time to work out what roles each node will take in the fixing
|
||||
business process and to take on those roles. That ``ProtocolLogic`` will be handed the ``StateRef`` for the interest
|
||||
business process and to take on those roles. That ``FlowLogic`` will be handed the ``StateRef`` for the interest
|
||||
rate swap ``State`` in question, as well as a tolerance ``Duration`` of how long to wait after the activity is triggered
|
||||
for the interest rate before indicating an error.
|
||||
|
||||
.. note:: This is a way to create a reference to the ProtocolLogic class and its constructor parameters to
|
||||
.. note:: This is a way to create a reference to the FlowLogic class and its constructor parameters to
|
||||
instantiate. The reference can be checked against a per-node whitelist of approved and allowable types as
|
||||
part of our overall security sandboxing.
|
||||
|
||||
|
||||
As previously mentioned, we currently need a small network handler to assist with session setup until the work to
|
||||
automate that is complete. See the interest rate swap specific implementation ``FixingSessionInitiationHandler`` which
|
||||
is responsible for starting a ``ProtocolLogic`` to perform one role in the fixing protocol with the ``sessionID`` sent
|
||||
by the ``FixingRoleDecider`` on the other node which then launches the other role in the fixing protocol. Currently
|
||||
is responsible for starting a ``FlowLogic`` to perform one role in the fixing flow with the ``sessionID`` sent
|
||||
by the ``FixingRoleDecider`` on the other node which then launches the other role in the fixing flow. Currently
|
||||
the handler needs to be manually installed in the node.
|
||||
|
694
docs/build/html/_sources/flow-state-machines.txt
vendored
Normal file
694
docs/build/html/_sources/flow-state-machines.txt
vendored
Normal file
@ -0,0 +1,694 @@
|
||||
.. highlight:: kotlin
|
||||
.. raw:: html
|
||||
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/codesets.js"></script>
|
||||
|
||||
Flow state machines
|
||||
===================
|
||||
|
||||
This article explains our experimental approach to modelling financial flows in code. It explains how the
|
||||
platform's state machine framework is used, and takes you through the code for a simple 2-party asset trading flow
|
||||
which is included in the source.
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Shared distributed ledgers are interesting because they allow many different, mutually distrusting parties to
|
||||
share a single source of truth about the ownership of assets. Digitally signed transactions are used to update that
|
||||
shared ledger, and transactions may alter many states simultaneously and atomically.
|
||||
|
||||
Blockchain systems such as Bitcoin support the idea of building up a finished, signed transaction by passing around
|
||||
partially signed invalid transactions outside of the main network, and by doing this you can implement
|
||||
*delivery versus payment* such that there is no chance of settlement failure, because the movement of cash and the
|
||||
traded asset are performed atomically by the same transaction. To perform such a trade involves a multi-step flow
|
||||
in which messages are passed back and forth privately between parties, checked, signed and so on.
|
||||
|
||||
Despite how useful these flows are, platforms such as Bitcoin and Ethereum do not assist the developer with the rather
|
||||
tricky task of actually building them. That is unfortunate. There are many awkward problems in their implementation
|
||||
that a good platform would take care of for you, problems like:
|
||||
|
||||
* Avoiding "callback hell" in which code that should ideally be sequential is turned into an unreadable mess due to the
|
||||
desire to avoid using up a thread for every flow instantiation.
|
||||
* Surviving node shutdowns/restarts that may occur in the middle of the flow without complicating things. This
|
||||
implies that the state of the flow must be persisted to disk.
|
||||
* Error handling.
|
||||
* Message routing.
|
||||
* Serialisation.
|
||||
* Catching type errors, in which the developer gets temporarily confused and expects to receive/send one type of message
|
||||
when actually they need to receive/send another.
|
||||
* Unit testing of the finished flow.
|
||||
|
||||
Actor frameworks can solve some of the above but they are often tightly bound to a particular messaging layer, and
|
||||
we would like to keep a clean separation. Additionally, they are typically not type safe, and don't make persistence or
|
||||
writing sequential code much easier.
|
||||
|
||||
To put these problems in perspective, the *payment channel protocol* in the bitcoinj library, which allows bitcoins to
|
||||
be temporarily moved off-chain and traded at high speed between two parties in private, consists of about 7000 lines of
|
||||
Java and took over a month of full time work to develop. Most of that code is concerned with the details of persistence,
|
||||
message passing, lifecycle management, error handling and callback management. Because the business logic is quite
|
||||
spread out the code can be difficult to read and debug.
|
||||
|
||||
As small contract-specific trading flows are a common occurence in finance, we provide a framework for the
|
||||
construction of them that automatically handles many of the concerns outlined above.
|
||||
|
||||
Theory
|
||||
------
|
||||
|
||||
A *continuation* is a suspended stack frame stored in a regular object that can be passed around, serialised,
|
||||
unserialised and resumed from where it was suspended. This concept is sometimes referred to as "fibers". This may
|
||||
sound abstract but don't worry, the examples below will make it clearer. The JVM does not natively support
|
||||
continuations, so we implement them using a library called Quasar which works through behind-the-scenes
|
||||
bytecode rewriting. You don't have to know how this works to benefit from it, however.
|
||||
|
||||
We use continuations for the following reasons:
|
||||
|
||||
* It allows us to write code that is free of callbacks, that looks like ordinary sequential code.
|
||||
* A suspended continuation takes far less memory than a suspended thread. It can be as low as a few hundred bytes.
|
||||
In contrast a suspended Java thread stack can easily be 1mb in size.
|
||||
* It frees the developer from thinking (much) about persistence and serialisation.
|
||||
|
||||
A *state machine* is a piece of code that moves through various *states*. These are not the same as states in the data
|
||||
model (that represent facts about the world on the ledger), but rather indicate different stages in the progression
|
||||
of a multi-stage flow. Typically writing a state machine would require the use of a big switch statement and some
|
||||
explicit variables to keep track of where you're up to. The use of continuations avoids this hassle.
|
||||
|
||||
A two party trading flow
|
||||
------------------------
|
||||
|
||||
We would like to implement the "hello world" of shared transaction building flows: a seller wishes to sell some
|
||||
*asset* (e.g. some commercial paper) in return for *cash*. The buyer wishes to purchase the asset using his cash. They
|
||||
want the trade to be atomic so neither side is exposed to the risk of settlement failure. We assume that the buyer
|
||||
and seller have found each other and arranged the details on some exchange, or over the counter. The details of how
|
||||
the trade is arranged isn't covered in this article.
|
||||
|
||||
Our flow has two parties (B and S for buyer and seller) and will proceed as follows:
|
||||
|
||||
1. S sends a ``StateAndRef`` pointing to the state they want to sell to B, along with info about the price they require
|
||||
B to pay.
|
||||
2. B sends to S a ``SignedTransaction`` that includes the state as input, B's cash as input, the state with the new
|
||||
owner key as output, and any change cash as output. It contains a single signature from B but isn't valid because
|
||||
it lacks a signature from S authorising movement of the asset.
|
||||
3. S signs it and hands the now finalised ``SignedTransaction`` back to B.
|
||||
|
||||
You can find the implementation of this flow in the file ``finance/src/main/kotlin/net.corda.flows/TwoPartyTradeFlow.kt``.
|
||||
|
||||
Assuming no malicious termination, they both end the flow being in posession of a valid, signed transaction that
|
||||
represents an atomic asset swap.
|
||||
|
||||
Note that it's the *seller* who initiates contact with the buyer, not vice-versa as you might imagine.
|
||||
|
||||
We start by defining a wrapper that namespaces the flow code, two functions to start either the buy or sell side
|
||||
of the flow, and two classes that will contain the flow definition. We also pick what data will be used by
|
||||
each side.
|
||||
|
||||
.. note:: The code samples in this tutorial are only available in Kotlin, but you can use any JVM language to
|
||||
write them and the approach is the same.
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
object TwoPartyTradeFlow {
|
||||
|
||||
class UnacceptablePriceException(val givenPrice: Amount<Currency>) : Exception("Unacceptable price: $givenPrice")
|
||||
class AssetMismatchException(val expectedTypeName: String, val typeName: String) : Exception() {
|
||||
override fun toString() = "The submitted asset didn't match the expected type: $expectedTypeName vs $typeName"
|
||||
}
|
||||
|
||||
// This object is serialised to the network and is the first flow message the seller sends to the buyer.
|
||||
data class SellerTradeInfo(
|
||||
val assetForSale: StateAndRef<OwnableState>,
|
||||
val price: Amount<Currency>,
|
||||
val sellerOwnerKey: PublicKey
|
||||
)
|
||||
|
||||
data class SignaturesFromSeller(val sellerSig: DigitalSignature.WithKey,
|
||||
val notarySig: DigitalSignature.LegallyIdentifiable)
|
||||
|
||||
open class Seller(val otherSide: Party,
|
||||
val notaryNode: NodeInfo,
|
||||
val assetToSell: StateAndRef<OwnableState>,
|
||||
val price: Amount<Currency>,
|
||||
val myKeyPair: KeyPair,
|
||||
override val progressTracker: ProgressTracker = Seller.tracker()) : FlowLogic<SignedTransaction>() {
|
||||
@Suspendable
|
||||
override fun call(): SignedTransaction {
|
||||
TODO()
|
||||
}
|
||||
}
|
||||
|
||||
open class Buyer(val otherSide: Party,
|
||||
val notary: Party,
|
||||
val acceptablePrice: Amount<Currency>,
|
||||
val typeToBuy: Class<out OwnableState>) : FlowLogic<SignedTransaction>() {
|
||||
@Suspendable
|
||||
override fun call(): SignedTransaction {
|
||||
TODO()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
This code defines several classes nested inside the main ``TwoPartyTradeFlow`` singleton. Some of the classes are
|
||||
simply flow messages or exceptions. The other two represent the buyer and seller side of the flow.
|
||||
|
||||
Going through the data needed to become a seller, we have:
|
||||
|
||||
- ``otherSide: Party`` - the party with which you are trading.
|
||||
- ``notaryNode: NodeInfo`` - the entry in the network map for the chosen notary. See ":doc:`consensus`" for more
|
||||
information on notaries.
|
||||
- ``assetToSell: StateAndRef<OwnableState>`` - a pointer to the ledger entry that represents the thing being sold.
|
||||
- ``price: Amount<Currency>`` - the agreed on price that the asset is being sold for (without an issuer constraint).
|
||||
- ``myKeyPair: KeyPair`` - the key pair that controls the asset being sold. It will be used to sign the transaction.
|
||||
|
||||
And for the buyer:
|
||||
|
||||
- ``acceptablePrice: Amount<Currency>`` - the price that was agreed upon out of band. If the seller specifies
|
||||
a price less than or equal to this, then the trade will go ahead.
|
||||
- ``typeToBuy: Class<out OwnableState>`` - the type of state that is being purchased. This is used to check that the
|
||||
sell side of the flow isn't trying to sell us the wrong thing, whether by accident or on purpose.
|
||||
|
||||
Alright, so using this flow shouldn't be too hard: in the simplest case we can just create a Buyer or Seller
|
||||
with the details of the trade, depending on who we are. We then have to start the flow in some way. Just
|
||||
calling the ``call`` function ourselves won't work: instead we need to ask the framework to start the flow for
|
||||
us. More on that in a moment.
|
||||
|
||||
Suspendable functions
|
||||
---------------------
|
||||
|
||||
The ``call`` function of the buyer/seller classes is marked with the ``@Suspendable`` annotation. What does this mean?
|
||||
|
||||
As mentioned above, our flow framework will at points suspend the code and serialise it to disk. For this to work,
|
||||
any methods on the call stack must have been pre-marked as ``@Suspendable`` so the bytecode rewriter knows to modify
|
||||
the underlying code to support this new feature. A flow is suspended when calling either ``receive``, ``send`` or
|
||||
``sendAndReceive`` which we will learn more about below. For now, just be aware that when one of these methods is
|
||||
invoked, all methods on the stack must have been marked. If you forget, then in the unit test environment you will
|
||||
get a useful error message telling you which methods you didn't mark. The fix is simple enough: just add the annotation
|
||||
and try again.
|
||||
|
||||
.. note:: Java 9 is likely to remove this pre-marking requirement completely.
|
||||
|
||||
Starting your flow
|
||||
------------------
|
||||
|
||||
The ``StateMachineManager`` is the class responsible for taking care of all running flows in a node. It knows
|
||||
how to register handlers with the messaging system (see ":doc:`messaging`") and iterate the right state machine
|
||||
when messages arrive. It provides the send/receive/sendAndReceive calls that let the code request network
|
||||
interaction and it will save/restore serialised versions of the fiber at the right times.
|
||||
|
||||
Flows can be invoked in several ways. For instance, they can be triggered by scheduled events,
|
||||
see ":doc:`event-scheduling`" to learn more about this. Or they can be triggered via the HTTP API. Or they can
|
||||
be triggered directly via the Java-level node APIs from your app code.
|
||||
|
||||
You request a flow to be invoked by using the ``ServiceHub.invokeFlowAsync`` method. This takes a
|
||||
Java reflection ``Class`` object that describes the flow class to use (in this case, either ``Buyer`` or ``Seller``).
|
||||
It also takes a set of arguments to pass to the constructor. Because it's possible for flow invocations to
|
||||
be requested by untrusted code (e.g. a state that you have been sent), the types that can be passed into the
|
||||
flow are checked against a whitelist, which can be extended by apps themselves at load time.
|
||||
|
||||
The process of starting a flow returns a ``ListenableFuture`` that you can use to either block waiting for
|
||||
the result, or register a callback that will be invoked when the result is ready.
|
||||
|
||||
In a two party flow only one side is to be manually started using ``ServiceHub.invokeFlowAsync``. The other side
|
||||
has to be registered by its node to respond to the initiating flow via ``ServiceHubInternal.registerFlowInitiator``.
|
||||
In our example it doesn't matter which flow is the initiator and which is the initiated. For example, if we are to
|
||||
take the seller as the initiator then we would register the buyer as such:
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
val services: ServiceHubInternal = TODO()
|
||||
|
||||
services.registerFlowInitiator(Seller::class) { otherParty ->
|
||||
val notary = services.networkMapCache.notaryNodes[0]
|
||||
val acceptablePrice = TODO()
|
||||
val typeToBuy = TODO()
|
||||
Buyer(otherParty, notary, acceptablePrice, typeToBuy)
|
||||
}
|
||||
|
||||
This is telling the buyer node to fire up an instance of ``Buyer`` (the code in the lambda) when the initiating flow
|
||||
is a seller (``Seller::class``).
|
||||
|
||||
Implementing the seller
|
||||
-----------------------
|
||||
|
||||
Let's implement the ``Seller.call`` method. This will be run when the flow is invoked.
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
@Suspendable
|
||||
override fun call(): SignedTransaction {
|
||||
val partialTX: SignedTransaction = receiveAndCheckProposedTransaction()
|
||||
val ourSignature: DigitalSignature.WithKey = computeOurSignature(partialTX)
|
||||
val allPartySignedTx = partialTX + ourSignature
|
||||
val notarySignature = getNotarySignature(allPartySignedTx)
|
||||
val result: SignedTransaction = sendSignatures(allPartySignedTx, ourSignature, notarySignature)
|
||||
return result
|
||||
}
|
||||
|
||||
Here we see the outline of the procedure. We receive a proposed trade transaction from the buyer and check that it's
|
||||
valid. The buyer has already attached their signature before sending it. Then we calculate and attach our own signature so that the transaction is
|
||||
now signed by both the buyer and the seller. We then send this request to a notary to assert with another signature that the
|
||||
timestamp in the transaction (if any) is valid and there are no double spends, and send back both
|
||||
our signature and the notaries signature. Note we should not send to the notary until all other required signatures have been appended
|
||||
as the notary may validate the signatures as well as verifying for itself the transactional integrity.
|
||||
Finally, we hand back to the code that invoked the flow the finished transaction.
|
||||
|
||||
Let's fill out the ``receiveAndCheckProposedTransaction()`` method.
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
@Suspendable
|
||||
private fun receiveAndCheckProposedTransaction(): SignedTransaction {
|
||||
// Make the first message we'll send to kick off the flow.
|
||||
val hello = SellerTradeInfo(assetToSell, price, myKeyPair.public)
|
||||
|
||||
val maybeSTX = sendAndReceive<SignedTransaction>(otherSide, hello)
|
||||
|
||||
maybeSTX.unwrap {
|
||||
// Check that the tx proposed by the buyer is valid.
|
||||
val missingSigs: Set<PublicKey> = it.verifySignatures(throwIfSignaturesAreMissing = false)
|
||||
val expected = setOf(myKeyPair.public, notaryNode.identity.owningKey)
|
||||
if (missingSigs != expected)
|
||||
throw SignatureException("The set of missing signatures is not as expected: ${missingSigs.toStringsShort()} vs ${expected.toStringsShort()}")
|
||||
|
||||
val wtx: WireTransaction = it.tx
|
||||
logger.trace { "Received partially signed transaction: ${it.id}" }
|
||||
|
||||
// Download and check all the things that this transaction depends on and verify it is contract-valid,
|
||||
// even though it is missing signatures.
|
||||
subFlow(ResolveTransactionsFlow(wtx, otherSide))
|
||||
|
||||
if (wtx.outputs.map { it.data }.sumCashBy(myKeyPair.public).withoutIssuer() != price)
|
||||
throw IllegalArgumentException("Transaction is not sending us the right amount of cash")
|
||||
|
||||
return it
|
||||
}
|
||||
}
|
||||
|
||||
Let's break this down. We fill out the initial flow message with the trade info, and then call ``sendAndReceive``.
|
||||
This function takes a few arguments:
|
||||
|
||||
- The party on the other side.
|
||||
- The thing to send. It'll be serialised and sent automatically.
|
||||
- Finally a type argument, which is the kind of object we're expecting to receive from the other side. If we get
|
||||
back something else an exception is thrown.
|
||||
|
||||
Once ``sendAndReceive`` is called, the call method will be suspended into a continuation and saved to persistent
|
||||
storage. If the node crashes or is restarted, the flow will effectively continue as if nothing had happened. Your
|
||||
code may remain blocked inside such a call for seconds, minutes, hours or even days in the case of a flow that
|
||||
needs human interaction!
|
||||
|
||||
.. note:: There are a couple of rules you need to bear in mind when writing a class that will be used as a continuation.
|
||||
The first is that anything on the stack when the function is suspended will be stored into the heap and kept alive by
|
||||
the garbage collector. So try to avoid keeping enormous data structures alive unless you really have to.
|
||||
|
||||
The second is that as well as being kept on the heap, objects reachable from the stack will be serialised. The state
|
||||
of the function call may be resurrected much later! Kryo doesn't require objects be marked as serialisable, but even so,
|
||||
doing things like creating threads from inside these calls would be a bad idea. They should only contain business
|
||||
logic and only do I/O via the methods exposed by the flow framework.
|
||||
|
||||
It's OK to keep references around to many large internal node services though: these will be serialised using a
|
||||
special token that's recognised by the platform, and wired up to the right instance when the continuation is
|
||||
loaded off disk again.
|
||||
|
||||
The buyer is supposed to send us a transaction with all the right inputs/outputs/commands in response to the opening
|
||||
message, with their cash put into the transaction and their signature on it authorising the movement of the cash.
|
||||
|
||||
You get back a simple wrapper class, ``UntrustworthyData<SignedTransaction>``, which is just a marker class that reminds
|
||||
us that the data came from a potentially malicious external source and may have been tampered with or be unexpected in
|
||||
other ways. It doesn't add any functionality, but acts as a reminder to "scrub" the data before use.
|
||||
|
||||
Our "scrubbing" has three parts:
|
||||
|
||||
1. Check that the expected signatures are present and correct. At this point we expect our own signature to be missing,
|
||||
because of course we didn't sign it yet, and also the signature of the notary because that must always come last.
|
||||
2. We resolve the transaction, which we will cover below.
|
||||
3. We verify that the transaction is paying us the demanded price.
|
||||
|
||||
Sub-flows
|
||||
---------
|
||||
|
||||
Flows can be composed via nesting. Invoking a sub-flow looks similar to an ordinary function call:
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
@Suspendable
|
||||
private fun getNotarySignature(stx: SignedTransaction): DigitalSignature.LegallyIdentifiable {
|
||||
progressTracker.currentStep = NOTARY
|
||||
return subFlow(NotaryFlow.Client(stx))
|
||||
}
|
||||
|
||||
In this code snippet we are using the ``NotaryFlow.Client`` to request notarisation of the transaction.
|
||||
We simply create the flow object via its constructor, and then pass it to the ``subFlow`` method which
|
||||
returns the result of the flow's execution directly. Behind the scenes all this is doing is wiring up progress
|
||||
tracking (discussed more below) and then running the objects ``call`` method. Because this little helper method can
|
||||
be on the stack when network IO takes place, we mark it as ``@Suspendable``.
|
||||
|
||||
Going back to the previous code snippet, we use a sub-flow called ``ResolveTransactionsFlow``. This is
|
||||
responsible for downloading and checking all the dependencies of a transaction, which in Corda are always retrievable
|
||||
from the party that sent you a transaction that uses them. This flow returns a list of ``LedgerTransaction``
|
||||
objects, but we don't need them here so we just ignore the return value.
|
||||
|
||||
.. note:: Transaction dependency resolution assumes that the peer you got the transaction from has all of the
|
||||
dependencies itself. It must do, otherwise it could not have convinced itself that the dependencies were themselves
|
||||
valid. It's important to realise that requesting only the transactions we require is a privacy leak, because if
|
||||
we don't download a transaction from the peer, they know we must have already seen it before. Fixing this privacy
|
||||
leak will come later.
|
||||
|
||||
After the dependencies, we check the proposed trading transaction for validity by running the contracts for that as
|
||||
well (but having handled the fact that some signatures are missing ourselves).
|
||||
|
||||
Here's the rest of the code:
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
open fun computeOurSignature(partialTX: SignedTransaction) = myKeyPair.signWithECDSA(partialTX.txBits)
|
||||
|
||||
@Suspendable
|
||||
private fun sendSignatures(allPartySignedTX: SignedTransaction, ourSignature: DigitalSignature.WithKey,
|
||||
notarySignature: DigitalSignature.LegallyIdentifiable): SignedTransaction {
|
||||
val fullySigned = allPartySignedTX + notarySignature
|
||||
logger.trace { "Built finished transaction, sending back to secondary!" }
|
||||
send(otherSide, SignaturesFromSeller(ourSignature, notarySignature))
|
||||
return fullySigned
|
||||
}
|
||||
|
||||
It's all pretty straightforward from now on. Here ``txBits`` is the raw byte array representing the serialised
|
||||
transaction, and we just use our private key to calculate a signature over it. As a reminder, in Corda signatures do
|
||||
not cover other signatures: just the core of the transaction data.
|
||||
|
||||
In ``sendSignatures``, we take the two signatures we obtained and add them to the partial transaction we were sent.
|
||||
There is an overload for the + operator so signatures can be added to a SignedTransaction easily. Finally, we wrap the
|
||||
two signatures in a simple wrapper message class and send it back. The send won't block waiting for an acknowledgement,
|
||||
but the underlying message queue software will retry delivery if the other side has gone away temporarily.
|
||||
|
||||
You can also see that every flow instance has a logger (using the SLF4J API) which you can use to log progress
|
||||
messages.
|
||||
|
||||
.. warning:: This sample code is **not secure**. Other than not checking for all possible invalid constructions, if the
|
||||
seller stops before sending the finalised transaction to the buyer, the seller is left with a valid transaction
|
||||
but the buyer isn't, so they can't spend the asset they just purchased! This sort of thing will be fixed in a
|
||||
future version of the code.
|
||||
|
||||
Implementing the buyer
|
||||
----------------------
|
||||
|
||||
OK, let's do the same for the buyer side:
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
@Suspendable
|
||||
override fun call(): SignedTransaction {
|
||||
val tradeRequest = receiveAndValidateTradeRequest()
|
||||
val (ptx, cashSigningPubKeys) = assembleSharedTX(tradeRequest)
|
||||
val stx = signWithOurKeys(cashSigningPubKeys, ptx)
|
||||
|
||||
val signatures = swapSignaturesWithSeller(stx)
|
||||
|
||||
logger.trace { "Got signatures from seller, verifying ... " }
|
||||
|
||||
val fullySigned = stx + signatures.sellerSig + signatures.notarySig
|
||||
fullySigned.verifySignatures()
|
||||
|
||||
logger.trace { "Signatures received are valid. Trade complete! :-)" }
|
||||
return fullySigned
|
||||
}
|
||||
|
||||
@Suspendable
|
||||
private fun receiveAndValidateTradeRequest(): SellerTradeInfo {
|
||||
// Wait for a trade request to come in from the other side
|
||||
val maybeTradeRequest = receive<SellerTradeInfo>(otherParty)
|
||||
maybeTradeRequest.unwrap {
|
||||
// What is the seller trying to sell us?
|
||||
val asset = it.assetForSale.state.data
|
||||
val assetTypeName = asset.javaClass.name
|
||||
logger.trace { "Got trade request for a $assetTypeName: ${it.assetForSale}" }
|
||||
|
||||
if (it.price > acceptablePrice)
|
||||
throw UnacceptablePriceException(it.price)
|
||||
if (!typeToBuy.isInstance(asset))
|
||||
throw AssetMismatchException(typeToBuy.name, assetTypeName)
|
||||
|
||||
// Check the transaction that contains the state which is being resolved.
|
||||
// We only have a hash here, so if we don't know it already, we have to ask for it.
|
||||
subFlow(ResolveTransactionsFlow(setOf(it.assetForSale.ref.txhash), otherSide))
|
||||
|
||||
return it
|
||||
}
|
||||
}
|
||||
|
||||
@Suspendable
|
||||
private fun swapSignaturesWithSeller(stx: SignedTransaction): SignaturesFromSeller {
|
||||
progressTracker.currentStep = SWAPPING_SIGNATURES
|
||||
logger.trace { "Sending partially signed transaction to seller" }
|
||||
|
||||
// TODO: Protect against the seller terminating here and leaving us in the lurch without the final tx.
|
||||
|
||||
return sendAndReceive<SignaturesFromSeller>(otherSide, stx).unwrap { it }
|
||||
}
|
||||
|
||||
private fun signWithOurKeys(cashSigningPubKeys: List<PublicKey>, ptx: TransactionBuilder): SignedTransaction {
|
||||
// Now sign the transaction with whatever keys we need to move the cash.
|
||||
for (k in cashSigningPubKeys) {
|
||||
val priv = serviceHub.keyManagementService.toPrivate(k)
|
||||
ptx.signWith(KeyPair(k, priv))
|
||||
}
|
||||
|
||||
return ptx.toSignedTransaction(checkSufficientSignatures = false)
|
||||
}
|
||||
|
||||
private fun assembleSharedTX(tradeRequest: SellerTradeInfo): Pair<TransactionBuilder, List<PublicKey>> {
|
||||
val ptx = TransactionType.General.Builder(notary)
|
||||
// Add input and output states for the movement of cash, by using the Cash contract to generate the states.
|
||||
val wallet = serviceHub.walletService.currentWallet
|
||||
val cashStates = wallet.statesOfType<Cash.State>()
|
||||
val cashSigningPubKeys = Cash().generateSpend(ptx, tradeRequest.price, tradeRequest.sellerOwnerKey, cashStates)
|
||||
// Add inputs/outputs/a command for the movement of the asset.
|
||||
ptx.addInputState(tradeRequest.assetForSale)
|
||||
// Just pick some new public key for now. This won't be linked with our identity in any way, which is what
|
||||
// we want for privacy reasons: the key is here ONLY to manage and control ownership, it is not intended to
|
||||
// reveal who the owner actually is. The key management service is expected to derive a unique key from some
|
||||
// initial seed in order to provide privacy protection.
|
||||
val freshKey = serviceHub.keyManagementService.freshKey()
|
||||
val (command, state) = tradeRequest.assetForSale.state.data.withNewOwner(freshKey.public)
|
||||
ptx.addOutputState(state, tradeRequest.assetForSale.state.notary)
|
||||
ptx.addCommand(command, tradeRequest.assetForSale.state.data.owner)
|
||||
|
||||
// And add a request for timestamping: it may be that none of the contracts need this! But it can't hurt
|
||||
// to have one.
|
||||
val currentTime = serviceHub.clock.instant()
|
||||
ptx.setTime(currentTime, 30.seconds)
|
||||
return Pair(ptx, cashSigningPubKeys)
|
||||
}
|
||||
|
||||
This code is longer but no more complicated. Here are some things to pay attention to:
|
||||
|
||||
1. We do some sanity checking on the received message to ensure we're being offered what we expected to be offered.
|
||||
2. We create a cash spend in the normal way, by using ``Cash().generateSpend``. See the contracts tutorial if this
|
||||
part isn't clear.
|
||||
3. We access the *service hub* when we need it to access things that are transient and may change or be recreated
|
||||
whilst a flow is suspended, things like the wallet or the network map.
|
||||
4. Finally, we send the unfinished, invalid transaction to the seller so they can sign it. They are expected to send
|
||||
back to us a ``SignaturesFromSeller``, which once we verify it, should be the final outcome of the trade.
|
||||
|
||||
As you can see, the flow logic is straightforward and does not contain any callbacks or network glue code, despite
|
||||
the fact that it takes minimal resources and can survive node restarts.
|
||||
|
||||
.. warning:: In the current version of the platform, exceptions thrown during flow execution are not propagated
|
||||
back to the sender. A thorough error handling and exceptions framework will be in a future version of the platform.
|
||||
|
||||
Progress tracking
|
||||
-----------------
|
||||
|
||||
Not shown in the code snippets above is the usage of the ``ProgressTracker`` API. Progress tracking exports information
|
||||
from a flow about where it's got up to in such a way that observers can render it in a useful manner to humans who
|
||||
may need to be informed. It may be rendered via an API, in a GUI, onto a terminal window, etc.
|
||||
|
||||
A ``ProgressTracker`` is constructed with a series of ``Step`` objects, where each step is an object representing a
|
||||
stage in a piece of work. It is therefore typical to use singletons that subclass ``Step``, which may be defined easily
|
||||
in one line when using Kotlin. Typical steps might be "Waiting for response from peer", "Waiting for signature to be
|
||||
approved", "Downloading and verifying data" etc.
|
||||
|
||||
Each step exposes a label. By default labels are fixed, but by subclassing ``RelabelableStep``
|
||||
you can make a step that can update its label on the fly. That's useful for steps that want to expose non-structured
|
||||
progress information like the current file being downloaded. By defining your own step types, you can export progress
|
||||
in a way that's both human readable and machine readable.
|
||||
|
||||
Progress trackers are hierarchical. Each step can be the parent for another tracker. By altering the
|
||||
``ProgressTracker.childrenFor[step] = tracker`` map, a tree of steps can be created. It's allowed to alter the hierarchy
|
||||
at runtime, on the fly, and the progress renderers will adapt to that properly. This can be helpful when you don't
|
||||
fully know ahead of time what steps will be required. If you _do_ know what is required, configuring as much of the
|
||||
hierarchy ahead of time is a good idea, as that will help the users see what is coming up.
|
||||
|
||||
Every tracker has not only the steps given to it at construction time, but also the singleton
|
||||
``ProgressTracker.UNSTARTED`` step and the ``ProgressTracker.DONE`` step. Once a tracker has become ``DONE`` its
|
||||
position may not be modified again (because e.g. the UI may have been removed/cleaned up), but until that point, the
|
||||
position can be set to any arbitrary set both forwards and backwards. Steps may be skipped, repeated, etc. Note that
|
||||
rolling the current step backwards will delete any progress trackers that are children of the steps being reversed, on
|
||||
the assumption that those subtasks will have to be repeated.
|
||||
|
||||
Trackers provide an `Rx observable <http://reactivex.io/>`_ which streams changes to the hierarchy. The top level
|
||||
observable exposes all the events generated by its children as well. The changes are represented by objects indicating
|
||||
whether the change is one of position (i.e. progress), structure (i.e. new subtasks being added/removed) or some other
|
||||
aspect of rendering (i.e. a step has changed in some way and is requesting a re-render).
|
||||
|
||||
The flow framework is somewhat integrated with this API. Each ``FlowLogic`` may optionally provide a tracker by
|
||||
overriding the ``flowTracker`` property (``getFlowTracker`` method in Java). If the
|
||||
``FlowLogic.subFlow`` method is used, then the tracker of the sub-flow will be made a child of the current
|
||||
step in the parent flow automatically, if the parent is using tracking in the first place. The framework will also
|
||||
automatically set the current step to ``DONE`` for you, when the flow is finished.
|
||||
|
||||
Because a flow may sometimes wish to configure the children in its progress hierarchy _before_ the sub-flow
|
||||
is constructed, for sub-flows that always follow the same outline regardless of their parameters it's conventional
|
||||
to define a companion object/static method (for Kotlin/Java respectively) that constructs a tracker, and then allow
|
||||
the sub-flow to have the tracker it will use be passed in as a parameter. This allows all trackers to be built
|
||||
and linked ahead of time.
|
||||
|
||||
In future, the progress tracking framework will become a vital part of how exceptions, errors, and other faults are
|
||||
surfaced to human operators for investigation and resolution.
|
||||
|
||||
Unit testing
|
||||
------------
|
||||
|
||||
A flow can be a fairly complex thing that interacts with many services and other parties over the network. That
|
||||
means unit testing one requires some infrastructure to provide lightweight mock implementations. The MockNetwork
|
||||
provides this testing infrastructure layer; you can find this class in the node module
|
||||
|
||||
A good example to examine for learning how to unit test flows is the ``ResolveTransactionsFlow`` tests. This
|
||||
flow takes care of downloading and verifying transaction graphs, with all the needed dependencies. We start
|
||||
with this basic skeleton:
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
class ResolveTransactionsFlowTest {
|
||||
lateinit var net: MockNetwork
|
||||
lateinit var a: MockNetwork.MockNode
|
||||
lateinit var b: MockNetwork.MockNode
|
||||
lateinit var notary: Party
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
net = MockNetwork()
|
||||
val nodes = net.createSomeNodes()
|
||||
a = nodes.partyNodes[0]
|
||||
b = nodes.partyNodes[1]
|
||||
notary = nodes.notaryNode.info.identity
|
||||
net.runNetwork()
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
net.stopNodes()
|
||||
}
|
||||
}
|
||||
|
||||
We create a mock network in our ``@Before`` setup method and create a couple of nodes. We also record the identity
|
||||
of the notary in our test network, which will come in handy later. We also tidy up when we're done.
|
||||
|
||||
Next, we write a test case:
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
@Test
|
||||
fun resolveFromTwoHashes() {
|
||||
val (stx1, stx2) = makeTransactions()
|
||||
val p = ResolveTransactionsFlow(setOf(stx2.id), a.info.identity)
|
||||
val future = b.services.startFlow("resolve", p)
|
||||
net.runNetwork()
|
||||
val results = future.get()
|
||||
assertEquals(listOf(stx1.id, stx2.id), results.map { it.id })
|
||||
assertEquals(stx1, b.storage.validatedTransactions.getTransaction(stx1.id))
|
||||
assertEquals(stx2, b.storage.validatedTransactions.getTransaction(stx2.id))
|
||||
}
|
||||
|
||||
We'll take a look at the ``makeTransactions`` function in a moment. For now, it's enough to know that it returns two
|
||||
``SignedTransaction`` objects, the second of which spends the first. Both transactions are known by node A
|
||||
but not node B.
|
||||
|
||||
The test logic is simple enough: we create the flow, giving it node A's identity as the target to talk to.
|
||||
Then we start it on node B and use the ``net.runNetwork()`` method to bounce messages around until things have
|
||||
settled (i.e. there are no more messages waiting to be delivered). All this is done using an in memory message
|
||||
routing implementation that is fast to initialise and use. Finally, we obtain the result of the flow and do
|
||||
some tests on it. We also check the contents of node B's database to see that the flow had the intended effect
|
||||
on the node's persistent state.
|
||||
|
||||
Here's what ``makeTransactions`` looks like:
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
private fun makeTransactions(): Pair<SignedTransaction, SignedTransaction> {
|
||||
// Make a chain of custody of dummy states and insert into node A.
|
||||
val dummy1: SignedTransaction = DummyContract.generateInitial(MEGA_CORP.ref(1), 0, notary).let {
|
||||
it.signWith(MEGA_CORP_KEY)
|
||||
it.signWith(DUMMY_NOTARY_KEY)
|
||||
it.toSignedTransaction(false)
|
||||
}
|
||||
val dummy2: SignedTransaction = DummyContract.move(dummy1.tx.outRef(0), MINI_CORP_PUBKEY).let {
|
||||
it.signWith(MEGA_CORP_KEY)
|
||||
it.signWith(DUMMY_NOTARY_KEY)
|
||||
it.toSignedTransaction()
|
||||
}
|
||||
a.services.recordTransactions(dummy1, dummy2)
|
||||
return Pair(dummy1, dummy2)
|
||||
}
|
||||
|
||||
We're using the ``DummyContract``, a simple test smart contract which stores a single number in its states, along
|
||||
with ownership and issuer information. You can issue such states, exit them and re-assign ownership (move them).
|
||||
It doesn't do anything else. This code simply creates a transaction that issues a dummy state (the issuer is
|
||||
``MEGA_CORP``, a pre-defined unit test identity), signs it with the test notary and MegaCorp keys and then
|
||||
converts the builder to the final ``SignedTransaction``. It then does so again, but this time instead of issuing
|
||||
it re-assigns ownership instead. The chain of two transactions is finally committed to node A by sending them
|
||||
directly to the ``a.services.recordTransaction`` method (note that this method doesn't check the transactions are
|
||||
valid).
|
||||
|
||||
And that's it: you can explore the documentation for the `MockNode API <api/net.corda.node.internal.testing/-mock-network/index.html>`_ here.
|
||||
|
||||
Versioning
|
||||
----------
|
||||
|
||||
Fibers involve persisting object-serialised stack frames to disk. Although we may do some R&D into in-place upgrades
|
||||
in future, for now the upgrade process for flows is simple: you duplicate the code and rename it so it has a
|
||||
new set of class names. Old versions of the flow can then drain out of the system whilst new versions are
|
||||
initiated. When enough time has passed that no old versions are still waiting for anything to happen, the previous
|
||||
copy of the code can be deleted.
|
||||
|
||||
Whilst kind of ugly, this is a very simple approach that should suffice for now.
|
||||
|
||||
.. warning:: Flows are not meant to live for months or years, and by implication they are not meant to implement entire deal
|
||||
lifecycles. For instance, implementing the entire life cycle of an interest rate swap as a single flow - whilst
|
||||
technically possible - would not be a good idea. The platform provides a job scheduler tool that can invoke
|
||||
flows for this reason (see ":doc:`event-scheduling`")
|
||||
|
||||
Future features
|
||||
---------------
|
||||
|
||||
The flow framework is a key part of the platform and will be extended in major ways in future. Here are some of
|
||||
the features we have planned:
|
||||
|
||||
* Identity based addressing
|
||||
* Exposing progress trackers to local (inside the firewall) clients using message queues and/or WebSockets
|
||||
* Exception propagation and management, with a "flow hospital" tool to manually provide solutions to unavoidable
|
||||
problems (e.g. the other side doesn't know the trade)
|
||||
* Being able to interact with internal apps and tools via HTTP and similar
|
||||
* Being able to interact with people, either via some sort of external ticketing system, or email, or a custom UI.
|
||||
For example to implement human transaction authorisations.
|
||||
* A standard library of flows that can be easily sub-classed by local developers in order to integrate internal
|
||||
reporting logic, or anything else that might be required as part of a communications lifecycle.
|
14
docs/build/html/_sources/further-notes-on-kotlin.txt
vendored
Normal file
14
docs/build/html/_sources/further-notes-on-kotlin.txt
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
Further notes on Kotlin
|
||||
-----------------------
|
||||
|
||||
Corda is written in a language called `Kotlin <https://kotlinlang.org/>`_. Kotlin is a language that targets the JVM
|
||||
and can be thought of as a simpler Scala, with much better Java interop. It is developed by and has commercial support
|
||||
from JetBrains, the makers of the IntelliJ IDE and other popular developer tools.
|
||||
|
||||
Kotlin is a relatively new language and is extremely easy to learn. It is designed as a better Java for industrial
|
||||
use and, as such, the syntax was carefully designed to be readable even to people who don't know the language, after only
|
||||
a few minutes of introduction. Additionally, at R3, we find that all of our developers are up to productive writing speed
|
||||
in Kotlin within their first week.
|
||||
|
||||
Due to the seamless Java interop the use of Kotlin to extend the platform is *not* required and the tutorial shows how
|
||||
to write contracts in both Kotlin and Java. You can `read more about why Kotlin is a potentially strong successor to Java here <https://medium.com/@octskyward/why-kotlin-is-my-next-programming-language-c25c001e26e3>`_.
|
74
docs/build/html/_sources/getting-set-up-fault-finding.txt
vendored
Normal file
74
docs/build/html/_sources/getting-set-up-fault-finding.txt
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
Getting Set Up : Faultfinding
|
||||
=============================
|
||||
|
||||
IntelliJ issues
|
||||
---------------
|
||||
|
||||
If IntelliJ complains about lack of an SDK
|
||||
******************************************
|
||||
|
||||
If on attempting to open the project (including importing Gradle project), IntelliJ refuses because an SDK was not selected,
|
||||
you may need to fix the project structure. Do this by following `these instructions <https://www.jetbrains.com/help/idea/2016.2/configuring-global-project-and-module-sdks.html>`_. The correct JDK is often found at a path such as ``jdk1.8.0_xx…/Contents/Home``
|
||||
|
||||
Ensure that you have the Project language level set at as 8. If you are having trouble selecting the correct JDK, the
|
||||
Jetbrains website offers the `following guidelines <https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under>`_.
|
||||
|
||||
Kotlin issues
|
||||
-------------
|
||||
|
||||
Installation
|
||||
************
|
||||
|
||||
There are two ways to configure Kotlin from IntelliJ. One way is via the initial project opening screen in which you will
|
||||
need to use the ``Configure > Plugins`` tab. The other way is when you are in an open project, then you will need to
|
||||
configure it via (on Mac) ``IntelliJ -> Preferences ...``, whereas on PC it is ``File -> Settings``. Select the plugins
|
||||
bar, confirm that Kotlin is installed and up to date.
|
||||
|
||||
If you are having trouble installing Kotlin, first try upgrading the Kotlin plugin. At the time of writing, you can
|
||||
confirm what is the latest version of the Kotlin plugin on `this page <https://plugins.jetbrains.com/plugin/6954>`_.
|
||||
|
||||
|
||||
Gradle issues
|
||||
-------------
|
||||
|
||||
Gradle within IntelliJ
|
||||
**********************
|
||||
|
||||
After you have updated your code to the latest version from git, ensure that the gradle project is imported. Although
|
||||
gradle is used via the command line, it is also integrated with IntelliJ in order for IntelliJ to determine dependencies
|
||||
and index the project correctly.
|
||||
|
||||
When opening a project for the first time, you should see the "Unlinked Gradle project?" pop-up window in the IntelliJ top
|
||||
right corner or in a popup alert window. If you miss this, it will also appear in the "Event Log" windows which can be
|
||||
opened by clicking on "Event Log" at the bottom right of the IntelliJ window. Either way, click on "Import Gradle Project".
|
||||
|
||||
.. image:: resources/unlinked-gradle.png
|
||||
:height: 50 px
|
||||
:width: 410 px
|
||||
:alt: IntelliJ Gradle Prompt
|
||||
|
||||
Wait for it to think and download the dependencies. After that you might have another popup titled "Unindexed remote maven repositories found." This is a general IntelliJ question and doesn't affect Corda, therefore you can decided to index them or not. Next click on the "green arrow" next to "All tests" pop-up on the top toolbar.
|
||||
|
||||
The code should build, the unit tests should show as all green.
|
||||
|
||||
If still have problems, the Jetbrains website has more information on `gradle here <https://www.jetbrains.com/help/idea/2016.2/working-with-gradle-projects.html>`_.
|
||||
|
||||
Gradle via the CLI
|
||||
******************
|
||||
|
||||
Gradle commands can also be run in the command line - further details of command line gradle can be found in
|
||||
|
||||
.. TODO: add gradle cmd line doc link here
|
||||
|
||||
Doing it without IntelliJ
|
||||
-------------------------
|
||||
|
||||
If you don't want to explore or modify the code in a local IDE, you can also just use the command line and a text editor:
|
||||
|
||||
* First run ``git clone https://github.com/corda/corda`` to download Corda core source code
|
||||
|
||||
* Next ensure that you are in correct directory ``cd corda``
|
||||
|
||||
* Then you can run ``./gradlew test`` to run the unit tests.
|
||||
|
||||
* Finally remember to run ``git pull`` occasionally to upgrade the source code to the latest revision
|
83
docs/build/html/_sources/getting-set-up.txt
vendored
83
docs/build/html/_sources/getting-set-up.txt
vendored
@ -1,61 +1,74 @@
|
||||
Getting set up
|
||||
==============
|
||||
|
||||
Ensure that you have access to R3 git repository.
|
||||
We have tried to make access to Corda as relatively simple as possible, using industry standard established tools.
|
||||
Although it is possible to replace any of the recommendations below, we will find it a lot easier to support your efforts
|
||||
if you follow our guidelines. Saying that, we are also interested in problems that arise due to different configurations.
|
||||
|
||||
https://bitbucket.org/R3-CEV/r3prototyping.git
|
||||
A JVM
|
||||
-----
|
||||
|
||||
If you cannot access the page please contact the R3 admin team.
|
||||
Corda runs in a JVM and is written predominantly in Kotlin with some example use cases demonstrated in Java that we have
|
||||
incorporated to demonstrate that Kotlin and Java can work seemlessly together. We recommend the most recent production
|
||||
version of Java 8. The JDK can be obtained `from Oracle <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_.
|
||||
Other implementations of the JVM are not actively supported, but as mentioned, we are interested in finding out any issues you
|
||||
do have with them.
|
||||
|
||||
Install the Oracle JDK 8u45 or higher. OpenJDK will probably also work, but it hasn't been tested.
|
||||
IntelliJ
|
||||
--------
|
||||
We strongly recommend the use of IntelliJ's Development Environment known as IDEA. Download it for free from
|
||||
`JetBrains <https://www.jetbrains.com/idea/download/>`_. The primary reason we recommend this particular IDE is that it integrates
|
||||
very well with our choice of language for Corda, "Kotlin", as Jetbrains also support the development of Kotlin.
|
||||
|
||||
Then install IntelliJ. The Community Edition is good enough:
|
||||
|
||||
https://www.jetbrains.com/idea/download/
|
||||
Kotlin
|
||||
------
|
||||
Kotlin is available as a downloadable plugin to IntelliJ. Refer to IntelliJ's instructions on
|
||||
`getting Started with Kotlin and IntelliJ <https://kotlinlang.org/docs/tutorials/getting-started.html>`_. Additionally,
|
||||
if you would like to start getting to grips with the Kotlin language, then we strongly recommend you work through some
|
||||
of the tutorials (known as "koans") as well. Also see our :doc:`further-notes-on-kotlin`.
|
||||
|
||||
Upgrade the Kotlin plugin to the latest version by clicking "Configure > Plugins" in the opening screen,
|
||||
then clicking "Install JetBrains plugin", then searching for Kotlin, then hitting "Upgrade" and then "Restart".
|
||||
You can confirm what is the latest version of Kotlin plugin on this page:
|
||||
|
||||
https://plugins.jetbrains.com/plugin/6954
|
||||
Version Control via Git
|
||||
-----------------------
|
||||
|
||||
Choose "Check out from version control" and use this git URL. Please remember to replace your_username with your
|
||||
actual bitbucket user name.
|
||||
We use git to version control Corda. The authorative place to obtain git is from the main `git website <https://git-scm.com/downloads>`_
|
||||
but it may be the case that your operating system provides git with a supported utility (e.g. for Apple, git is provided along
|
||||
with XCode - their free development environment). If this is the case, we would recommend you obtain git via that
|
||||
supported route.
|
||||
|
||||
https://your_username@bitbucket.org/R3-CEV/r3prototyping.git
|
||||
You will need the command line package installed which you can then use natively (via the command line) or via IntelliJ
|
||||
(in which case you may need to configure IntelliJ to recognise where git has been installed on your system). IntelliJ and
|
||||
git configuration are quite seemless although the first time you use it, you will have to configure IntelliJ the location
|
||||
of your git command installation. More details regarding this can be found
|
||||
on the `JetBrains website <https://www.jetbrains.com/help/idea/2016.2/using-git-integration.html>`_
|
||||
|
||||
After code is cloned open the project. Please ensure that Gradle project is imported.
|
||||
You should have the "Unliked Gradle project?" pop-up window in the IntelliJ top right corner. Please click on "Import Gradle Project". Wait for it to think and download the dependencies. After that you might have another popup titled "Unindexed remote maven repositories found." This is general IntelliJ question and doesn't affect Corda, therefore you can decided to index them or not.
|
||||
Gradle
|
||||
------
|
||||
|
||||
Next click on "green arrow" next to "All tests" pop-up on the top toolbar.
|
||||
Gradle is our primary means of building Corda and managing dependencies. IntelliJ has its own view of this and occasionally
|
||||
may need to be resynced from time to time. This can be done within IntelliJ by pressing the "gradle refresh" icon located
|
||||
on the gradle tab (generally found on the right hand side), or by following the gradle commands specific for the task you
|
||||
are performing (details expounded later). Whenever prompted about gradle, accept the defaults suggested by IntelliJ.
|
||||
|
||||
The code should build, the unit tests should show as all green.
|
||||
|
||||
You can catch up with the latest code by selecting "VCS -> Update Project" in the menu.
|
||||
Corda Source Code
|
||||
-----------------
|
||||
|
||||
If IntelliJ complains about lack of an SDK
|
||||
------------------------------------------
|
||||
You can check out the Corda platform source code from this repository:
|
||||
|
||||
If on attempting to open the project (including importing Gradle project), IntelliJ refuses because SDK was not selected, do the following:
|
||||
https://github.com/corda/corda.git
|
||||
|
||||
Configure -> Project Defaults -> Project Structure
|
||||
and a template app that you can use as a basis for experimenting with app development from:
|
||||
|
||||
on that tab:
|
||||
https://github.com/corda/cordapp-template.git
|
||||
|
||||
Project Settings / Project
|
||||
You can catch up with the latest code by selecting "VCS -> Update Project" in the IntelliJ menu.
|
||||
|
||||
click on New… next to the red <No SDK> symbol, and select JDK. It should then pop up and show the latest JDK it has
|
||||
found at something like
|
||||
|
||||
jdk1.8.0_xx…/Contents/Home
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
Also select Project language level: as 8. Click OK. Open should now work.
|
||||
See :doc:`getting-set-up-fault-finding`.
|
||||
|
||||
Doing it without IntelliJ
|
||||
-------------------------
|
||||
|
||||
If you don't want to explore or modify the code in a local IDE, you can also just use the command line and a text editor:
|
||||
* First run ``git clone https://your_username@bitbucket.org/R3-CEV/r3prototyping.git`` to download Corda source code. Please remember to replace your_username with your actual bitbucket user name.
|
||||
* Next ensure that you are in r3repository ``cd r3repository``
|
||||
* Then you can run ``./gradlew test`` to run the unit tests.
|
||||
* Finally remeber to run ``git pull`` to upgrade the source code.
|
||||
|
73
docs/build/html/_sources/glossary.txt
vendored
Normal file
73
docs/build/html/_sources/glossary.txt
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
Glossary
|
||||
========
|
||||
|
||||
Artemis
|
||||
The message queuing middleware used within Corda
|
||||
Attachment
|
||||
An attachment is a piece of data that can be referred to within a transaction but is never marked as used, i.e. can be referred to multiple times.
|
||||
Clause
|
||||
A clause is a reusable piece of code that performs transaction verification
|
||||
Command
|
||||
Used for directing a transaction, sometimes containing command data. For example, a Cash contract may include an Issue command, which signals that one of the purposes of the transaction is to issue cash on to the ledger (i.e. by creating one or more Cash outputs, without any corresponding inputs.)
|
||||
Composite Key
|
||||
A tree data structure containing regular cryptographic public keys. It allows expressing threshold signature requirements, e.g. “either Alice or Bob” needs to sign.
|
||||
Contract
|
||||
A contract is code that specifies how states are to be created and used within Corda.
|
||||
Corda
|
||||
A Distributed Ledger for recording and managing financial agreements
|
||||
CorDapp
|
||||
A Corda Distributed Application. A shared ledger application on Corda consisting of components from: State objects (data), Contract Code (allowable operations), Flows (aka Transaction Flows, the business logic choreography), any necessary APIs, wallet plugins, and UI components.
|
||||
Cordformation
|
||||
A gradle plugin that can be configured via your gradle buildscripts to locally deploy a set of Corda nodes
|
||||
Counterparty
|
||||
The other party in a financial or contract transaction
|
||||
DSL
|
||||
Domain Specific Language - a language specifically designed for a particular domain. Kotlin allows the definition of DSLs and they are used within the Corda framework.
|
||||
Flow
|
||||
The set of instructions which determines how nodes communicate over Corda with the goal of arriving at consensus.
|
||||
Fungible
|
||||
An item that can be exchanged or interchanged for another identical item, e.g. Cash (as a $10 note can be exchanged for two $5 notes), but not diamonds (as they tend to have very identifying characteristics).
|
||||
Gradle
|
||||
Industry standard build and deployment tool. Used extensively within Corda.
|
||||
Kotlin
|
||||
The language used to code Corda. Fully compatible with any JVM language, including (obviously) Java.
|
||||
Kryo
|
||||
The serialisation mechanism used within Corda - which is subject to change in a future release.
|
||||
Input
|
||||
In Corda terms, an input state is one that is used and consumed within a transaction. Once consumed, it cannot be re-used.
|
||||
JVM
|
||||
The Java Virtual Machine. The "computing machine" that Corda is executed within.
|
||||
Lizard People
|
||||
I would put their true identity in here but I fear the overlords may banish me.
|
||||
Merkle Tree
|
||||
A tree where each non leaf node is tagged with a hash of the data within that node and also the nodes beneath it. This ensures that the data in any node cannot be modified without causing hash verification failures in the parent node, and therefore all subsequent parents.
|
||||
Network Map Service
|
||||
A network service that maintains a map of node names and their network locations. Used by nodes such that they can communicate with other parties directly (after locating).
|
||||
Node
|
||||
A communication point on the Corda network and also the provider of the virtual machine in which Corda runs.
|
||||
Notary Service
|
||||
A network service that guarantees that it will only add its signature to transactions if all input states have not been consumed
|
||||
Oracle
|
||||
An oracle is a well known service that signs transactions if they state a fact and that fact is considered to be true. They may also optionally also provide the facts.
|
||||
Output
|
||||
In the Corda model, an output is a state generated from a transaction (note that multiple outputs can be generated from one transaction). They are then used as inputs for subsequent transactions.
|
||||
Protocol
|
||||
The old name for a Corda "Flow"
|
||||
Quasar
|
||||
A library that provides performant lightweight threads that can be suspended and restored extremely quickly.
|
||||
R3
|
||||
The consortium behind Corda
|
||||
SIMM
|
||||
Standard Initial Margin Model. A way of determining a counterparty's margin payment to another counterparty based on a collection of trades such that, in the event of default, the receiving counterparty has limited exposure.
|
||||
Service Hub
|
||||
A hub in each Corda node that manages the services upon which other components of the node depend. Services may include facilities for identity management, storage management, network map management etc.
|
||||
Signed Transaction
|
||||
A signed transaction is a transaction that has been agreed by all parties relevant to that transacation as well as optionally a notary if relevant.
|
||||
State
|
||||
An element of data that is output from one transaction and then used / consumed in another transaction. States can only be consumed once and this confirmation is performed by the Notary service.
|
||||
Transaction
|
||||
A transaction is the means by which states are both created and consumed. They can be designed to accept between zero and any number of input states, and then generate between zero and any number of output states.
|
||||
UTXO
|
||||
Unspent Transaction Output. First introduced by the bitcoin model, an unspent transaction is data that has been output from a transaction but not yet used in another transaction.
|
||||
Verify
|
||||
To confirm that the transaction is valid by ensuring the the outputs are correctly derived from the inputs combined with the command of the transaction.
|
46
docs/build/html/_sources/index.txt
vendored
46
docs/build/html/_sources/index.txt
vendored
@ -25,20 +25,37 @@ Read on to learn:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Overview
|
||||
:caption: Getting started
|
||||
|
||||
inthebox
|
||||
getting-set-up
|
||||
running-the-demos
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Key concepts
|
||||
|
||||
data-model
|
||||
transaction-data-types
|
||||
merkle-trees
|
||||
consensus
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: The Corda node
|
||||
|
||||
clientrpc
|
||||
messaging
|
||||
persistence
|
||||
creating-a-cordapp
|
||||
running-the-demos
|
||||
node-administration
|
||||
corda-configuration-files
|
||||
node-services
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: CorDapps
|
||||
|
||||
creating-a-cordapp
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
@ -49,24 +66,25 @@ Read on to learn:
|
||||
tutorial-contract-clauses
|
||||
tutorial-test-dsl
|
||||
tutorial-clientrpc-api
|
||||
protocol-state-machines
|
||||
flow-state-machines
|
||||
oracles
|
||||
tutorial-attachments
|
||||
event-scheduling
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Contracts
|
||||
:caption: Other
|
||||
|
||||
contract-catalogue
|
||||
contract-irs
|
||||
initialmarginagreement
|
||||
network-simulator
|
||||
node-explorer
|
||||
initial-margin-agreement
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Node API
|
||||
:caption: Component library
|
||||
|
||||
clientrpc
|
||||
contract-catalogue
|
||||
contract-irs
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
@ -76,7 +94,11 @@ Read on to learn:
|
||||
secure-coding-guidelines
|
||||
release-process
|
||||
release-notes
|
||||
network-simulator
|
||||
node-explorer
|
||||
codestyle
|
||||
building-the-docs
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Glossary
|
||||
|
||||
glossary
|
||||
|
73
docs/build/html/_sources/initial-margin-agreement.txt
vendored
Normal file
73
docs/build/html/_sources/initial-margin-agreement.txt
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
Initial Margin Agreements
|
||||
=========================
|
||||
|
||||
This app is a demonstration of how Corda can be used for the real world requirement of initial margin calculation and
|
||||
agreement; featuring the integration of complex and industry proven third party libraries into Corda nodes.
|
||||
|
||||
SIMM Introduction
|
||||
-----------------
|
||||
|
||||
SIMM is an acronym for "Standard Initial Margin Model". It is effectively the calculation of a "margin" that is paid
|
||||
by one party to another when they agree a trade on certain types of transaction. This margin is
|
||||
paid such that, in the event of one of the counterparties suffering a credit event
|
||||
(a financial term and a polite way to say defaulting, not paying the debts that are due, or potentially even bankruptcy),
|
||||
then the party that is owed any sum already has some of the amount that it should have been paid. This payment to the
|
||||
receiving party is a preventative measure in order to reduce the risk of a potentially catastrophic default domino
|
||||
effect that caused the `Great Financial Crisis <https://en.wikipedia.org/wiki/Financial_crisis_of_2007%E2%80%932008>`_,
|
||||
as it means that they can be assured that if they need to pay another party, they will have a proportion of the funds
|
||||
that they have been relying on.
|
||||
|
||||
To enact this, in September 2016, the ISDA committee - with full backing from various governing bodies -
|
||||
`issued a ruling on what is known as the ISDA SIMM ™ model <http://www2.isda.org/news/isda-simm-deployed-today-new-industry-standard-for-calculating-initial-margin-widely-adopted-by-market-participants>`_,
|
||||
a way of fairly and consistently calculating this margin. Any parties wishing to trade a financial product that is
|
||||
covered under this ruling would, independently, use this model and calculate their margin payment requirement,
|
||||
agree it with their trading counterparty and then pay (or receive, depending on the results of this calculation)
|
||||
this amount. In the case of disagreement that is not resolved in a timely fashion, this payment would increase
|
||||
and so therefore it is in the parties interest to reach agreement in a short as time frame as possible.
|
||||
|
||||
To be more accurate, the SIMM calculation is not performed on just one trade - it is calculated on an aggregate of
|
||||
intermediary values (which in this model are sensitivities to risk factors) from a portfolio of trades; therefore
|
||||
the input to a SIMM is actually this data, not the individual trades itself.
|
||||
|
||||
Also note that implementations of the SIMM are actually protected and subject to license restrictions by ISDA
|
||||
(this is due to the model itself being protected). We were fortunate enough to technically partner with
|
||||
`OpenGamma <http://www.opengamma.com>`_ who allowed us to demonstrate the SIMM process using their proprietary model.
|
||||
In the source code released, we have replaced their analytics engine with very simple stub functions that allow
|
||||
the process to run and can easily be swapped out in place for their real libraries.
|
||||
|
||||
Process steps
|
||||
-------------
|
||||
|
||||
Preliminaries
|
||||
- Ensure that there are a number of live trades with another party financial products that are covered under the
|
||||
ISDA SIMM agreement (if none, then use the demo to enter some simple trades as described below).
|
||||
|
||||
Initial Margin Agreement Process
|
||||
- Agree that one will be performing the margining calculation against a portfolio of trades with another party, and agree the trades in that portfolio. In practice, one node will start the flow but it does not matter which node does.
|
||||
- Individually (at the node level), identify the data (static, reference etc) one will need in order to be able to calculate the metrics on those trades
|
||||
- Confirm with the other counterparty the dataset from the above set
|
||||
- Calculate any intermediary steps and values needed for the margin calculation (ie sensitivities to risk factors)
|
||||
- Agree on the results of these steps
|
||||
- Calculate the initial margin
|
||||
- Agree on the calculation of the above with the other party
|
||||
- In practice, pay (or receive) this margin (omitted for the sake of complexity for this example)
|
||||
|
||||
|
||||
Running the app
|
||||
---------------
|
||||
|
||||
The demonstration can be run in two ways - via IntelliJ (which will allow you to add breakpoints, debug, etc), or via gradle and the command line.
|
||||
|
||||
Run with IntelliJ::
|
||||
|
||||
1. Open the `cordapp-samples` project with IntelliJ
|
||||
2. Run the shared run configuration "SIMM Valuation Demo"
|
||||
3. Browse to http://localhost:10005/web/simmvaluationdemo
|
||||
|
||||
Run via CLI::
|
||||
|
||||
1. Navigate to the `cordapp-samples` directory in your shell
|
||||
2. Run the gradle target `deployNodes` (ie; ./gradlew deployNodes for Unix or gradlew.bat on Windows)
|
||||
1. Unix: `cd simm-valuation-demo/build/nodes && ./runnodes`.
|
||||
2. Windows: `cd simm-valuation-demo/build/nodes & runnodes.bat`
|
||||
4. Browse to http://localhost:10005/web/simmvaluationdemo
|
14
docs/build/html/_sources/inthebox.txt
vendored
14
docs/build/html/_sources/inthebox.txt
vendored
@ -25,17 +25,3 @@ would not in order to boost productivity:
|
||||
* Some privacy techniques aren't implemented yet.
|
||||
* It uses an embedded SQL database and doesn't yet have connectivity support for mainstream SQL vendors (Oracle,
|
||||
Postgres, MySQL, SQL Server etc).
|
||||
|
||||
Kotlin
|
||||
------
|
||||
|
||||
Corda is written in a language called `Kotlin <https://kotlinlang.org/>`_. Kotlin is a language that targets the JVM
|
||||
and can be thought of as a simpler Scala, with much better Java interop. It is developed by and has commercial support
|
||||
from JetBrains, the makers of the IntelliJ IDE and other popular developer tools.
|
||||
|
||||
As Kotlin is very new, without a doubt you have not encountered it before. Don't worry: it is designed as a better
|
||||
Java for industrial use and as such, the syntax was carefully designed to be readable even to people who don't know
|
||||
the language, after only a few minutes of introduction.
|
||||
|
||||
Due to the seamless Java interop the use of Kotlin to extend the platform is *not* required and the tutorial shows how
|
||||
to write contracts in both Kotlin and Java. You can `read more about why Kotlin is a potentially strong successor to Java here <https://medium.com/@octskyward/why-kotlin-is-my-next-programming-language-c25c001e26e3>`_.
|
4
docs/build/html/_sources/merkle-trees.txt
vendored
4
docs/build/html/_sources/merkle-trees.txt
vendored
@ -73,13 +73,13 @@ commands of type ``Fix`` as in IRSDemo example. Then we can construct ``Filtered
|
||||
val wtx: WireTransaction = partialTx.toWireTransaction()
|
||||
val ftx = FilteredTransaction.buildMerkleTransaction(wtx, filterFuns)
|
||||
|
||||
In the Oracle example this step takes place in ``RatesFixProtocol``:
|
||||
In the Oracle example this step takes place in ``RatesFixFlow``:
|
||||
|
||||
.. container:: codeset
|
||||
|
||||
.. sourcecode:: kotlin
|
||||
|
||||
val protocol = RatesFixProtocol(partialTx, filterFuns, oracle, fixOf, "0.675".bd, "0.1".bd)
|
||||
val flow = RatesFixFlow(partialTx, filterFuns, oracle, fixOf, "0.675".bd, "0.1".bd)
|
||||
|
||||
``FilteredTransaction`` holds ``filteredLeaves`` (data that we wanted to reveal) and Merkle branch for them.
|
||||
|
||||
|
4
docs/build/html/_sources/messaging.txt
vendored
4
docs/build/html/_sources/messaging.txt
vendored
@ -13,8 +13,8 @@ unit tests and visualisation tools.
|
||||
out for alternative implementations.
|
||||
|
||||
There are multiple ways of interacting with the network. When writing an application you typically won't use the
|
||||
messaging subsystem directly. Instead you will build on top of the :doc:`protocol framework <protocol-state-machines>`,
|
||||
which adds a layer on top of raw messaging to manage multi-step protocols and let you think in terms of identities
|
||||
messaging subsystem directly. Instead you will build on top of the :doc:`flow framework <flow-state-machines>`,
|
||||
which adds a layer on top of raw messaging to manage multi-step flows and let you think in terms of identities
|
||||
rather than specific network endpoints.
|
||||
|
||||
Messaging types
|
||||
|
11
docs/build/html/_sources/node-administration.txt
vendored
11
docs/build/html/_sources/node-administration.txt
vendored
@ -4,6 +4,15 @@ Node administration
|
||||
When a node is running, it exposes an embedded database server, an embedded web server that lets you monitor it,
|
||||
you can upload and download attachments, access a REST API and so on.
|
||||
|
||||
Logging
|
||||
-------
|
||||
|
||||
Logs are stored to the logs subdirectory of the node directory and are rotated from time to time. You can
|
||||
have logging printed to the console as well by passing the ``--log-to-console`` command line flag. Corda
|
||||
uses the log4j2 framework to manage its logging, so you can also configure it in more detail by writing
|
||||
a custom logging configuration file and passing ``-Dlog4j.configurationFile=my-config-file.xml`` on the
|
||||
command line as well.
|
||||
|
||||
Database access
|
||||
---------------
|
||||
|
||||
@ -12,7 +21,7 @@ The JDBC URL is printed during node startup to the log and will typically look l
|
||||
|
||||
``jdbc:h2:tcp://192.168.0.31:31339/node``
|
||||
|
||||
The username and password can be altered in the :doc:`corda-config-files` but default to username "sa" and a blank
|
||||
The username and password can be altered in the :doc:`corda-configuration-files` but default to username "sa" and a blank
|
||||
password.
|
||||
|
||||
Any database browsing tool that supports JDBC can be used, but if you have IntelliJ Ultimate edition then there is
|
||||
|
1
docs/build/html/_sources/node-explorer.txt
vendored
1
docs/build/html/_sources/node-explorer.txt
vendored
@ -37,6 +37,7 @@ Login
|
||||
User can login to any Corda node using the explorer, alternately, `gradlew explorer:runDemoNodes` can be used to start up demo nodes for testing.
|
||||
Corda node address, username and password are required for login, the address is defaulted to localhost:0 if leave blank.
|
||||
Username and password can be configured in node's configuration file; for demo nodes, it is defaulted to ``user1`` and ``test``.
|
||||
|
||||
.. note:: If you are connecting to the demo nodes, only Alice and Bob (20004, 20006) are accessible using user1 credential, you won't be able to connect to the notary.
|
||||
|
||||
.. image:: resources/explorer/login.png
|
||||
|
348
docs/build/html/_sources/node-services.txt
vendored
Normal file
348
docs/build/html/_sources/node-services.txt
vendored
Normal file
@ -0,0 +1,348 @@
|
||||
A Brief Introduction To The Node Services
|
||||
=========================================
|
||||
|
||||
This document is intended as a very brief introduction to the current
|
||||
service components inside the node. Whilst not at all exhaustive it is
|
||||
hoped that this will give some context when writing applications and
|
||||
code that use these services, or which are operated upon by the internal
|
||||
components of Corda.
|
||||
|
||||
Services Within The Node
|
||||
------------------------
|
||||
|
||||
The node services represent the various sub functions of the Corda node.
|
||||
Some are directly accessible to contracts and flows through the
|
||||
``ServiceHub``, whilst others are the framework internals used to host
|
||||
the node functions. Any public service interfaces are defined in the
|
||||
``:core`` gradle project in the
|
||||
``src/main/kotlin/net/corda/core/node/services`` folder. The
|
||||
``ServiceHub`` interface exposes functionality suitable for flows.
|
||||
The implementation code for all standard services lives in the gradle
|
||||
``:node`` project under the ``src/main/kotlin/net/corda/node/services``
|
||||
folder. The ``src/main/kotlin/net/corda/node/services/api`` folder
|
||||
contains declarations for internal only services and for interoperation
|
||||
between services.
|
||||
|
||||
All the services are constructed in the ``AbstractNode`` ``start``
|
||||
method (and the extension in ``Node``). They may also register a
|
||||
shutdown handler during initialisation, which will be called in reverse
|
||||
order to the start registration sequence when the ``Node.stop``
|
||||
is called.
|
||||
|
||||
As well as the standard services trusted CorDapp plugins may register
|
||||
custom services. These plugin services are passed a reference to the
|
||||
``PluginServiceHub`` which allows some more powerful functions e.g.
|
||||
starting flows.
|
||||
|
||||
For unit testing a number of non-persistent, memory only services are
|
||||
defined in the ``:node`` and ``:test-utils`` projects. The
|
||||
``:test-utils`` project also provides an in-memory networking simulation
|
||||
to allow unit testing of flows and service functions.
|
||||
|
||||
The roles of the individual services are described below.
|
||||
|
||||
Key Management and Identity Services
|
||||
------------------------------------
|
||||
|
||||
InMemoryIdentityService
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``InMemoryIdentityService`` implements the ``IdentityService``
|
||||
interface and provides a store of remote mappings between ``CompositeKey``
|
||||
and remote ``Parties``. It is automatically populated from the
|
||||
``NetworkMapCache`` updates and is used when translating ``CompositeKey``
|
||||
exposed in transactions into fully populated ``Party`` identities. This
|
||||
service is also used in the default JSON mapping of parties in the web
|
||||
server, thus allowing the party names to be used to refer to other node
|
||||
legal identities. In the future the Identity service will be made
|
||||
persistent and extended to allow anonymised session keys to be used in
|
||||
flows where the well-known ``CompositeKey`` of nodes need to be hidden
|
||||
to non-involved parties.
|
||||
|
||||
PersistentKeyManagementService and E2ETestKeyManagementService
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Typical usage of these services is to locate an appropriate
|
||||
``PrivateKey`` to complete and sign a verified transaction as part of a
|
||||
flow. The normal node legal identifier keys are typically accessed via
|
||||
helper extension methods on the ``ServiceHub``, but these ultimately
|
||||
fetch the keys from the ``KeyManagementService``. The
|
||||
``KeyManagementService`` interface also allows other keys to be
|
||||
generated if anonymous keys are needed in a flow. Note that this
|
||||
interface works at the level of individual ``PublicKey``/``PrivateKey``
|
||||
pairs, but the signing authority will be represented by a
|
||||
``CompositeKey`` on the ``NodeInfo`` to allow key clustering and
|
||||
threshold schemes.
|
||||
|
||||
The ``PersistentKeyManagementService`` is a persistent implementation of
|
||||
the ``KeyManagementService`` interface that records the key pairs to a
|
||||
key-value storage table in the database. ``E2ETestKeyManagementService``
|
||||
is a simple implementation of the ``KeyManagementService`` that is used
|
||||
to track our ``KeyPairs`` for use in unit testing when no database is
|
||||
available.
|
||||
|
||||
Messaging and Network Management Services
|
||||
-----------------------------------------
|
||||
|
||||
ArtemisMessagingServer
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``ArtemisMessagingServer`` service is run internally by the Corda
|
||||
node to host the ``ArtemisMQ`` messaging broker that is used for
|
||||
reliable node communications. Although the node can be configured to
|
||||
disable this and connect to a remote broker by setting the
|
||||
``messagingServerAddress`` configuration to be the remote broker
|
||||
address. (The ``MockNode`` used during testing does not use this
|
||||
service, and has a simplified in-memory network layer instead.) This
|
||||
service is not exposed to any CorDapp code as it is an entirely internal
|
||||
infrastructural component. However, the developer may need to be aware
|
||||
of this component, because the ``ArtemisMessagingServer`` is responsible
|
||||
for configuring the network ports (based upon settings in ``node.conf``)
|
||||
and the service configures the security settings of the ``ArtemisMQ``
|
||||
middleware and acts to form bridges between node mailbox queues based
|
||||
upon connection details advertised by the ``NetworkMapService``. The
|
||||
``ArtemisMQ`` broker is configured to use TLS1.2 with a custom
|
||||
``TrustStore`` containing a Corda root certificate and a ``KeyStore``
|
||||
with a certificate and key signed by a chain back to this root
|
||||
certificate. These keystores typically reside in the ``certificates``
|
||||
sub folder of the node workspace. For the nodes to be able to connect to
|
||||
each other it is essential that the entire set of nodes are able to
|
||||
authenticate against each other and thus typically that they share a
|
||||
common root certificate. Also note that the address configuration
|
||||
defined for the server is the basis for the address advertised in the
|
||||
NetworkMapService and thus must be externally connectable by all nodes
|
||||
in the network.
|
||||
|
||||
NodeMessagingClient
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``NodeMessagingClient`` is the implementation of the
|
||||
``MessagingService`` interface operating across the ``ArtemisMQ``
|
||||
middleware layer. It typically connects to the local ``ArtemisMQ``
|
||||
hosted within the ``ArtemisMessagingServer`` service. However, the
|
||||
``messagingServerAddress`` configuration can be set to a remote broker
|
||||
address if required. The responsibilities of this service include
|
||||
managing the node's persistent mailbox, sending messages to remote peer
|
||||
nodes, acknowledging properly consumed messages and deduplicating any
|
||||
resent messages. The service also handles the incoming requests from new
|
||||
RPC client sessions and hands them to the ``CordaRPCOpsImpl`` to carry
|
||||
out the requests.
|
||||
|
||||
InMemoryNetworkMapCache
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``InMemoryNetworkMapCache`` implements the ``NetworkMapCache``
|
||||
interface and is responsible for tracking the identities and advertised
|
||||
services of authorised nodes provided by the remote
|
||||
``NetworkMapService``. Typical use is to search for nodes hosting
|
||||
specific advertised services e.g. a Notary service, or an Oracle
|
||||
service. Also, this service allows mapping of friendly names, or
|
||||
``Party`` identities to the full ``NodeInfo`` which is used in the
|
||||
``StateMachineManager`` to convert between the ``CompositeKey``, or
|
||||
``Party`` based addressing used in the flows/contracts and the
|
||||
physical host and port information required for the physical
|
||||
``ArtemisMQ`` messaging layer.
|
||||
|
||||
|
||||
PersistentNetworkMapService and NetworkMapService
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``NetworkMapService`` is a node internal component responsible for
|
||||
managing and communicating the directory of authenticated registered
|
||||
nodes and advertised services in the Corda network. Only a single node
|
||||
in the network (in future this will be a clustered service) should host
|
||||
the NetworkMapService implementation. All other Corda nodes initiate
|
||||
their remote connection to the ``NetworkMapService`` early in the
|
||||
start-up sequence and wait to synchronise their local
|
||||
``NetworkMapCache`` before activating any flows. For the
|
||||
``PersistentNetworkMapService`` registered ``NodeInfo`` data is
|
||||
persisted and will include nodes that are not currently active. The
|
||||
networking layer will persist any messages directed at such inactive
|
||||
nodes with the expectation that they will be delivered eventually, or
|
||||
else that the source flow will be terminated by admin intervention.
|
||||
An ``InMemoryNetworkMapService`` is also available for unit tests
|
||||
without a database.
|
||||
|
||||
The ``NetworkMapService`` should not be used by any flows, or
|
||||
contracts. Instead they should access the NetworkMapCache service to
|
||||
access this data.
|
||||
|
||||
Storage and Persistence Related Services
|
||||
----------------------------------------
|
||||
|
||||
StorageServiceImpl
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``StorageServiceImpl`` service simply hold references to the various
|
||||
persistence related services and provides a single grouped interface on
|
||||
the ``ServiceHub``.
|
||||
|
||||
DBCheckpointStorage
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``DBCheckpointStorage`` service is used from within the
|
||||
``StateMachineManager`` code to persist the progress of flows. Thus
|
||||
ensuring that if the program terminates the flow can be restarted
|
||||
from the same point and complete the flow. This service should not
|
||||
be used by any CorDapp components.
|
||||
|
||||
DBTransactionMappingStorage and InMemoryStateMachineRecordedTransactionMappingStorage
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``DBTransactionMappingStorage`` is used within the
|
||||
``StateMachineManager`` code to relate transactions and flows. This
|
||||
relationship is exposed in the eventing interface to the RPC clients,
|
||||
thus allowing them to track the end result of a flow and map to the
|
||||
actual transactions/states completed. Otherwise this service is unlikely
|
||||
to be accessed by any CorDapps. The
|
||||
``InMemoryStateMachineRecordedTransactionMappingStorage`` service is
|
||||
available as a non-persistent implementation for unit tests with no database.
|
||||
|
||||
DBTransactionStorage
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``DBTransactionStorage`` service is a persistent implementation of
|
||||
the ``TransactionStorage`` interface and allows flows read-only
|
||||
access to full transactions, plus transaction level event callbacks.
|
||||
Storage of new transactions must be made via the ``recordTransactions``
|
||||
method on the ``ServiceHub``, not via a direct call to this service, so
|
||||
that the various event notifications can occur.
|
||||
|
||||
NodeAttachmentService
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``NodeAttachmentService`` provides an implementation of the
|
||||
``AttachmentStorage`` interface exposed on the ``ServiceHub`` allowing
|
||||
transactions to add documents, copies of the contract code and binary
|
||||
data to transactions. The data is persisted to the local file system
|
||||
inside the attachments subfolder of the node workspace. The service is
|
||||
also interfaced to by the web server, which allows files to be uploaded
|
||||
via an HTTP post request.
|
||||
|
||||
Flow Framework And Event Scheduling Services
|
||||
--------------------------------------------
|
||||
|
||||
StateMachineManager
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``StateMachineManager`` is the service that runs the active
|
||||
flows of the node whether initiated by an RPC client, the web
|
||||
interface, a scheduled state activity, or triggered by receipt of a
|
||||
message from another node. The ``StateMachineManager`` wraps the
|
||||
flow code (extensions of the ``FlowLogic`` class) inside an
|
||||
instance of the ``FlowStateMachineImpl`` class, which is a
|
||||
``Quasar`` ``Fiber``. This allows the ``StateMachineManager`` to suspend
|
||||
flows at all key lifecycle points and persist their serialized state
|
||||
to the database via the ``DBCheckpointStorage`` service. This process
|
||||
uses the facilities of the ``Quasar`` ``Fibers`` library to manage this
|
||||
process and hence the requirement for the node to run the ``Quasar``
|
||||
java instrumentation agent in its JVM.
|
||||
|
||||
In operation the ``StateMachineManager`` is typically running an active
|
||||
flow on its server thread until it encounters a blocking, or
|
||||
externally visible operation, such as sending a message, waiting for a
|
||||
message, or initiating a ``subFlow``. The fiber is then suspended
|
||||
and its stack frames serialized to the database, thus ensuring that if
|
||||
the node is stopped, or crashes at this point the flow will restart
|
||||
with exactly the same action again. To further ensure consistency, every
|
||||
event which resumes a flow opens a database transaction, which is
|
||||
committed during this suspension process ensuring that the database
|
||||
modifications e.g. state commits stay in sync with the mutating changes
|
||||
of the flow. Having recorded the fiber state the
|
||||
``StateMachineManager`` then carries out the network actions as required
|
||||
(internally one flow message exchanged may actually involve several
|
||||
physical session messages to authenticate and invoke registered
|
||||
flows on the remote nodes). The flow will stay suspended until
|
||||
the required message is returned and the scheduler will resume
|
||||
processing of other activated flows. On receipt of the expected
|
||||
response message from the network layer the ``StateMachineManager``
|
||||
locates the appropriate flow, resuming it immediately after the
|
||||
blocking step with the received message. Thus from the perspective of
|
||||
the flow the code executes as a simple linear progression of
|
||||
processing, even if there were node restarts and possibly message
|
||||
resends (the messaging layer deduplicates messages based on an id that
|
||||
is part of the checkpoint).
|
||||
|
||||
The ``StateMachineManager`` service is not directly exposed to the
|
||||
flows, or contracts themselves.
|
||||
|
||||
NodeSchedulerService
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``NodeSchedulerService`` implements the ``SchedulerService``
|
||||
interface and monitors the Vault updates to track any new states that
|
||||
implement the ``SchedulableState`` interface and require automatic
|
||||
scheduled flow initiation. At the scheduled due time the
|
||||
``NodeSchedulerService`` will create a new flow instance passing it
|
||||
a reference to the state that triggered the event. The flow can then
|
||||
begin whatever action is required. Note that the scheduled activity
|
||||
occurs in all nodes holding the state in their Vault, it may therefore
|
||||
be required for the flow to exit early if the current node is not
|
||||
the intended initiator.
|
||||
|
||||
Notary Flow Implementation Services
|
||||
-----------------------------------
|
||||
|
||||
PersistentUniquenessProvider, InMemoryUniquenessProvider and RaftUniquenessProvider
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
These variants of ``UniquenessProvider`` service are used by the notary
|
||||
flows to track consumed states and thus reject double-spend
|
||||
scenarios. The ``InMemoryUniquenessProvider`` is for unit testing only,
|
||||
the default being the ``PersistentUniquenessProvider`` which records the
|
||||
changes to the DB. When the Raft based notary is active the states are
|
||||
tracked by the whole cluster using a ``RaftUniquenessProvider``. Outside
|
||||
of the notary flows themselves this service should not be accessed
|
||||
by any CorDapp components.
|
||||
|
||||
NotaryService (SimpleNotaryService, ValidatingNotaryService, RaftValidatingNotaryService)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``NotaryService`` is an abstract base class for the various concrete
|
||||
implementations of the Notary server flow. By default, a node does
|
||||
not run any ``NotaryService`` server component. However, the appropriate
|
||||
implementation service is automatically started if the relevant
|
||||
``ServiceType`` id is included in the node's
|
||||
``extraAdvertisedServiceIds`` configuration property. The node will then
|
||||
advertise itself as a Notary via the ``NetworkMapService`` and may then
|
||||
participate in controlling state uniqueness when contacted by nodes
|
||||
using the ``NotaryFlow.Client`` ``subFlow``. The
|
||||
``SimpleNotaryService`` only offers protection against double spend, but
|
||||
does no further verification. The ``ValidatingNotaryService`` checks
|
||||
that proposed transactions are correctly signed by all keys listed in
|
||||
the commands and runs the contract verify to ensure that the rules of
|
||||
the state transition are being followed. The
|
||||
``RaftValidatingNotaryService`` further extends the flow to operate
|
||||
against a cluster of nodes running shared consensus state across the
|
||||
RAFT protocol (note this requires the additional configuration of the
|
||||
``notaryClusterAddresses`` property).
|
||||
|
||||
Vault Related Services
|
||||
----------------------
|
||||
|
||||
NodeVaultService
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``NodeVaultService`` implements the ``VaultService`` interface to
|
||||
allow access to the node's own set of unconsumed states. The service
|
||||
does this by tracking update notifications from the
|
||||
``TransactionStorage`` service and processing relevant updates to delete
|
||||
consumed states and insert new states. The resulting update is then
|
||||
persisted to the database. The ``VaultService`` then exposes query and
|
||||
event notification APIs to flows and CorDapp plugins to allow them
|
||||
to respond to updates, or query for states meeting various conditions to
|
||||
begin the formation of new transactions consuming them. The equivalent
|
||||
services are also forwarded to RPC clients, so that they may show
|
||||
updating views of states held by the node.
|
||||
|
||||
NodeSchemaService and HibernateObserver
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``HibernateObserver`` runs within the node framework and listens for
|
||||
vault state updates, the ``HibernateObserver`` then uses the mapping
|
||||
services of the ``NodeSchemaService`` to record the states in auxiliary
|
||||
database tables. This allows Corda state updates to be exposed to
|
||||
external legacy systems by insertion of unpacked data into existing
|
||||
tables. To enable these features the contract state must implement the
|
||||
``QueryableState`` interface to define the mappings.
|
||||
|
8
docs/build/html/_sources/persistence.txt
vendored
8
docs/build/html/_sources/persistence.txt
vendored
@ -21,7 +21,7 @@ Schemas
|
||||
Every ``ContractState`` can implement the ``QueryableState`` interface if it wishes to be inserted into the node's local
|
||||
database and accessible using SQL.
|
||||
|
||||
.. literalinclude:: ../../core/src/main/kotlin/net.corda.core/schemas/PersistentTypes.kt
|
||||
.. literalinclude:: ../../core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt
|
||||
:language: kotlin
|
||||
:start-after: DOCSTART QueryableState
|
||||
:end-before: DOCEND QueryableState
|
||||
@ -34,12 +34,12 @@ cases where the schema has evolved, with each one being represented by a ``Mappe
|
||||
Nodes have an internal ``SchemaService`` which decides what to persist and what not by selecting the ``MappedSchema``
|
||||
to use.
|
||||
|
||||
.. literalinclude:: ../../node/src/main/kotlin/net.corda.node/services/api/SchemaService.kt
|
||||
.. literalinclude:: ../../node/src/main/kotlin/net/corda/node/services/api/SchemaService.kt
|
||||
:language: kotlin
|
||||
:start-after: DOCSTART SchemaService
|
||||
:end-before: DOCEND SchemaService
|
||||
|
||||
.. literalinclude:: ../../core/src/main/kotlin/net.corda.core/schemas/PersistentTypes.kt
|
||||
.. literalinclude:: ../../core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt
|
||||
:language: kotlin
|
||||
:start-after: DOCSTART MappedSchema
|
||||
:end-before: DOCEND MappedSchema
|
||||
@ -85,5 +85,5 @@ to initialise the ORM layer.
|
||||
Several examples of entities and mappings are provided in the codebase, including ``Cash.State`` and
|
||||
``CommercialPaper.State``. For example, here's the first version of the cash schema.
|
||||
|
||||
.. literalinclude:: ../../finance/src/main/kotlin/net.corda.schemas/CashSchemaV1.kt
|
||||
.. literalinclude:: ../../finance/src/main/kotlin/net/corda/schemas/CashSchemaV1.kt
|
||||
:language: kotlin
|
||||
|
10
docs/build/html/_sources/running-the-demos.txt
vendored
10
docs/build/html/_sources/running-the-demos.txt
vendored
@ -5,7 +5,7 @@ The repository contains a small number of demo programs that run two-node networ
|
||||
so far. We have:
|
||||
|
||||
1. 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 :doc:`protocol-state-machines`.
|
||||
how this works in :doc:`flow-state-machines`.
|
||||
2. 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.
|
||||
3. The IRS demo web interface - a web interface to the IRS demo.
|
||||
@ -75,7 +75,7 @@ In the "IRS Demo: Run Nodes" window you'll see a lot of activity when you run th
|
||||
The date change rolls the clock forwards and causes the nodes to agree on the fixings over a period.
|
||||
|
||||
There is also an web app as part of this demo. To use this set up the trades and then navigate to
|
||||
http://localhost:10005/web/irsdemo and http://localhost:10005/web/irsdemo to see both node's view of the ledger.
|
||||
http://localhost:10005/web/irsdemo and http://localhost:10007/web/irsdemo to see both node's view of the ledger.
|
||||
|
||||
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
|
||||
@ -87,7 +87,7 @@ Attachment demo
|
||||
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!):
|
||||
|
||||
1. Run ``./gradlew samples:attachment-demo:deployNodes`` to create a set of configs and installs under ``samples/trader-demo/build/nodes``
|
||||
1. Run ``./gradlew samples:attachment-demo:deployNodes`` to create a set of configs and installs under ``samples/attachment-demo/build/nodes``
|
||||
2. Run ``./samples/attachment-demo/build/nodes/runnodes`` to open up three new terminal tabs/windows with the three nodes.
|
||||
3. Run ``./gradlew samples:attachment-demo:runRecipient``, which will block waiting for something to happen.
|
||||
4. Run ``./gradlew samples:attachment-demo:runSender`` in another terminal window to trigger the transaction.
|
||||
@ -106,13 +106,13 @@ message "File received - we're happy!" should be printed.
|
||||
SIMM and Portfolio Demo
|
||||
-----------------------
|
||||
|
||||
.. note:: Read more about this demo at :doc:`initialmarginagreement`.
|
||||
.. note:: Read more about this demo at :doc:`initial-margin-agreement`.
|
||||
|
||||
To run the demo run:
|
||||
|
||||
1. Open the Corda project in IntelliJ and run the "Install" configuration
|
||||
2. Open the Corda samples project in IntelliJ and run the "Simm Valuation Demo" configuration
|
||||
|
||||
Now open http://localhost:10005/web/simmvaluationdemo and http://localhost:10005/web/simmvaluationdemo to view the two nodes that this
|
||||
Now open http://localhost:10005/web/simmvaluationdemo and http://localhost:10007/web/simmvaluationdemo to view the two nodes that this
|
||||
will have started respectively. You can now use the demo by creating trades and agreeing the valuations.
|
||||
|
||||
|
@ -4,22 +4,22 @@ Secure coding guidelines
|
||||
The platform does what it can to be secure by default and safe by design. Unfortunately the platform cannot
|
||||
prevent every kind of security mistake. This document describes what to think about when writing applications
|
||||
to block various kinds of attack. Whilst it may be tempting to just assume no reasonable counterparty would
|
||||
attempt to subvert your trades using protocol level attacks, relying on trust for software security makes it
|
||||
attempt to subvert your trades using flow level attacks, relying on trust for software security makes it
|
||||
harder to scale up your operations later when you might want to add counterparties quickly and without
|
||||
extensive vetting.
|
||||
|
||||
Protocols
|
||||
---------
|
||||
Flows
|
||||
-----
|
||||
|
||||
:doc:`protocol-state-machines` are how your app communicates with other parties on the network. Therefore they
|
||||
:doc:`flow-state-machines` are how your app communicates with other parties on the network. Therefore they
|
||||
are the typical entry point for malicious data into your app and must be treated with care.
|
||||
|
||||
The ``receive`` methods return data wrapped in the ``UntrustworthyData<T>`` marker type. This type doesn't add
|
||||
any functionality, it's only there to remind you to properly validate everything that you get from the network.
|
||||
Remember that the other side may *not* be running the code you provide to take part in the protocol: they are
|
||||
Remember that the other side may *not* be running the code you provide to take part in the flow: they are
|
||||
allowed to do anything! Things to watch out for:
|
||||
|
||||
* A transaction that doesn't match a partial transaction built or proposed earlier in the protocol, for instance,
|
||||
* A transaction that doesn't match a partial transaction built or proposed earlier in the flow, for instance,
|
||||
if you propose to trade a cash state worth $100 for an asset, and the transaction to sign comes back from the
|
||||
other side, you must check that it points to the state you actually requested. Otherwise the attacker could
|
||||
get you to sign a transaction that spends a much larger state to you, if they know the ID of one!
|
||||
@ -30,7 +30,7 @@ allowed to do anything! Things to watch out for:
|
||||
could re-run the builder logic and do a comparison of the resulting states to ensure that it's what you expected.
|
||||
For instance if the data needed to construct the next state is available to both parties, the function to
|
||||
calculate the transaction you want to mutually agree could be shared between both classes implementing both
|
||||
sides of the protocol.
|
||||
sides of the flow.
|
||||
|
||||
The theme should be clear: signing is a very sensitive operation, so you need to be sure you know what it is you
|
||||
are about to sign, and that nothing has changed in the small print!
|
||||
|
@ -64,7 +64,7 @@ of state:
|
||||
|
||||
``DealState``
|
||||
A LinearState representing an agreement between two or more parties. Intended to simplify implementing generic
|
||||
protocols that manipulate many agreement types.
|
||||
flows that manipulate many agreement types.
|
||||
|
||||
``FixableDealState``
|
||||
A deal state, with further functions exposed to support fixing of interest rates.
|
||||
@ -151,23 +151,23 @@ Multi-signature support
|
||||
Corda supports scenarios where more than one key or party is required to authorise a state object transition, for example:
|
||||
"Either the CEO or 3 out of 5 of his assistants need to provide signatures".
|
||||
|
||||
Key Trees
|
||||
^^^^^^^^^
|
||||
Composite Keys
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
This is achieved by public key composition, using a tree data structure ``PublicKeyTree``. A ``PublicKeyTree`` stores the
|
||||
cryptographic public key primitives in its leaves and the composition logic in the intermediary nodes. Every intermediary
|
||||
This is achieved by public key composition, using a tree data structure ``CompositeKey``. A ``CompositeKey`` is a tree that
|
||||
stores the cryptographic public key primitives in its leaves and the composition logic in the intermediary nodes. Every intermediary
|
||||
node specifies a *threshold* of how many child signatures it requires.
|
||||
|
||||
An illustration of an *"either Alice and Bob, or Charlie"* public key tree:
|
||||
An illustration of an *"either Alice and Bob, or Charlie"* composite key:
|
||||
|
||||
.. image:: resources/public-key-tree.png
|
||||
:width: 300px
|
||||
.. image:: resources/composite-key.png
|
||||
:width: 300px
|
||||
|
||||
To allow further flexibility, each child node can have an associated custom *weight* (the default is 1). The *threshold*
|
||||
then specifies the minimum total weight of all children required. Our previous example can also be expressed as:
|
||||
|
||||
.. image:: resources/public-key-tree-2.png
|
||||
:width: 300px
|
||||
.. image:: resources/composite-key-2.png
|
||||
:width: 300px
|
||||
|
||||
Verification
|
||||
^^^^^^^^^^^^
|
||||
@ -175,9 +175,9 @@ Verification
|
||||
Signature verification is performed in two stages:
|
||||
|
||||
1. Given a list of signatures, each signature is verified against the expected content.
|
||||
2. The public keys corresponding to the signatures are matched against the leaves of the public key tree in question,
|
||||
2. The public keys corresponding to the signatures are matched against the leaves of the composite key tree in question,
|
||||
and the total combined weight of all children is calculated for every intermediary node. If all thresholds are satisfied,
|
||||
the public key tree requirement is considered to be met.
|
||||
the composite key requirement is considered to be met.
|
||||
|
||||
Date support
|
||||
------------
|
||||
|
@ -1,5 +1,4 @@
|
||||
.. highlight:: kotlin
|
||||
.. raw:: html
|
||||
|
||||
Using attachments
|
||||
=================
|
||||
@ -17,10 +16,10 @@ which returns a unique ID that can be added using ``TransactionBuilder.addAttach
|
||||
uploaded and downloaded via HTTP, to enable integration with external systems. For instructions on HTTP upload/download
|
||||
please see ":doc:`node-administration`".
|
||||
|
||||
Normally attachments on transactions are fetched automatically via the ``ResolveTransactionsProtocol`` when verifying
|
||||
Normally attachments on transactions are fetched automatically via the ``ResolveTransactionsFlow`` when verifying
|
||||
received transactions. Attachments are needed in order to validate a transaction (they include, for example, the
|
||||
contract code), so must be fetched before the validation process can run. ``ResolveTransactionsProtocol`` calls
|
||||
``FetchTransactionsProtocol`` to perform the actual retrieval.
|
||||
contract code), so must be fetched before the validation process can run. ``ResolveTransactionsFlow`` calls
|
||||
``FetchTransactionsFlow`` to perform the actual retrieval.
|
||||
|
||||
It is encouraged that where possible attachments are reusable data, so that nodes can meaningfully cache them.
|
||||
|
||||
@ -28,13 +27,13 @@ Attachments demo
|
||||
----------------
|
||||
|
||||
There is a worked example of attachments, which relays a simple document from one node to another. The "two party
|
||||
trade protocol" also includes an attachment, however it is a significantly more complex demo, and less well suited
|
||||
trade flow" also includes an attachment, however it is a significantly more complex demo, and less well suited
|
||||
for a tutorial.
|
||||
|
||||
The demo code is in the file "src/main/kotlin/net.corda.demos/attachment/AttachmentDemo.kt", with the core logic
|
||||
contained within the two functions ``runRecipient()`` and ``runSender()``. We'll look at the recipient function first;
|
||||
this subscribes to notifications of new validated transactions, and if it receives a transaction containing attachments,
|
||||
loads the first attachment from storage, and checks it matches the expected attachment ID. ``ResolveTransactionsProtocol``
|
||||
loads the first attachment from storage, and checks it matches the expected attachment ID. ``ResolveTransactionsFlow``
|
||||
has already fetched all attachments from the remote node, and as such the attachments are available from the node's
|
||||
storage service. Once the attachment is verified, the node shuts itself down.
|
||||
|
||||
@ -43,10 +42,10 @@ storage service. Once the attachment is verified, the node shuts itself down.
|
||||
private fun runRecipient(node: Node) {
|
||||
val serviceHub = node.services
|
||||
|
||||
// Normally we would receive the transaction from a more specific protocol, but in this case we let [FinalityProtocol]
|
||||
// Normally we would receive the transaction from a more specific flow, but in this case we let [FinalityFlow]
|
||||
// handle receiving it for us.
|
||||
serviceHub.storageService.validatedTransactions.updates.subscribe { event ->
|
||||
// When the transaction is received, it's passed through [ResolveTransactionsProtocol], which first fetches any
|
||||
// When the transaction is received, it's passed through [ResolveTransactionsFlow], which first fetches any
|
||||
// attachments for us, then verifies the transaction. As such, by the time it hits the validated transaction store,
|
||||
// we have a copy of the attachment.
|
||||
val tx = event.tx
|
||||
@ -62,7 +61,7 @@ storage service. Once the attachment is verified, the node shuts itself down.
|
||||
}
|
||||
}
|
||||
|
||||
The sender correspondingly builds a transaction with the attachment, then calls ``FinalityProtocol`` to complete the
|
||||
The sender correspondingly builds a transaction with the attachment, then calls ``FinalityFlow`` to complete the
|
||||
transaction and send it to the recipient node:
|
||||
|
||||
|
||||
@ -88,7 +87,7 @@ transaction and send it to the recipient node:
|
||||
|
||||
// Send the transaction to the other recipient
|
||||
val tx = ptx.toSignedTransaction()
|
||||
serviceHub.startProtocol(LOG_SENDER, FinalityProtocol(tx, emptySet(), setOf(otherSide))).success {
|
||||
serviceHub.startFlow(LOG_SENDER, FinalityFlow(tx, emptySet(), setOf(otherSide))).success {
|
||||
thread {
|
||||
Thread.sleep(1000L) // Give the other side time to request the attachment
|
||||
node.stop()
|
||||
|
@ -11,7 +11,7 @@ see :doc:`clientrpc`.
|
||||
|
||||
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.
|
||||
|
||||
Note how we configure the node to create a user that has permission to start the CashProtocol.
|
||||
Note how we configure the node to create a user that has permission to start the CashFlow.
|
||||
|
||||
.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt
|
||||
:language: kotlin
|
||||
@ -62,7 +62,7 @@ We utilise several RPC functions here to query things like the notaries in the n
|
||||
|
||||
Then in a loop we generate randomly either an Issue, a Pay or an Exit transaction.
|
||||
|
||||
The RPC we need to initiate a Cash transaction is ``startProtocolDynamic`` which may start an arbitrary protocol, given sufficient permissions to do so. We won't use this function directly, but rather a type-safe wrapper around it ``startProtocol`` that type-checks the arguments for us.
|
||||
The RPC we need to initiate a Cash transaction is ``startFlowDynamic`` 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 ``startFlow`` that type-checks the arguments for us.
|
||||
|
||||
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!:
|
||||
|
||||
@ -79,3 +79,19 @@ Now let's try to visualise the transaction graph. We will use a graph drawing li
|
||||
:end-before: END 5
|
||||
|
||||
If we run the client with ``Visualise`` we should see a simple random graph being drawn as new transactions are being created.
|
||||
|
||||
Registering classes from your Cordapp with RPC Kryo
|
||||
---------------------------------------------------
|
||||
|
||||
As described in :doc:`clientrpc`, you currently have to register any additional classes you add that are needed in RPC
|
||||
requests or responses with the `Kryo` instance RPC uses. Here's an example of how you do this for an example class.
|
||||
|
||||
.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt
|
||||
:language: kotlin
|
||||
:start-after: START 7
|
||||
:end-before: END 7
|
||||
|
||||
See more on plugins in :doc:`creating-a-cordapp`.
|
||||
|
||||
.. warning:: 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.
|
@ -19,7 +19,7 @@ Kotlin syntax works.
|
||||
Where to put your code
|
||||
----------------------
|
||||
|
||||
A CorDapp is a collection of contracts, state definitions, protocols and other ways to extend the server. To create
|
||||
A CorDapp is a collection of contracts, state definitions, flows and other ways to extend the server. To create
|
||||
one you would just create a Java-style project as normal, with your choice of build system (Maven, Gradle, etc).
|
||||
Then add a dependency on ``net.corda.core:0.X`` where X is the milestone number you are depending on. The core
|
||||
module defines the base classes used in this tutorial.
|
||||
@ -694,7 +694,7 @@ a multi-party transaction, you're on your own. In Corda data is transmitted only
|
||||
multi-party transactions are a way of life, so we provide lots of support for managing them.
|
||||
|
||||
You can learn how transactions are moved between peers and taken through the build-sign-notarise-broadcast
|
||||
process in a separate tutorial, :doc:`protocol-state-machines`.
|
||||
process in a separate tutorial, :doc:`flow-state-machines`.
|
||||
|
||||
Non-asset-oriented smart contracts
|
||||
----------------------------------
|
||||
|
10
docs/build/html/_sources/where-to-start.txt
vendored
10
docs/build/html/_sources/where-to-start.txt
vendored
@ -21,7 +21,7 @@ A scenario contains:
|
||||
|
||||
* A set of participating nodes and their roles.
|
||||
* Some business process you wish to automate (typically simplified from the real thing).
|
||||
* The smart contracts and protocols that will automate that process.
|
||||
* The smart contracts and flows that will automate that process.
|
||||
|
||||
It may also specify a REST/JSON API, but this is optional.
|
||||
|
||||
@ -40,9 +40,9 @@ The process of implementing a scenario looks like this:
|
||||
in Java and Kotlin. The file should define your state classes and your contract class, which will define the
|
||||
allowable state transitions. You can learn how these are constructed by reading the ":doc:`tutorial-contract`" tutorial.
|
||||
3. It isn't enough to just define static data and logic that controls what's allowed. You must also orchestrate the
|
||||
business process. This is the job of the protocol framework. You can learn how to author these by reading
|
||||
":doc:`protocol-state-machines`".
|
||||
4. Once you have created your states, transactions and protocols, you need a way to demonstrate them (outside of the
|
||||
business process. This is the job of the flow framework. You can learn how to author these by reading
|
||||
":doc:`flow-state-machines`".
|
||||
4. Once you have created your states, transactions and flows, you need a way to demonstrate them (outside of the
|
||||
unit tests, of course). This topic is covered below.
|
||||
|
||||
The trader demo
|
||||
@ -63,7 +63,7 @@ demo drivers and then customise them, as much of the code would end up being sha
|
||||
Things you will want to adjust:
|
||||
|
||||
1. The name of the grouping directory each node role will create its private directory under.
|
||||
2. The demo protocols that just wrap the real business process in some kind of fake trading logic.
|
||||
2. The demo flows that just wrap the real business process in some kind of fake trading logic.
|
||||
|
||||
The IRS driver program registers REST APIs, but as this is seriously in flux right now and the APIs will change a lot,
|
||||
we do not recommend you try this as part of your initial explorations unless you are feeling adventurous.
|
Binary file not shown.
338
docs/build/html/api/alltypes/index.html
vendored
338
docs/build/html/api/alltypes/index.html
vendored
@ -11,7 +11,7 @@
|
||||
<td>
|
||||
<a href="../net.corda.node.utilities/-a-n-s-i-progress-observer/index.html">net.corda.node.utilities.ANSIProgressObserver</a></td>
|
||||
<td>
|
||||
<p>This observes the <a href="../net.corda.node.services.statemachine/-state-machine-manager/index.html">StateMachineManager</a> and follows the progress of <a href="../net.corda.core.protocols/-protocol-logic/index.html">ProtocolLogic</a>s until they complete in the order
|
||||
<p>This observes the <a href="../net.corda.node.services.statemachine/-state-machine-manager/index.html">StateMachineManager</a> and follows the progress of <a href="../net.corda.core.flows/-flow-logic/index.html">FlowLogic</a>s until they complete in the order
|
||||
they are added to the <a href="../net.corda.node.services.statemachine/-state-machine-manager/index.html">StateMachineManager</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@ -94,11 +94,11 @@ I/O), or a mock implementation suitable for unit test environments.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-abstract-state-replacement-protocol/index.html">net.corda.protocols.AbstractStateReplacementProtocol</a></td>
|
||||
<a href="../net.corda.flows/-abstract-state-replacement-flow/index.html">net.corda.flows.AbstractStateReplacementFlow</a></td>
|
||||
<td>
|
||||
<p>Abstract protocol to be used for replacing one state with another, for example when changing the notary of a state.
|
||||
<p>Abstract flow to be used for replacing one state with another, for example when changing the notary of a state.
|
||||
Notably this requires a one to one replacement of states, states cannot be split, merged or issued as part of these
|
||||
protocols.</p>
|
||||
flows.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -199,7 +199,7 @@ amount used in whatever underlying thing the amount represents.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.protocols/-app-context/index.html">net.corda.core.protocols.AppContext</a></td>
|
||||
<a href="../net.corda.core.flows/-app-context/index.html">net.corda.core.flows.AppContext</a></td>
|
||||
<td>
|
||||
<p>This is just some way to track what attachments need to be in the class loader, but may later include some app
|
||||
properties loaded from the attachments. And perhaps the authenticated user for an API call?</p>
|
||||
@ -292,10 +292,10 @@ Bilateral states are used in close-out netting.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-broadcast-transaction-protocol/index.html">net.corda.protocols.BroadcastTransactionProtocol</a></td>
|
||||
<a href="../net.corda.flows/-broadcast-transaction-flow/index.html">net.corda.flows.BroadcastTransactionFlow</a></td>
|
||||
<td>
|
||||
<p>Notify all involved parties about a transaction, including storing a copy. Normally this would be called via
|
||||
<a href="../net.corda.protocols/-finality-protocol/index.html">FinalityProtocol</a>.</p>
|
||||
<a href="../net.corda.flows/-finality-flow/index.html">FinalityFlow</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -338,21 +338,21 @@ the same transaction.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-cash-command/index.html">net.corda.protocols.CashCommand</a></td>
|
||||
<a href="../net.corda.flows/-cash-command/index.html">net.corda.flows.CashCommand</a></td>
|
||||
<td>
|
||||
<p>A command to initiate the Cash protocol with.</p>
|
||||
<p>A command to initiate the Cash flow with.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-cash-protocol/index.html">net.corda.protocols.CashProtocol</a></td>
|
||||
<a href="../net.corda.flows/-cash-flow/index.html">net.corda.flows.CashFlow</a></td>
|
||||
<td>
|
||||
<p>Initiates a protocol that produces an Issue/Move or Exit Cash transaction.</p>
|
||||
<p>Initiates a flow that produces an Issue/Move or Exit Cash transaction.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-cash-protocol-result/index.html">net.corda.protocols.CashProtocolResult</a></td>
|
||||
<a href="../net.corda.flows/-cash-flow-result/index.html">net.corda.flows.CashFlowResult</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
@ -529,6 +529,26 @@ internal accounting by the issuer (it might be, for example, a warehouse and/or
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.crypto/-composite-key/index.html">net.corda.core.crypto.CompositeKey</a></td>
|
||||
<td>
|
||||
<p>A tree data structure that enables the representation of composite public keys.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.utilities/-composite-key-column-type/index.html">net.corda.node.utilities.CompositeKeyColumnType</a></td>
|
||||
<td>
|
||||
<p><a href="#">ColumnType</a> for marshalling to/from database on behalf of <a href="../net.corda.core.crypto/-composite-key/index.html">CompositeKey</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.testing/-composite-key-generator/index.html">net.corda.core.testing.CompositeKeyGenerator</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.client.fxutils/-concatenated-list/index.html">net.corda.client.fxutils.ConcatenatedList</a></td>
|
||||
<td>
|
||||
<p><a href="../net.corda.client.fxutils/-concatenated-list/index.html">ConcatenatedList</a> takes a list of lists and concatenates them. Any change to the underlying lists or the outer list
|
||||
@ -629,6 +649,13 @@ useful tasks. See the documentation for <a href="../net.corda.client/-corda-r-p-
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.client.impl/-corda-r-p-c-client-impl/index.html">net.corda.client.impl.CordaRPCClientImpl</a></td>
|
||||
<td>
|
||||
<p>Core RPC engine implementation, to learn how to use RPC you should be looking at <a href="../net.corda.client/-corda-r-p-c-client/index.html">CordaRPCClient</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.messaging/-corda-r-p-c-ops/index.html">net.corda.node.services.messaging.CordaRPCOps</a></td>
|
||||
<td>
|
||||
<p>RPC operations that the node exposes to clients using the Java client library. These can be called from
|
||||
@ -733,7 +760,7 @@ in the toString lest some people get confused.</p>
|
||||
<a href="../net.corda.core.contracts/-deal-state/index.html">net.corda.core.contracts.DealState</a></td>
|
||||
<td>
|
||||
<p>Interface representing an agreement that exposes various attributes that are common. Implementing it simplifies
|
||||
implementation of general protocols that manipulate many agreement types.</p>
|
||||
implementation of general flows that manipulate many agreement types.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -760,6 +787,14 @@ building partially signed transactions.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.transactions/-distributed-immutable-map/index.html">net.corda.node.services.transactions.DistributedImmutableMap</a></td>
|
||||
<td>
|
||||
<p>A distributed map state machine that doesnt allow overriding values. The state machine is replicated
|
||||
across a Copycat Raft cluster.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.contracts/kotlin.-double/index.html">kotlin.Double</a> (extensions in package net.corda.core.contracts)</td>
|
||||
<td>
|
||||
</td>
|
||||
@ -898,7 +933,7 @@ TODO hook up an actual oracle</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-fetch-attachments-protocol/index.html">net.corda.protocols.FetchAttachmentsProtocol</a></td>
|
||||
<a href="../net.corda.flows/-fetch-attachments-flow/index.html">net.corda.flows.FetchAttachmentsFlow</a></td>
|
||||
<td>
|
||||
<p>Given a set of hashes either loads from from local storage or requests them from the other peer. Downloaded
|
||||
attachments are saved to local storage automatically.</p>
|
||||
@ -906,14 +941,14 @@ attachments are saved to local storage automatically.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-fetch-data-protocol/index.html">net.corda.protocols.FetchDataProtocol</a></td>
|
||||
<a href="../net.corda.flows/-fetch-data-flow/index.html">net.corda.flows.FetchDataFlow</a></td>
|
||||
<td>
|
||||
<p>An abstract protocol for fetching typed data from a remote peer.</p>
|
||||
<p>An abstract flow for fetching typed data from a remote peer.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-fetch-transactions-protocol/index.html">net.corda.protocols.FetchTransactionsProtocol</a></td>
|
||||
<a href="../net.corda.flows/-fetch-transactions-flow/index.html">net.corda.flows.FetchTransactionsFlow</a></td>
|
||||
<td>
|
||||
<p>Given a set of tx hashes (IDs), either loads them from local disk or asks the remote peer to provide them.</p>
|
||||
</td>
|
||||
@ -956,7 +991,7 @@ Functions are used to build a partial tree only out of some subset of original t
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-finality-protocol/index.html">net.corda.protocols.FinalityProtocol</a></td>
|
||||
<a href="../net.corda.flows/-finality-flow/index.html">net.corda.flows.FinalityFlow</a></td>
|
||||
<td>
|
||||
<p>Finalise a transaction by notarising it, then recording it locally, and then sending it to all involved parties.</p>
|
||||
</td>
|
||||
@ -999,6 +1034,93 @@ are reflected in the exposed list as expected.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.api/-flow-class-ref/index.html">net.corda.node.api.FlowClassRef</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.messaging/-flow-handle/index.html">net.corda.node.services.messaging.FlowHandle</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.statemachine/-flow-i-o-request/index.html">net.corda.node.services.statemachine.FlowIORequest</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.api/-flow-instance-ref/index.html">net.corda.node.api.FlowInstanceRef</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.flows/-flow-logic/index.html">net.corda.core.flows.FlowLogic</a></td>
|
||||
<td>
|
||||
<p>A sub-class of <a href="../net.corda.core.flows/-flow-logic/index.html">FlowLogic</a> implements a flow using direct, straight line blocking code. Thus you
|
||||
can write complex flow logic in an ordinary fashion, without having to think about callbacks, restarting after
|
||||
a node crash, how many instances of your flow there are running and so on.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.flows/-flow-logic-ref/index.html">net.corda.core.flows.FlowLogicRef</a></td>
|
||||
<td>
|
||||
<p>A class representing a <a href="../net.corda.core.flows/-flow-logic/index.html">FlowLogic</a> instance which would be possible to safely pass out of the contract sandbox.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.flows/-flow-logic-ref-factory/index.html">net.corda.core.flows.FlowLogicRefFactory</a></td>
|
||||
<td>
|
||||
<p>A class for conversion to and from <a href="../net.corda.core.flows/-flow-logic/index.html">FlowLogic</a> and <a href="../net.corda.core.flows/-flow-logic-ref/index.html">FlowLogicRef</a> instances.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.api/-flow-ref.html">net.corda.node.api.FlowRef</a></td>
|
||||
<td>
|
||||
<p>Encapsulates the flow to be instantiated. e.g. TwoPartyTradeFlow.Buyer.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.api/-flow-requiring-attention/index.html">net.corda.node.api.FlowRequiringAttention</a></td>
|
||||
<td>
|
||||
<p>Thinking that Instant is OK for short lived flow deadlines.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.flows/-flow-session-exception/index.html">net.corda.core.flows.FlowSessionException</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.flows/-flow-state-machine/index.html">net.corda.core.flows.FlowStateMachine</a></td>
|
||||
<td>
|
||||
<p>A FlowStateMachine instance is a suspendable fiber that delegates all actual logic to a <a href="../net.corda.core.flows/-flow-logic/index.html">FlowLogic</a> instance.
|
||||
For any given flow there is only one PSM, even if that flow invokes subflows.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.statemachine/-flow-state-machine-impl/index.html">net.corda.node.services.statemachine.FlowStateMachineImpl</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.client.model/-flow-status/index.html">net.corda.client.model.FlowStatus</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.contracts/-frequency/index.html">net.corda.core.contracts.Frequency</a></td>
|
||||
<td>
|
||||
<p>Frequency at which an event occurs - the enumerator also casts to an integer specifying the number of times per year
|
||||
@ -1057,7 +1179,7 @@ container), shares of the same class in a specific company are fungible and coun
|
||||
<td>
|
||||
<a href="../net.corda.client.model/-gathered-transaction-data-model/index.html">net.corda.client.model.GatheredTransactionDataModel</a></td>
|
||||
<td>
|
||||
<p>This model provides an observable list of transactions and what state machines/protocols recorded them</p>
|
||||
<p>This model provides an observable list of transactions and what state machines/flows recorded them</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -1097,7 +1219,7 @@ service would provide.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.protocols/-illegal-protocol-logic-exception/index.html">net.corda.core.protocols.IllegalProtocolLogicException</a></td>
|
||||
<a href="../net.corda.core.flows/-illegal-flow-logic-exception/index.html">net.corda.core.flows.IllegalFlowLogicException</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1145,7 +1267,7 @@ set via the constructor and the class is immutable.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-input-state-ref-resolve-failed/index.html">net.corda.protocols.InputStateRefResolveFailed</a></td>
|
||||
<a href="../net.corda.flows/-input-state-ref-resolve-failed/index.html">net.corda.flows.InputStateRefResolveFailed</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1765,27 +1887,27 @@ trying to construct the set.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-notary-change-protocol/index.html">net.corda.protocols.NotaryChangeProtocol</a></td>
|
||||
<a href="../net.corda.flows/-notary-change-flow/index.html">net.corda.flows.NotaryChangeFlow</a></td>
|
||||
<td>
|
||||
<p>A protocol to be used for changing a states Notary. This is required since all input states to a transaction
|
||||
<p>A flow to be used for changing a states Notary. This is required since all input states to a transaction
|
||||
must point to the same notary.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-notary-error/index.html">net.corda.protocols.NotaryError</a></td>
|
||||
<a href="../net.corda.flows/-notary-error/index.html">net.corda.flows.NotaryError</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-notary-exception/index.html">net.corda.protocols.NotaryException</a></td>
|
||||
<a href="../net.corda.flows/-notary-exception/index.html">net.corda.flows.NotaryException</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-notary-protocol/index.html">net.corda.protocols.NotaryProtocol</a></td>
|
||||
<a href="../net.corda.flows/-notary-flow/index.html">net.corda.flows.NotaryFlow</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1878,12 +2000,6 @@ functionality to Java, but it wont arrive for a few years yet</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node/-params-spec/index.html">net.corda.node.ParamsSpec</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.utilities.certsigning/-params-spec/index.html">net.corda.node.utilities.certsigning.ParamsSpec</a></td>
|
||||
<td>
|
||||
</td>
|
||||
@ -1911,7 +2027,7 @@ because of permissioning)</p>
|
||||
<td>
|
||||
<p>The <a href="../net.corda.core.crypto/-party/index.html">Party</a> class represents an entity on the network, which is typically identified by a legal <a href="../net.corda.core.crypto/-party/name.html">name</a> and public key
|
||||
that it can sign transactions under. As parties may use multiple keys for signing and, for example, have offline backup
|
||||
keys, the "public key" of a party is represented by a composite construct – a <a href="../net.corda.core.crypto/-public-key-tree/index.html">PublicKeyTree</a>, which combines multiple
|
||||
keys, the "public key" of a party is represented by a composite construct – a <a href="../net.corda.core.crypto/-composite-key/index.html">CompositeKey</a>, which combines multiple
|
||||
cryptographic public key primitives into a tree structure.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@ -2053,93 +2169,6 @@ a singleton).</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.api/-protocol-class-ref/index.html">net.corda.node.api.ProtocolClassRef</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.messaging/-protocol-handle/index.html">net.corda.node.services.messaging.ProtocolHandle</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.statemachine/-protocol-i-o-request/index.html">net.corda.node.services.statemachine.ProtocolIORequest</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.api/-protocol-instance-ref/index.html">net.corda.node.api.ProtocolInstanceRef</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.protocols/-protocol-logic/index.html">net.corda.core.protocols.ProtocolLogic</a></td>
|
||||
<td>
|
||||
<p>A sub-class of <a href="../net.corda.core.protocols/-protocol-logic/index.html">ProtocolLogic</a> implements a protocol flow using direct, straight line blocking code. Thus you
|
||||
can write complex protocol logic in an ordinary fashion, without having to think about callbacks, restarting after
|
||||
a node crash, how many instances of your protocol there are running and so on.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.protocols/-protocol-logic-ref/index.html">net.corda.core.protocols.ProtocolLogicRef</a></td>
|
||||
<td>
|
||||
<p>A class representing a <a href="../net.corda.core.protocols/-protocol-logic/index.html">ProtocolLogic</a> instance which would be possible to safely pass out of the contract sandbox.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.protocols/-protocol-logic-ref-factory/index.html">net.corda.core.protocols.ProtocolLogicRefFactory</a></td>
|
||||
<td>
|
||||
<p>A class for conversion to and from <a href="../net.corda.core.protocols/-protocol-logic/index.html">ProtocolLogic</a> and <a href="../net.corda.core.protocols/-protocol-logic-ref/index.html">ProtocolLogicRef</a> instances.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.api/-protocol-ref.html">net.corda.node.api.ProtocolRef</a></td>
|
||||
<td>
|
||||
<p>Encapsulates the protocol to be instantiated. e.g. TwoPartyTradeProtocol.Buyer.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.api/-protocol-requiring-attention/index.html">net.corda.node.api.ProtocolRequiringAttention</a></td>
|
||||
<td>
|
||||
<p>Thinking that Instant is OK for short lived protocol deadlines.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.protocols/-protocol-session-exception/index.html">net.corda.core.protocols.ProtocolSessionException</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.protocols/-protocol-state-machine/index.html">net.corda.core.protocols.ProtocolStateMachine</a></td>
|
||||
<td>
|
||||
<p>A ProtocolStateMachine instance is a suspendable fiber that delegates all actual logic to a <a href="../net.corda.core.protocols/-protocol-logic/index.html">ProtocolLogic</a> instance.
|
||||
For any given flow there is only one PSM, even if that protocol invokes subprotocols.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.statemachine/-protocol-state-machine-impl/index.html">net.corda.node.services.statemachine.ProtocolStateMachineImpl</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.client.model/-protocol-status/index.html">net.corda.client.model.ProtocolStatus</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.crypto/java.security.-public-key/index.html">java.security.PublicKey</a> (extensions in package net.corda.core.crypto)</td>
|
||||
<td>
|
||||
</td>
|
||||
@ -2159,26 +2188,6 @@ For any given flow there is only one PSM, even if that protocol invokes subproto
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.crypto/-public-key-tree/index.html">net.corda.core.crypto.PublicKeyTree</a></td>
|
||||
<td>
|
||||
<p>A tree data structure that enables the representation of composite public keys.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.utilities/-public-key-tree-column-type/index.html">net.corda.node.utilities.PublicKeyTreeColumnType</a></td>
|
||||
<td>
|
||||
<p><a href="#">ColumnType</a> for marshalling to/from database on behalf of <a href="../net.corda.core.crypto/-public-key-tree/index.html">PublicKeyTree</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.testing/-public-key-tree-generator/index.html">net.corda.core.testing.PublicKeyTreeGenerator</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.schemas/-queryable-state/index.html">net.corda.core.schemas.QueryableState</a></td>
|
||||
<td>
|
||||
<p>A contract state that may be mapped to database schemas configured for this node to support querying for,
|
||||
@ -2244,6 +2253,21 @@ to. These permissions are represented as <a href="#">String</a>s to allow RPC im
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.transactions/-raft-uniqueness-provider/index.html">net.corda.node.services.transactions.RaftUniquenessProvider</a></td>
|
||||
<td>
|
||||
<p>A uniqueness provider that records committed input states in a distributed collection replicated and
|
||||
persisted in a Raft cluster, using the Copycat framework (http://atomix.io/copycat/).</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.transactions/-raft-validating-notary-service/index.html">net.corda.node.services.transactions.RaftValidatingNotaryService</a></td>
|
||||
<td>
|
||||
<p>A validating notary service operated by a group of mutually trusting parties, uses the Raft algorithm to achieve consensus.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.client.fxutils/-read-only-backed-observable-map-base/index.html">net.corda.client.fxutils.ReadOnlyBackedObservableMapBase</a></td>
|
||||
<td>
|
||||
<p><a href="../net.corda.client.fxutils/-read-only-backed-observable-map-base/index.html">ReadOnlyBackedObservableMapBase</a> is a base class implementing all abstract functions required for an <a href="#">ObservableMap</a>
|
||||
@ -2299,9 +2323,9 @@ non-backed observable</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-resolve-transactions-protocol/index.html">net.corda.protocols.ResolveTransactionsProtocol</a></td>
|
||||
<a href="../net.corda.flows/-resolve-transactions-flow/index.html">net.corda.flows.ResolveTransactionsFlow</a></td>
|
||||
<td>
|
||||
<p>This protocol is used to verify the validity of a transaction by recursively checking the validity of all the
|
||||
<p>This flow is used to verify the validity of a transaction by recursively checking the validity of all the
|
||||
dependencies. Once a transaction is checked its inserted into local storage so it can be relayed and wont be
|
||||
checked again.</p>
|
||||
</td>
|
||||
@ -2339,7 +2363,7 @@ again.</p>
|
||||
<a href="../net.corda.core.contracts/-scheduled-activity/index.html">net.corda.core.contracts.ScheduledActivity</a></td>
|
||||
<td>
|
||||
<p>This class represents the lifecycle activity that a contract state of type <a href="../net.corda.core.contracts/-linear-state/index.html">LinearState</a> would like to perform at a given point in time.
|
||||
e.g. run a fixing protocol.</p>
|
||||
e.g. run a fixing flow.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -2462,7 +2486,7 @@ type safety hack.</p>
|
||||
<a href="../net.corda.core.node/-service-entry/index.html">net.corda.core.node.ServiceEntry</a></td>
|
||||
<td>
|
||||
<p>Information for an advertised service including the service specific identity information.
|
||||
The identity can be used in protocols and is distinct from the Nodes legalIdentity</p>
|
||||
The identity can be used in flows and is distinct from the Nodes legalIdentity</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -2489,7 +2513,7 @@ functionality and you dont want to hard-code which types in the interface.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-service-request-message/index.html">net.corda.protocols.ServiceRequestMessage</a></td>
|
||||
<a href="../net.corda.flows/-service-request-message/index.html">net.corda.flows.ServiceRequestMessage</a></td>
|
||||
<td>
|
||||
<p>Abstract superclass for request messages sent to services which expect a reply.</p>
|
||||
</td>
|
||||
@ -2597,8 +2621,8 @@ Points at which polynomial pieces connect are known as <emph>knots</emph>.</p>
|
||||
<td>
|
||||
<a href="../net.corda.node.services.statemachine/-state-machine-manager/index.html">net.corda.node.services.statemachine.StateMachineManager</a></td>
|
||||
<td>
|
||||
<p>A StateMachineManager is responsible for coordination and persistence of multiple <a href="../net.corda.core.protocols/-protocol-state-machine/index.html">ProtocolStateMachine</a> objects.
|
||||
Each such object represents an instantiation of a (two-party) protocol that has reached a particular point.</p>
|
||||
<p>A StateMachineManager is responsible for coordination and persistence of multiple <a href="../net.corda.core.flows/-flow-state-machine/index.html">FlowStateMachine</a> objects.
|
||||
Each such object represents an instantiation of a (two-party) flow that has reached a particular point.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -2606,12 +2630,12 @@ Each such object represents an instantiation of a (two-party) protocol that has
|
||||
<a href="../net.corda.core.node.services/-state-machine-recorded-transaction-mapping-storage/index.html">net.corda.core.node.services.StateMachineRecordedTransactionMappingStorage</a></td>
|
||||
<td>
|
||||
<p>This is the interface to storage storing state machine -> recorded tx mappings. Any time a transaction is recorded
|
||||
during a protocol run <a href="../net.corda.core.node.services/-state-machine-recorded-transaction-mapping-storage/add-mapping.html">addMapping</a> should be called.</p>
|
||||
during a flow run <a href="../net.corda.core.node.services/-state-machine-recorded-transaction-mapping-storage/add-mapping.html">addMapping</a> should be called.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.core.protocols/-state-machine-run-id/index.html">net.corda.core.protocols.StateMachineRunId</a></td>
|
||||
<a href="../net.corda.core.flows/-state-machine-run-id/index.html">net.corda.core.flows.StateMachineRunId</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
@ -2655,13 +2679,13 @@ transaction defined the state and where in that transaction it was.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-state-replacement-exception/index.html">net.corda.protocols.StateReplacementException</a></td>
|
||||
<a href="../net.corda.flows/-state-replacement-exception/index.html">net.corda.flows.StateReplacementException</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-state-replacement-refused/index.html">net.corda.protocols.StateReplacementRefused</a></td>
|
||||
<a href="../net.corda.flows/-state-replacement-refused/index.html">net.corda.flows.StateReplacementRefused</a></td>
|
||||
<td>
|
||||
<p>Thrown when a participant refuses the proposed state replacement</p>
|
||||
</td>
|
||||
@ -2678,7 +2702,7 @@ transaction defined the state and where in that transaction it was.</p>
|
||||
<a href="../net.corda.core.node.services/-storage-service/index.html">net.corda.core.node.services.StorageService</a></td>
|
||||
<td>
|
||||
<p>A sketch of an interface to a simple key/value storage system. Intended for persistence of simple blobs like
|
||||
transactions, serialised protocol state machines and so on. Again, this isnt intended to imply lack of SQL or
|
||||
transactions, serialised flow state machines and so on. Again, this isnt intended to imply lack of SQL or
|
||||
anything like that, this interface is only big enough to support the prototyping work.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@ -2887,16 +2911,16 @@ used to set it up. Note that the initializer will be called with the TransientPr
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-two-party-deal-protocol/index.html">net.corda.protocols.TwoPartyDealProtocol</a></td>
|
||||
<a href="../net.corda.flows/-two-party-deal-flow/index.html">net.corda.flows.TwoPartyDealFlow</a></td>
|
||||
<td>
|
||||
<p>Classes for manipulating a two party deal or agreement.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-two-party-trade-protocol/index.html">net.corda.protocols.TwoPartyTradeProtocol</a></td>
|
||||
<a href="../net.corda.flows/-two-party-trade-flow/index.html">net.corda.flows.TwoPartyTradeFlow</a></td>
|
||||
<td>
|
||||
<p>This asset trading protocol implements a "delivery vs payment" type swap. It has two parties (B and S for buyer
|
||||
<p>This asset trading flow implements a "delivery vs payment" type swap. It has two parties (B and S for buyer
|
||||
and seller) and the following steps:</p>
|
||||
</td>
|
||||
</tr>
|
||||
@ -2967,9 +2991,9 @@ first. The wrapper helps you to avoid forgetting this vital step. Things you mig
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../net.corda.protocols/-validating-notary-protocol/index.html">net.corda.protocols.ValidatingNotaryProtocol</a></td>
|
||||
<a href="../net.corda.flows/-validating-notary-flow/index.html">net.corda.flows.ValidatingNotaryFlow</a></td>
|
||||
<td>
|
||||
<p>A notary commit protocol that makes sure a given transaction is valid before committing it. This does mean that the calling
|
||||
<p>A notary commit flow that makes sure a given transaction is valid before committing it. This does mean that the calling
|
||||
party has to reveal the whole transaction history; however, we avoid complex conflict resolution logic where a party
|
||||
has its input states "blocked" by a transaction from another party, and needs to establish whether that transaction was
|
||||
indeed valid.</p>
|
||||
|
4978
docs/build/html/api/index-outline.html
vendored
4978
docs/build/html/api/index-outline.html
vendored
File diff suppressed because one or more lines are too long
30
docs/build/html/api/index.html
vendored
30
docs/build/html/api/index.html
vendored
@ -23,6 +23,12 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.client.impl/index.html">net.corda.client.impl</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.client.mock/index.html">net.corda.client.mock</a></td>
|
||||
<td>
|
||||
</td>
|
||||
@ -83,6 +89,12 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.core.flows/index.html">net.corda.core.flows</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.core.math/index.html">net.corda.core.math</a></td>
|
||||
<td>
|
||||
</td>
|
||||
@ -107,12 +119,6 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.core.protocols/index.html">net.corda.core.protocols</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.core.schemas/index.html">net.corda.core.schemas</a></td>
|
||||
<td>
|
||||
</td>
|
||||
@ -143,6 +149,12 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.flows/index.html">net.corda.flows</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.node/index.html">net.corda.node</a></td>
|
||||
<td>
|
||||
</td>
|
||||
@ -269,12 +281,6 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.protocols/index.html">net.corda.protocols</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="net.corda.schemas/index.html">net.corda.schemas</a></td>
|
||||
<td>
|
||||
</td>
|
||||
|
42
docs/build/html/api/net.corda.client.impl/-corda-r-p-c-client-impl/-init-.html
vendored
Normal file
42
docs/build/html/api/net.corda.client.impl/-corda-r-p-c-client-impl/-init-.html
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>CordaRPCClientImpl.<init> - </title>
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<a href="../index.html">net.corda.client.impl</a> / <a href="index.html">CordaRPCClientImpl</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">CordaRPCClientImpl</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$<init>(, java.util.concurrent.locks.ReentrantLock, kotlin.String)/session">session</span><span class="symbol">:</span> <span class="identifier"><ERROR CLASS></span><span class="symbol">, </span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$<init>(, java.util.concurrent.locks.ReentrantLock, kotlin.String)/sessionLock">sessionLock</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/locks/ReentrantLock.html"><span class="identifier">ReentrantLock</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$<init>(, java.util.concurrent.locks.ReentrantLock, kotlin.String)/username">username</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span></code><br/>
|
||||
<p>Core RPC engine implementation, to learn how to use RPC you should be looking at <a href="../../net.corda.client/-corda-r-p-c-client/index.html">CordaRPCClient</a>.</p>
|
||||
<h1>Design notes</h1>
|
||||
<p>The way RPCs are handled is fairly standard except for the handling of observables. When an RPC might return
|
||||
an <a href="#">rx.Observable</a> it is specially tagged. This causes the client to create a new transient queue for the
|
||||
receiving of observables and their observations with a random ID in the name. This ID is sent to the server in
|
||||
a message header. All observations are sent via this single queue.</p>
|
||||
<p>The reason for doing it this way and not the more obvious approach of one-queue-per-observable is that we want
|
||||
the queues to be <emph>transient</emph>, meaning their lifetime in the broker is tied to the session that created them.
|
||||
A server side observable and its associated queue is not a cost-free thing, let alone the memory and resources
|
||||
needed to actually generate the observations themselves, therefore we want to ensure these cannot leak. A
|
||||
transient queue will be deleted automatically if the client session terminates, which by default happens on
|
||||
disconnect but can also be configured to happen after a short delay (this allows clients to e.g. switch IP
|
||||
address). On the server the deletion of the observations queue triggers unsubscription from the associated
|
||||
observables, which in turn may then be garbage collected.</p>
|
||||
<p>Creating a transient queue requires a roundtrip to the broker and thus doing an RPC that could return
|
||||
observables takes two server roundtrips instead of one. Thats why we require RPCs to be marked with
|
||||
<a href="../../net.corda.node.services.messaging/-r-p-c-returns-observables/index.html">RPCReturnsObservables</a> as needing this special treatment instead of always doing it.</p>
|
||||
<p>If the Artemis/JMS APIs allowed us to create transient queues assigned to someone else then we could
|
||||
potentially use a different design in which the node creates new transient queues (one per observable) on the
|
||||
fly. The client would then have to watch out for this and start consuming those queues as they were created.</p>
|
||||
<p>We use one queue per RPC because we dont know ahead of time how many observables the server might return and
|
||||
often the server doesnt know either, which pushes towards a single queue design, but at the same time the
|
||||
processing of observations returned by an RPC might be striped across multiple threads and wed like
|
||||
backpressure management to not be scoped per client process but with more granularity. So we end up with
|
||||
a compromise where the unit of backpressure management is the response to a single RPC.</p>
|
||||
<p>TODO: Backpressure isnt propagated all the way through the MQ broker at the moment.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
</HTML>
|
66
docs/build/html/api/net.corda.client.impl/-corda-r-p-c-client-impl/index.html
vendored
Normal file
66
docs/build/html/api/net.corda.client.impl/-corda-r-p-c-client-impl/index.html
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>CordaRPCClientImpl - </title>
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<a href="../index.html">net.corda.client.impl</a> / <a href=".">CordaRPCClientImpl</a><br/>
|
||||
<br/>
|
||||
<h1>CordaRPCClientImpl</h1>
|
||||
<code><span class="keyword">class </span><span class="identifier">CordaRPCClientImpl</span></code><br/>
|
||||
<p>Core RPC engine implementation, to learn how to use RPC you should be looking at <a href="../../net.corda.client/-corda-r-p-c-client/index.html">CordaRPCClient</a>.</p>
|
||||
<h1>Design notes</h1>
|
||||
<p>The way RPCs are handled is fairly standard except for the handling of observables. When an RPC might return
|
||||
an <a href="#">rx.Observable</a> it is specially tagged. This causes the client to create a new transient queue for the
|
||||
receiving of observables and their observations with a random ID in the name. This ID is sent to the server in
|
||||
a message header. All observations are sent via this single queue.</p>
|
||||
<p>The reason for doing it this way and not the more obvious approach of one-queue-per-observable is that we want
|
||||
the queues to be <emph>transient</emph>, meaning their lifetime in the broker is tied to the session that created them.
|
||||
A server side observable and its associated queue is not a cost-free thing, let alone the memory and resources
|
||||
needed to actually generate the observations themselves, therefore we want to ensure these cannot leak. A
|
||||
transient queue will be deleted automatically if the client session terminates, which by default happens on
|
||||
disconnect but can also be configured to happen after a short delay (this allows clients to e.g. switch IP
|
||||
address). On the server the deletion of the observations queue triggers unsubscription from the associated
|
||||
observables, which in turn may then be garbage collected.</p>
|
||||
<p>Creating a transient queue requires a roundtrip to the broker and thus doing an RPC that could return
|
||||
observables takes two server roundtrips instead of one. Thats why we require RPCs to be marked with
|
||||
<a href="../../net.corda.node.services.messaging/-r-p-c-returns-observables/index.html">RPCReturnsObservables</a> as needing this special treatment instead of always doing it.</p>
|
||||
<p>If the Artemis/JMS APIs allowed us to create transient queues assigned to someone else then we could
|
||||
potentially use a different design in which the node creates new transient queues (one per observable) on the
|
||||
fly. The client would then have to watch out for this and start consuming those queues as they were created.</p>
|
||||
<p>We use one queue per RPC because we dont know ahead of time how many observables the server might return and
|
||||
often the server doesnt know either, which pushes towards a single queue design, but at the same time the
|
||||
processing of observations returned by an RPC might be striped across multiple threads and wed like
|
||||
backpressure management to not be scoped per client process but with more granularity. So we end up with
|
||||
a compromise where the unit of backpressure management is the response to a single RPC.</p>
|
||||
<p>TODO: Backpressure isnt propagated all the way through the MQ broker at the moment.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<h3>Constructors</h3>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">CordaRPCClientImpl</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$<init>(, java.util.concurrent.locks.ReentrantLock, kotlin.String)/session">session</span><span class="symbol">:</span> <span class="identifier"><ERROR CLASS></span><span class="symbol">, </span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$<init>(, java.util.concurrent.locks.ReentrantLock, kotlin.String)/sessionLock">sessionLock</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/locks/ReentrantLock.html"><span class="identifier">ReentrantLock</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$<init>(, java.util.concurrent.locks.ReentrantLock, kotlin.String)/username">username</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span></code><p>Core RPC engine implementation, to learn how to use RPC you should be looking at <a href="../../net.corda.client/-corda-r-p-c-client/index.html">CordaRPCClient</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Functions</h3>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="proxy-for.html">proxyFor</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="symbol"><</span><span class="identifier">T</span> <span class="symbol">:</span> <a href="../../net.corda.node.services.messaging/-r-p-c-ops/index.html"><span class="identifier">RPCOps</span></a><span class="symbol">></span> <span class="identifier">proxyFor</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$proxyFor(java.lang.Class((net.corda.client.impl.CordaRPCClientImpl.proxyFor.T)), java.time.Duration, kotlin.Int)/rpcInterface">rpcInterface</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html"><span class="identifier">Class</span></a><span class="symbol"><</span><span class="identifier">T</span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$proxyFor(java.lang.Class((net.corda.client.impl.CordaRPCClientImpl.proxyFor.T)), java.time.Duration, kotlin.Int)/timeout">timeout</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Duration.html"><span class="identifier">Duration</span></a><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">, </span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$proxyFor(java.lang.Class((net.corda.client.impl.CordaRPCClientImpl.proxyFor.T)), java.time.Duration, kotlin.Int)/minVersion">minVersion</span><span class="symbol">:</span> <span class="identifier">Int</span> <span class="symbol">=</span> 0<span class="symbol">)</span><span class="symbol">: </span><span class="identifier">T</span></code><p>Builds a proxy for the given type, which must descend from <a href="../../net.corda.node.services.messaging/-r-p-c-ops/index.html">RPCOps</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</BODY>
|
||||
</HTML>
|
19
docs/build/html/api/net.corda.client.impl/-corda-r-p-c-client-impl/proxy-for.html
vendored
Normal file
19
docs/build/html/api/net.corda.client.impl/-corda-r-p-c-client-impl/proxy-for.html
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>CordaRPCClientImpl.proxyFor - </title>
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<a href="../index.html">net.corda.client.impl</a> / <a href="index.html">CordaRPCClientImpl</a> / <a href=".">proxyFor</a><br/>
|
||||
<br/>
|
||||
<h1>proxyFor</h1>
|
||||
<a name="net.corda.client.impl.CordaRPCClientImpl$proxyFor(java.lang.Class((net.corda.client.impl.CordaRPCClientImpl.proxyFor.T)), java.time.Duration, kotlin.Int)"></a>
|
||||
<code><span class="keyword">fun </span><span class="symbol"><</span><span class="identifier">T</span> <span class="symbol">:</span> <a href="../../net.corda.node.services.messaging/-r-p-c-ops/index.html"><span class="identifier">RPCOps</span></a><span class="symbol">></span> <span class="identifier">proxyFor</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$proxyFor(java.lang.Class((net.corda.client.impl.CordaRPCClientImpl.proxyFor.T)), java.time.Duration, kotlin.Int)/rpcInterface">rpcInterface</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html"><span class="identifier">Class</span></a><span class="symbol"><</span><span class="identifier">T</span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$proxyFor(java.lang.Class((net.corda.client.impl.CordaRPCClientImpl.proxyFor.T)), java.time.Duration, kotlin.Int)/timeout">timeout</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Duration.html"><span class="identifier">Duration</span></a><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">, </span><span class="identifier" id="net.corda.client.impl.CordaRPCClientImpl$proxyFor(java.lang.Class((net.corda.client.impl.CordaRPCClientImpl.proxyFor.T)), java.time.Duration, kotlin.Int)/minVersion">minVersion</span><span class="symbol">:</span> <span class="identifier">Int</span> <span class="symbol">=</span> 0<span class="symbol">)</span><span class="symbol">: </span><span class="identifier">T</span></code><br/>
|
||||
<p>Builds a proxy for the given type, which must descend from <a href="../../net.corda.node.services.messaging/-r-p-c-ops/index.html">RPCOps</a>.</p>
|
||||
<p><strong>See Also</strong><br/>
|
||||
<p><a href="../../net.corda.client/-corda-r-p-c-client/proxy.html">CordaRPCClient.proxy</a></p>
|
||||
</p>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
</HTML>
|
23
docs/build/html/api/net.corda.client.impl/index.html
vendored
Normal file
23
docs/build/html/api/net.corda.client.impl/index.html
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>net.corda.client.impl - </title>
|
||||
<link rel="stylesheet" href="../style.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<a href=".">net.corda.client.impl</a><br/>
|
||||
<br/>
|
||||
<h2>Package net.corda.client.impl</h2>
|
||||
<h3>Types</h3>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="-corda-r-p-c-client-impl/index.html">CordaRPCClientImpl</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">class </span><span class="identifier">CordaRPCClientImpl</span></code><p>Core RPC engine implementation, to learn how to use RPC you should be looking at <a href="../net.corda.client/-corda-r-p-c-client/index.html">CordaRPCClient</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</BODY>
|
||||
</HTML>
|
14
docs/build/html/api/net.corda.client.model/-flow-status/-init-.html
vendored
Normal file
14
docs/build/html/api/net.corda.client.model/-flow-status/-init-.html
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>FlowStatus.<init> - </title>
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<a href="../index.html">net.corda.client.model</a> / <a href="index.html">FlowStatus</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">FlowStatus</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.FlowStatus$<init>(kotlin.String)/status">status</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
</HTML>
|
36
docs/build/html/api/net.corda.client.model/-flow-status/index.html
vendored
Normal file
36
docs/build/html/api/net.corda.client.model/-flow-status/index.html
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>FlowStatus - </title>
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<a href="../index.html">net.corda.client.model</a> / <a href=".">FlowStatus</a><br/>
|
||||
<br/>
|
||||
<h1>FlowStatus</h1>
|
||||
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">FlowStatus</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<h3>Constructors</h3>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">FlowStatus</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.FlowStatus$<init>(kotlin.String)/status">status</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Properties</h3>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="status.html">status</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">val </span><span class="identifier">status</span><span class="symbol">: </span><span class="identifier">String</span></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</BODY>
|
||||
</HTML>
|
15
docs/build/html/api/net.corda.client.model/-flow-status/status.html
vendored
Normal file
15
docs/build/html/api/net.corda.client.model/-flow-status/status.html
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>FlowStatus.status - </title>
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<a href="../index.html">net.corda.client.model</a> / <a href="index.html">FlowStatus</a> / <a href=".">status</a><br/>
|
||||
<br/>
|
||||
<h1>status</h1>
|
||||
<a name="net.corda.client.model.FlowStatus$status"></a>
|
||||
<code><span class="keyword">val </span><span class="identifier">status</span><span class="symbol">: </span><span class="identifier">String</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
</HTML>
|
@ -8,7 +8,7 @@
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">GatheredTransactionDataModel</span><span class="symbol">(</span><span class="symbol">)</span></code><br/>
|
||||
<p>This model provides an observable list of transactions and what state machines/protocols recorded them</p>
|
||||
<p>This model provides an observable list of transactions and what state machines/flows recorded them</p>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<br/>
|
||||
<h1>GatheredTransactionDataModel</h1>
|
||||
<code><span class="keyword">class </span><span class="identifier">GatheredTransactionDataModel</span></code><br/>
|
||||
<p>This model provides an observable list of transactions and what state machines/protocols recorded them</p>
|
||||
<p>This model provides an observable list of transactions and what state machines/flows recorded them</p>
|
||||
<br/>
|
||||
<br/>
|
||||
<h3>Constructors</h3>
|
||||
@ -18,7 +18,7 @@
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">GatheredTransactionDataModel</span><span class="symbol">(</span><span class="symbol">)</span></code><p>This model provides an observable list of transactions and what state machines/protocols recorded them</p>
|
||||
<code><span class="identifier">GatheredTransactionDataModel</span><span class="symbol">(</span><span class="symbol">)</span></code><p>This model provides an observable list of transactions and what state machines/flows recorded them</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -51,7 +51,7 @@
|
||||
<td>
|
||||
<a href="lookup.html">lookup</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">lookup</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.NetworkIdentityModel$lookup(net.corda.core.crypto.PublicKeyTree)/publicKeyTree">publicKeyTree</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.node/-node-info/index.html"><span class="identifier">NodeInfo</span></a><span class="symbol">?</span></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">lookup</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.NetworkIdentityModel$lookup(net.corda.core.crypto.CompositeKey)/compositeKey">compositeKey</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.node/-node-info/index.html"><span class="identifier">NodeInfo</span></a><span class="symbol">?</span></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">net.corda.client.model</a> / <a href="index.html">NetworkIdentityModel</a> / <a href=".">lookup</a><br/>
|
||||
<br/>
|
||||
<h1>lookup</h1>
|
||||
<a name="net.corda.client.model.NetworkIdentityModel$lookup(net.corda.core.crypto.PublicKeyTree)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">lookup</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.NetworkIdentityModel$lookup(net.corda.core.crypto.PublicKeyTree)/publicKeyTree">publicKeyTree</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.node/-node-info/index.html"><span class="identifier">NodeInfo</span></a><span class="symbol">?</span></code><br/>
|
||||
<a name="net.corda.client.model.NetworkIdentityModel$lookup(net.corda.core.crypto.CompositeKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">lookup</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.NetworkIdentityModel$lookup(net.corda.core.crypto.CompositeKey)/compositeKey">compositeKey</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.node/-node-info/index.html"><span class="identifier">NodeInfo</span></a><span class="symbol">?</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<br/>
|
||||
<h1>clientToService</h1>
|
||||
<a name="net.corda.client.model.NodeMonitorModel$clientToService"></a>
|
||||
<code><span class="keyword">val </span><span class="identifier">clientToService</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span><span class="symbol"><</span><a href="../../net.corda.protocols/-cash-command/index.html"><span class="identifier">CashCommand</span></a><span class="symbol">></span></code><br/>
|
||||
<code><span class="keyword">val </span><span class="identifier">clientToService</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span><span class="symbol"><</span><a href="../../net.corda.flows/-cash-command/index.html"><span class="identifier">CashCommand</span></a><span class="symbol">></span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -30,7 +30,7 @@
|
||||
<td>
|
||||
<a href="client-to-service.html">clientToService</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">val </span><span class="identifier">clientToService</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span><span class="symbol"><</span><a href="../../net.corda.protocols/-cash-command/index.html"><span class="identifier">CashCommand</span></a><span class="symbol">></span></code></td>
|
||||
<code><span class="keyword">val </span><span class="identifier">clientToService</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span><span class="symbol"><</span><a href="../../net.corda.flows/-cash-command/index.html"><span class="identifier">CashCommand</span></a><span class="symbol">></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<a href="../index.html">net.corda.client.model</a> / <a href="index.html">ProgressTrackingEvent</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">ProgressTrackingEvent</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.ProgressTrackingEvent$<init>(net.corda.core.protocols.StateMachineRunId, kotlin.String)/stateMachineId">stateMachineId</span><span class="symbol">:</span> <a href="../../net.corda.core.protocols/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.ProgressTrackingEvent$<init>(net.corda.core.protocols.StateMachineRunId, kotlin.String)/message">message</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">ProgressTrackingEvent</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.ProgressTrackingEvent$<init>(net.corda.core.flows.StateMachineRunId, kotlin.String)/stateMachineId">stateMachineId</span><span class="symbol">:</span> <a href="../../net.corda.core.flows/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.ProgressTrackingEvent$<init>(net.corda.core.flows.StateMachineRunId, kotlin.String)/message">message</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">ProgressTrackingEvent</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.ProgressTrackingEvent$<init>(net.corda.core.protocols.StateMachineRunId, kotlin.String)/stateMachineId">stateMachineId</span><span class="symbol">:</span> <a href="../../net.corda.core.protocols/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.ProgressTrackingEvent$<init>(net.corda.core.protocols.StateMachineRunId, kotlin.String)/message">message</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span></code></td>
|
||||
<code><span class="identifier">ProgressTrackingEvent</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.ProgressTrackingEvent$<init>(net.corda.core.flows.StateMachineRunId, kotlin.String)/stateMachineId">stateMachineId</span><span class="symbol">:</span> <a href="../../net.corda.core.flows/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.ProgressTrackingEvent$<init>(net.corda.core.flows.StateMachineRunId, kotlin.String)/message">message</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -34,7 +34,7 @@
|
||||
<td>
|
||||
<a href="state-machine-id.html">stateMachineId</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">val </span><span class="identifier">stateMachineId</span><span class="symbol">: </span><a href="../../net.corda.core.protocols/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a></code></td>
|
||||
<code><span class="keyword">val </span><span class="identifier">stateMachineId</span><span class="symbol">: </span><a href="../../net.corda.core.flows/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<br/>
|
||||
<h1>stateMachineId</h1>
|
||||
<a name="net.corda.client.model.ProgressTrackingEvent$stateMachineId"></a>
|
||||
<code><span class="keyword">val </span><span class="identifier">stateMachineId</span><span class="symbol">: </span><a href="../../net.corda.core.protocols/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a></code><br/>
|
||||
<code><span class="keyword">val </span><span class="identifier">stateMachineId</span><span class="symbol">: </span><a href="../../net.corda.core.flows/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<a href="../index.html">net.corda.client.model</a> / <a href="index.html">StateMachineData</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">StateMachineData</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.protocols.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.ProtocolStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/id">id</span><span class="symbol">:</span> <a href="../../net.corda.core.protocols/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.protocols.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.ProtocolStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/protocolStatus">protocolStatus</span><span class="symbol">:</span> <span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-protocol-status/index.html"><span class="identifier">ProtocolStatus</span></a><span class="symbol">?</span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.protocols.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.ProtocolStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/stateMachineStatus">stateMachineStatus</span><span class="symbol">:</span> <span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-state-machine-status/index.html"><span class="identifier">StateMachineStatus</span></a><span class="symbol">></span><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">StateMachineData</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.flows.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.FlowStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/id">id</span><span class="symbol">:</span> <a href="../../net.corda.core.flows/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.flows.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.FlowStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/flowStatus">flowStatus</span><span class="symbol">:</span> <span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-flow-status/index.html"><span class="identifier">FlowStatus</span></a><span class="symbol">?</span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.flows.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.FlowStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/stateMachineStatus">stateMachineStatus</span><span class="symbol">:</span> <span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-state-machine-status/index.html"><span class="identifier">StateMachineStatus</span></a><span class="symbol">></span><span class="symbol">)</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
15
docs/build/html/api/net.corda.client.model/-state-machine-data/flow-status.html
vendored
Normal file
15
docs/build/html/api/net.corda.client.model/-state-machine-data/flow-status.html
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>StateMachineData.flowStatus - </title>
|
||||
<link rel="stylesheet" href="../../style.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<a href="../index.html">net.corda.client.model</a> / <a href="index.html">StateMachineData</a> / <a href=".">flowStatus</a><br/>
|
||||
<br/>
|
||||
<h1>flowStatus</h1>
|
||||
<a name="net.corda.client.model.StateMachineData$flowStatus"></a>
|
||||
<code><span class="keyword">val </span><span class="identifier">flowStatus</span><span class="symbol">: </span><span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-flow-status/index.html"><span class="identifier">FlowStatus</span></a><span class="symbol">?</span><span class="symbol">></span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
</HTML>
|
@ -8,7 +8,7 @@
|
||||
<br/>
|
||||
<h1>id</h1>
|
||||
<a name="net.corda.client.model.StateMachineData$id"></a>
|
||||
<code><span class="keyword">val </span><span class="identifier">id</span><span class="symbol">: </span><a href="../../net.corda.core.protocols/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a></code><br/>
|
||||
<code><span class="keyword">val </span><span class="identifier">id</span><span class="symbol">: </span><a href="../../net.corda.core.flows/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">StateMachineData</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.protocols.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.ProtocolStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/id">id</span><span class="symbol">:</span> <a href="../../net.corda.core.protocols/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.protocols.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.ProtocolStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/protocolStatus">protocolStatus</span><span class="symbol">:</span> <span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-protocol-status/index.html"><span class="identifier">ProtocolStatus</span></a><span class="symbol">?</span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.protocols.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.ProtocolStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/stateMachineStatus">stateMachineStatus</span><span class="symbol">:</span> <span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-state-machine-status/index.html"><span class="identifier">StateMachineStatus</span></a><span class="symbol">></span><span class="symbol">)</span></code></td>
|
||||
<code><span class="identifier">StateMachineData</span><span class="symbol">(</span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.flows.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.FlowStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/id">id</span><span class="symbol">:</span> <a href="../../net.corda.core.flows/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.flows.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.FlowStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/flowStatus">flowStatus</span><span class="symbol">:</span> <span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-flow-status/index.html"><span class="identifier">FlowStatus</span></a><span class="symbol">?</span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.client.model.StateMachineData$<init>(net.corda.core.flows.StateMachineRunId, javafx.beans.value.ObservableValue((net.corda.client.model.FlowStatus)), javafx.beans.value.ObservableValue((net.corda.client.model.StateMachineStatus)))/stateMachineStatus">stateMachineStatus</span><span class="symbol">:</span> <span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-state-machine-status/index.html"><span class="identifier">StateMachineStatus</span></a><span class="symbol">></span><span class="symbol">)</span></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -26,15 +26,15 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="id.html">id</a></td>
|
||||
<a href="flow-status.html">flowStatus</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">val </span><span class="identifier">id</span><span class="symbol">: </span><a href="../../net.corda.core.protocols/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a></code></td>
|
||||
<code><span class="keyword">val </span><span class="identifier">flowStatus</span><span class="symbol">: </span><span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-flow-status/index.html"><span class="identifier">FlowStatus</span></a><span class="symbol">?</span><span class="symbol">></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="protocol-status.html">protocolStatus</a></td>
|
||||
<a href="id.html">id</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">val </span><span class="identifier">protocolStatus</span><span class="symbol">: </span><span class="identifier">ObservableValue</span><span class="symbol"><</span><a href="../-protocol-status/index.html"><span class="identifier">ProtocolStatus</span></a><span class="symbol">?</span><span class="symbol">></span></code></td>
|
||||
<code><span class="keyword">val </span><span class="identifier">id</span><span class="symbol">: </span><a href="../../net.corda.core.flows/-state-machine-run-id/index.html"><span class="identifier">StateMachineRunId</span></a></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -39,6 +39,12 @@ TODO hook up an actual oracle</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="-flow-status/index.html">FlowStatus</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">FlowStatus</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="-gathered-transaction-data/index.html">GatheredTransactionData</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">GatheredTransactionData</span></code></td>
|
||||
@ -47,7 +53,7 @@ TODO hook up an actual oracle</p>
|
||||
<td>
|
||||
<a href="-gathered-transaction-data-model/index.html">GatheredTransactionDataModel</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">class </span><span class="identifier">GatheredTransactionDataModel</span></code><p>This model provides an observable list of transactions and what state machines/protocols recorded them</p>
|
||||
<code><span class="keyword">class </span><span class="identifier">GatheredTransactionDataModel</span></code><p>This model provides an observable list of transactions and what state machines/flows recorded them</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -86,12 +92,6 @@ because of permissioning)</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="-protocol-status/index.html">ProtocolStatus</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">ProtocolStatus</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="-state-machine-data/index.html">StateMachineData</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">StateMachineData</span></code></td>
|
||||
|
@ -99,7 +99,7 @@ unfortunately Artemis tends to bury the exception when the password is wrong.</p
|
||||
<td>
|
||||
<a href="../../net.corda.node.services.messaging/-artemis-messaging-component/parse-key-from-queue-name.html">parseKeyFromQueueName</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">parseKeyFromQueueName</span><span class="symbol">(</span><span class="identifier" id="net.corda.node.services.messaging.ArtemisMessagingComponent$parseKeyFromQueueName(kotlin.String)/name">name</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">parseKeyFromQueueName</span><span class="symbol">(</span><span class="identifier" id="net.corda.node.services.messaging.ArtemisMessagingComponent$parseKeyFromQueueName(kotlin.String)/name">name</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -17,7 +17,8 @@ proxies.</p>
|
||||
calls from many threads at once you should cache one proxy per thread and reuse them. This function itself is
|
||||
thread safe though so requires no extra synchronisation.</p>
|
||||
<p>RPC sends and receives are logged on the net.corda.rpc logger.</p>
|
||||
<p>By default there are no timeouts on calls. RPCs can survive temporary losses or changes in connectivity,
|
||||
<p>By default there are no timeouts on calls. This is deliberate, RPCs without timeouts can survive restarts,
|
||||
maintenance downtime and moves of the server. RPCs can survive temporary losses or changes in client connectivity,
|
||||
like switching between wifi networks. You can specify a timeout on the level of a proxy. If a call times
|
||||
out it will throw <a href="#">RPCException.Deadline</a>.</p>
|
||||
<p>The <a href="../../net.corda.node.services.messaging/-corda-r-p-c-ops/index.html">CordaRPCOps</a> defines what client RPCs are available. If an RPC returns an <a href="#">Observable</a> anywhere in the
|
||||
|
@ -7,10 +7,10 @@
|
||||
<a href="../../index.html">net.corda.contracts.asset</a> / <a href="../index.html">Cash</a> / <a href="index.html">State</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.PublicKeyTree)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.PublicKeyTree)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.CompositeKey)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.CompositeKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, kotlin.Int)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, kotlin.Int)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, kotlin.Int)/encumbrance">encumbrance</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, kotlin.Int)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, kotlin.Int)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, kotlin.Int)/encumbrance">encumbrance</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">)</span></code><br/>
|
||||
<p>A state representing a cash claim against some party.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.PublicKeyTree)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.PublicKeyTree)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span></code><code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, kotlin.Int)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, kotlin.Int)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, kotlin.Int)/encumbrance">encumbrance</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">)</span></code><p>A state representing a cash claim against some party.</p>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.CompositeKey)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.CompositeKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((java.util.Currency)), net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span></code><code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, kotlin.Int)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, kotlin.Int)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, kotlin.Int)/encumbrance">encumbrance</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">)</span></code><p>A state representing a cash claim against some party.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -58,7 +58,7 @@ owner to sign, some (i.e. cash) also require the issuer.</p>
|
||||
<td>
|
||||
<a href="owner.html">owner</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">val </span><span class="identifier">owner</span><span class="symbol">: </span><a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a></code><p>There must be a MoveCommand signed by this key to claim the amount.</p>
|
||||
<code><span class="keyword">val </span><span class="identifier">owner</span><span class="symbol">: </span><a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a></code><p>There must be a MoveCommand signed by this key to claim the amount.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -84,7 +84,7 @@ owner to sign, some (i.e. cash) also require the issuer.</p>
|
||||
<td>
|
||||
<a href="move.html">move</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">move</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/newAmount">newAmount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../../net.corda.core.contracts/-fungible-asset/index.html"><span class="identifier">FungibleAsset</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">move</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/newAmount">newAmount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../../net.corda.core.contracts/-fungible-asset/index.html"><span class="identifier">FungibleAsset</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@ -103,7 +103,7 @@ owner to sign, some (i.e. cash) also require the issuer.</p>
|
||||
<td>
|
||||
<a href="with-new-owner.html">withNewOwner</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withNewOwner</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$withNewOwner(net.corda.core.crypto.PublicKeyTree)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><p>Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withNewOwner</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$withNewOwner(net.corda.core.crypto.CompositeKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><p>Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -129,13 +129,13 @@ owner to sign, some (i.e. cash) also require the issuer.</p>
|
||||
<td>
|
||||
<a href="../../owned by.html">owned by</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">infix</span> <span class="keyword">fun </span><span class="identifier">State</span><span class="symbol">.</span><span class="identifier">owned by</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset$owned by(net.corda.contracts.asset.Cash.State, net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">State</span></code></td>
|
||||
<code><span class="keyword">infix</span> <span class="keyword">fun </span><span class="identifier">State</span><span class="symbol">.</span><span class="identifier">owned by</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset$owned by(net.corda.contracts.asset.Cash.State, net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">State</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../../owned-by.html">ownedBy</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">State</span><span class="symbol">.</span><span class="identifier">ownedBy</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset$ownedBy(net.corda.contracts.asset.Cash.State, net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">State</span></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">State</span><span class="symbol">.</span><span class="identifier">ownedBy</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset$ownedBy(net.corda.contracts.asset.Cash.State, net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">State</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../../index.html">net.corda.contracts.asset</a> / <a href="../index.html">Cash</a> / <a href="index.html">State</a> / <a href=".">move</a><br/>
|
||||
<br/>
|
||||
<h1>move</h1>
|
||||
<a name="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">move</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/newAmount">newAmount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../../net.corda.core.contracts/-fungible-asset/index.html"><span class="identifier">FungibleAsset</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span></code><br/>
|
||||
<a name="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">move</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/newAmount">newAmount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../../net.corda.core.contracts/-fungible-asset/index.html"><span class="identifier">FungibleAsset</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<br/>
|
||||
<h1>owner</h1>
|
||||
<a name="net.corda.contracts.asset.Cash.State$owner"></a>
|
||||
<code><span class="keyword">val </span><span class="identifier">owner</span><span class="symbol">: </span><a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a></code><br/>
|
||||
<code><span class="keyword">val </span><span class="identifier">owner</span><span class="symbol">: </span><a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a></code><br/>
|
||||
Overrides <a href="../../../net.corda.core.contracts/-fungible-asset/owner.html">FungibleAsset.owner</a><br/>
|
||||
<p>There must be a MoveCommand signed by this key to claim the amount.</p>
|
||||
<br/>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../../index.html">net.corda.contracts.asset</a> / <a href="../index.html">Cash</a> / <a href="index.html">State</a> / <a href=".">withNewOwner</a><br/>
|
||||
<br/>
|
||||
<h1>withNewOwner</h1>
|
||||
<a name="net.corda.contracts.asset.Cash.State$withNewOwner(net.corda.core.crypto.PublicKeyTree)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withNewOwner</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$withNewOwner(net.corda.core.crypto.PublicKeyTree)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><br/>
|
||||
<a name="net.corda.contracts.asset.Cash.State$withNewOwner(net.corda.core.crypto.CompositeKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withNewOwner</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash.State$withNewOwner(net.corda.core.crypto.CompositeKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><br/>
|
||||
Overrides <a href="../../../net.corda.core.contracts/-ownable-state/with-new-owner.html">OwnableState.withNewOwner</a><br/>
|
||||
<p>Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone</p>
|
||||
<br/>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">net.corda.contracts.asset</a> / <a href="index.html">Cash</a> / <a href=".">deriveState</a><br/>
|
||||
<br/>
|
||||
<h1>deriveState</h1>
|
||||
<a name="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">deriveState</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/txState">txState</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-transaction-state/index.html"><span class="identifier">TransactionState</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/amount">amount</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.contracts/-transaction-state/index.html"><span class="identifier">TransactionState</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span></code><br/>
|
||||
<a name="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">deriveState</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/txState">txState</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-transaction-state/index.html"><span class="identifier">TransactionState</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/amount">amount</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.contracts/-transaction-state/index.html"><span class="identifier">TransactionState</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span></code><br/>
|
||||
<p>Derive a new transaction state based on the given example, with amount and owner modified. This allows concrete
|
||||
implementations to have fields in their state which we dont know about here, and we simply leave them untouched
|
||||
when sending out "change" from spending/exiting.</p>
|
||||
|
@ -7,13 +7,13 @@
|
||||
<a href="../index.html">net.corda.contracts.asset</a> / <a href="index.html">Cash</a> / <a href=".">generateIssue</a><br/>
|
||||
<br/>
|
||||
<h1>generateIssue</h1>
|
||||
<a name="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/tx">tx</span><span class="symbol">:</span> <a href="../../net.corda.core.transactions/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/tokenDef">tokenDef</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/pennies">pennies</span><span class="symbol">:</span> <span class="identifier">Long</span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/notary">notary</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/tx">tx</span><span class="symbol">:</span> <a href="../../net.corda.core.transactions/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/tokenDef">tokenDef</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/pennies">pennies</span><span class="symbol">:</span> <span class="identifier">Long</span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/notary">notary</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<p>Puts together an issuance transaction from the given template, that starts out being owned by the given pubkey.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
<a name="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/tx">tx</span><span class="symbol">:</span> <a href="../../net.corda.core.transactions/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/amount">amount</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/notary">notary</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/tx">tx</span><span class="symbol">:</span> <a href="../../net.corda.core.transactions/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/amount">amount</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/notary">notary</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<p>Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -85,7 +85,7 @@ the same transaction.</p>
|
||||
<td>
|
||||
<a href="derive-state.html">deriveState</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">deriveState</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/txState">txState</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-transaction-state/index.html"><span class="identifier">TransactionState</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/amount">amount</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.contracts/-transaction-state/index.html"><span class="identifier">TransactionState</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span></code><p>Derive a new transaction state based on the given example, with amount and owner modified. This allows concrete
|
||||
<code><span class="keyword">fun </span><span class="identifier">deriveState</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/txState">txState</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-transaction-state/index.html"><span class="identifier">TransactionState</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/amount">amount</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$deriveState(net.corda.core.contracts.TransactionState((net.corda.contracts.asset.Cash.State)), net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../net.corda.core.contracts/-transaction-state/index.html"><span class="identifier">TransactionState</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span></code><p>Derive a new transaction state based on the given example, with amount and owner modified. This allows concrete
|
||||
implementations to have fields in their state which we dont know about here, and we simply leave them untouched
|
||||
when sending out "change" from spending/exiting.</p>
|
||||
</td>
|
||||
@ -106,8 +106,8 @@ when sending out "change" from spending/exiting.</p>
|
||||
<td>
|
||||
<a href="generate-issue.html">generateIssue</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/tx">tx</span><span class="symbol">:</span> <a href="../../net.corda.core.transactions/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/tokenDef">tokenDef</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/pennies">pennies</span><span class="symbol">:</span> <span class="identifier">Long</span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/notary">notary</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Puts together an issuance transaction from the given template, that starts out being owned by the given pubkey.</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/tx">tx</span><span class="symbol">:</span> <a href="../../net.corda.core.transactions/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/amount">amount</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.PublicKeyTree, net.corda.core.crypto.Party)/notary">notary</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey.</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/tx">tx</span><span class="symbol">:</span> <a href="../../net.corda.core.transactions/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/tokenDef">tokenDef</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/pennies">pennies</span><span class="symbol">:</span> <span class="identifier">Long</span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Issued((java.util.Currency)), kotlin.Long, net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/notary">notary</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Puts together an issuance transaction from the given template, that starts out being owned by the given pubkey.</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/tx">tx</span><span class="symbol">:</span> <a href="../../net.corda.core.transactions/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/amount">amount</span><span class="symbol">:</span> <a href="../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Currency.html"><span class="identifier">Currency</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/owner">owner</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.Cash$generateIssue(net.corda.core.transactions.TransactionBuilder, net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((java.util.Currency)))), net.corda.core.crypto.CompositeKey, net.corda.core.crypto.Party)/notary">notary</span><span class="symbol">:</span> <a href="../../net.corda.core.crypto/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -7,10 +7,10 @@
|
||||
<a href="../../index.html">net.corda.contracts.asset</a> / <a href="../index.html">CommodityContract</a> / <a href="index.html">State</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.PublicKeyTree)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.PublicKeyTree)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.CompositeKey)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.CompositeKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.PublicKeyTree)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.CompositeKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span></code><br/>
|
||||
<p>A state representing a commodity claim against some party</p>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<br/>
|
||||
<h1>exitKeys</h1>
|
||||
<a name="net.corda.contracts.asset.CommodityContract.State$exitKeys"></a>
|
||||
<code><span class="keyword">val </span><span class="identifier">exitKeys</span><span class="symbol">: </span><span class="identifier">MutableSet</span><span class="symbol"><</span><a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">></span></code><br/>
|
||||
<code><span class="keyword">val </span><span class="identifier">exitKeys</span><span class="symbol">: </span><span class="identifier">MutableSet</span><span class="symbol"><</span><a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">></span></code><br/>
|
||||
Overrides <a href="../../../net.corda.core.contracts/-fungible-asset/exit-keys.html">FungibleAsset.exitKeys</a><br/>
|
||||
<p>There must be an ExitCommand signed by these keys to destroy the amount. While all states require their
|
||||
owner to sign, some (i.e. cash) also require the issuer.</p>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.PublicKeyTree)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.PublicKeyTree)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span></code><code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.PublicKeyTree)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.PublicKeyTree)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span></code><p>A state representing a commodity claim against some party</p>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.CompositeKey)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.CompositeKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.Amount((net.corda.core.contracts.Commodity)), net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span></code><code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.CompositeKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$<init>(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.CompositeKey)/owner">owner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span></code><p>A state representing a commodity claim against some party</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -43,7 +43,7 @@
|
||||
<td>
|
||||
<a href="exit-keys.html">exitKeys</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">val </span><span class="identifier">exitKeys</span><span class="symbol">: </span><span class="identifier">MutableSet</span><span class="symbol"><</span><a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">></span></code><p>There must be an ExitCommand signed by these keys to destroy the amount. While all states require their
|
||||
<code><span class="keyword">val </span><span class="identifier">exitKeys</span><span class="symbol">: </span><span class="identifier">MutableSet</span><span class="symbol"><</span><a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">></span></code><p>There must be an ExitCommand signed by these keys to destroy the amount. While all states require their
|
||||
owner to sign, some (i.e. cash) also require the issuer.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@ -51,7 +51,7 @@ owner to sign, some (i.e. cash) also require the issuer.</p>
|
||||
<td>
|
||||
<a href="owner.html">owner</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">val </span><span class="identifier">owner</span><span class="symbol">: </span><a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a></code><p>There must be a MoveCommand signed by this key to claim the amount</p>
|
||||
<code><span class="keyword">val </span><span class="identifier">owner</span><span class="symbol">: </span><a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a></code><p>There must be a MoveCommand signed by this key to claim the amount</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -70,7 +70,7 @@ owner to sign, some (i.e. cash) also require the issuer.</p>
|
||||
<td>
|
||||
<a href="move.html">move</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">move</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.PublicKeyTree)/newAmount">newAmount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.PublicKeyTree)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../../net.corda.core.contracts/-fungible-asset/index.html"><span class="identifier">FungibleAsset</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">move</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.CompositeKey)/newAmount">newAmount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.CompositeKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../../net.corda.core.contracts/-fungible-asset/index.html"><span class="identifier">FungibleAsset</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@ -82,7 +82,7 @@ owner to sign, some (i.e. cash) also require the issuer.</p>
|
||||
<td>
|
||||
<a href="with-new-owner.html">withNewOwner</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withNewOwner</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$withNewOwner(net.corda.core.crypto.PublicKeyTree)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><p>Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withNewOwner</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$withNewOwner(net.corda.core.crypto.CompositeKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><p>Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../../index.html">net.corda.contracts.asset</a> / <a href="../index.html">CommodityContract</a> / <a href="index.html">State</a> / <a href=".">move</a><br/>
|
||||
<br/>
|
||||
<h1>move</h1>
|
||||
<a name="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.PublicKeyTree)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">move</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.PublicKeyTree)/newAmount">newAmount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.PublicKeyTree)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-public-key-tree/index.html"><span class="identifier">PublicKeyTree</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../../net.corda.core.contracts/-fungible-asset/index.html"><span class="identifier">FungibleAsset</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span></code><br/>
|
||||
<a name="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.CompositeKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">move</span><span class="symbol">(</span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.CompositeKey)/newAmount">newAmount</span><span class="symbol">:</span> <a href="../../../net.corda.core.contracts/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-issued/index.html"><span class="identifier">Issued</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="net.corda.contracts.asset.CommodityContract.State$move(net.corda.core.contracts.Amount((net.corda.core.contracts.Issued((net.corda.core.contracts.Commodity)))), net.corda.core.crypto.CompositeKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="../../../net.corda.core.crypto/-composite-key/index.html"><span class="identifier">CompositeKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../../net.corda.core.contracts/-fungible-asset/index.html"><span class="identifier">FungibleAsset</span></a><span class="symbol"><</span><a href="../../../net.corda.core.contracts/-commodity/index.html"><span class="identifier">Commodity</span></a><span class="symbol">></span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user