public class CordaRPCOpsImpl implements CordaRPCOps
Server side implementations of RPCs available to MQ based client tools. Execution takes place on the server thread (i.e. serially). Arguments are serialised and deserialised automatically.
Modifier and Type | Class and Description |
---|---|
static class |
CordaRPCOpsImpl.Companion |
Modifier and Type | Field and Description |
---|---|
static CordaRPCOpsImpl.Companion |
Companion |
Constructor and Description |
---|
CordaRPCOpsImpl(ServiceHub services,
StateMachineManager smm,
org.jetbrains.exposed.sql.Database database)
Server side implementations of RPCs available to MQ based client tools. Execution takes place on the server
thread (i.e. serially). Arguments are serialised and deserialised automatically.
|
Modifier and Type | Method and Description |
---|---|
void |
addVaultTransactionNote(SecureHash txnId,
java.lang.String txnNote) |
boolean |
attachmentExists(SecureHash id)
Checks whether an attachment with the given hash is stored on the node.
|
void |
authoriseContractUpgrade(StateAndRef<?> state,
java.lang.Class<? extends net.corda.core.contracts.UpgradedContract<?,?>> upgradedContractClass)
Authorise a contract state upgrade.
This will store the upgrade authorisation in the vault, and will be queried by ContractUpgradeFlow.Acceptor during contract upgrade process.
Invoking this method indicate the node is willing to upgrade the state using the upgradedContractClass.
This method will NOT initiate the upgrade process. To start the upgrade process, see ContractUpgradeFlow.Instigator.
|
java.time.Instant |
currentNodeTime()
Returns the node's current time.
|
void |
deauthoriseContractUpgrade(StateAndRef<?> state)
Authorise a contract state upgrade.
This will remove the upgrade authorisation from the vault.
|
java.util.Map<java.util.Currency,net.corda.core.contracts.Amount> |
getCashBalances() |
org.jetbrains.exposed.sql.Database |
getDatabase() |
int |
getProtocolVersion()
Returns the RPC protocol version. Exists since version 0 so guaranteed to be present.
|
ServiceHub |
getServices() |
StateMachineManager |
getSmm() |
java.lang.Iterable<java.lang.String> |
getVaultTransactionNotes(SecureHash txnId) |
kotlin.Pair<java.util.List,rx.Observable> |
networkMapUpdates()
Returns all parties currently visible on the network with their advertised services and an observable of future updates to the network.
|
NodeInfo |
nodeIdentity()
Returns Node's identity, assuming this will not change while the node is running.
|
java.io.InputStream |
openAttachment(SecureHash id)
Download an attachment JAR by ID
|
Party |
partyFromKey(CompositeKey key)
Returns the Party corresponding to the given key, if found.
|
Party |
partyFromName(java.lang.String name)
Returns the Party with the given name as it's Party.name
|
<T> FlowHandle<T> |
startFlowDynamic(java.lang.Class<? extends net.corda.core.flows.FlowLogic<? extends T>> logicType,
java.lang.Object args)
Start the given flow with the given arguments, returning an Observable with a single observation of the
result of running the flow.
|
kotlin.Pair<java.util.List,rx.Observable> |
stateMachineRecordedTransactionMapping()
Returns a snapshot list of existing state machine id - recorded transaction hash mappings, and a stream of future
such mappings as well.
|
kotlin.Pair<java.util.List,rx.Observable> |
stateMachinesAndUpdates()
Returns a pair of currently in-progress state machine infos and an observable of future state machine adds/removes.
|
SecureHash |
uploadAttachment(java.io.InputStream jar)
Uploads a jar to the node, returns it's hash.
|
java.lang.String |
uploadFile(java.lang.String dataType,
java.lang.String name,
java.io.InputStream file) |
kotlin.Pair<java.util.List,rx.Observable> |
vaultAndUpdates()
Returns a pair of head states in the vault and an observable of future updates to the vault.
|
kotlin.Pair<java.util.List,rx.Observable> |
verifiedTransactions()
Returns a pair of all recorded transactions and an observable of future recorded ones.
|
com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> |
waitUntilRegisteredWithNetworkMap()
Returns a ListenableFuture which completes when the node has registered wih the network map service. It can also
complete with an exception if it is unable to.
|
addVaultTransactionNote, attachmentExists, authoriseContractUpgrade, currentNodeTime, deauthoriseContractUpgrade, getCashBalances, getVaultTransactionNotes, networkMapUpdates, nodeIdentity, openAttachment, partyFromKey, partyFromName, startFlowDynamic, stateMachineRecordedTransactionMapping, stateMachinesAndUpdates, uploadAttachment, uploadFile, vaultAndUpdates, verifiedTransactions, waitUntilRegisteredWithNetworkMap
getProtocolVersion
public static CordaRPCOpsImpl.Companion Companion
public CordaRPCOpsImpl(ServiceHub services, StateMachineManager smm, org.jetbrains.exposed.sql.Database database)
Server side implementations of RPCs available to MQ based client tools. Execution takes place on the server thread (i.e. serially). Arguments are serialised and deserialised automatically.
public int getProtocolVersion()
Returns the RPC protocol version. Exists since version 0 so guaranteed to be present.
public kotlin.Pair<java.util.List,rx.Observable> networkMapUpdates()
Returns all parties currently visible on the network with their advertised services and an observable of future updates to the network.
public kotlin.Pair<java.util.List,rx.Observable> vaultAndUpdates()
Returns a pair of head states in the vault and an observable of future updates to the vault.
public kotlin.Pair<java.util.List,rx.Observable> verifiedTransactions()
Returns a pair of all recorded transactions and an observable of future recorded ones.
public kotlin.Pair<java.util.List,rx.Observable> stateMachinesAndUpdates()
Returns a pair of currently in-progress state machine infos and an observable of future state machine adds/removes.
public kotlin.Pair<java.util.List,rx.Observable> stateMachineRecordedTransactionMapping()
Returns a snapshot list of existing state machine id - recorded transaction hash mappings, and a stream of future such mappings as well.
public NodeInfo nodeIdentity()
Returns Node's identity, assuming this will not change while the node is running.
public void addVaultTransactionNote(SecureHash txnId, java.lang.String txnNote)
public java.lang.Iterable<java.lang.String> getVaultTransactionNotes(SecureHash txnId)
public java.util.Map<java.util.Currency,net.corda.core.contracts.Amount> getCashBalances()
public <T> FlowHandle<T> startFlowDynamic(java.lang.Class<? extends net.corda.core.flows.FlowLogic<? extends T>> logicType, java.lang.Object args)
Start the given flow with the given arguments, returning an Observable with a single observation of the result of running the flow.
public boolean attachmentExists(SecureHash id)
Checks whether an attachment with the given hash is stored on the node.
public java.io.InputStream openAttachment(SecureHash id)
Download an attachment JAR by ID
public SecureHash uploadAttachment(java.io.InputStream jar)
Uploads a jar to the node, returns it's hash.
public void authoriseContractUpgrade(StateAndRef<?> state, java.lang.Class<? extends net.corda.core.contracts.UpgradedContract<?,?>> upgradedContractClass)
Authorise a contract state upgrade. This will store the upgrade authorisation in the vault, and will be queried by ContractUpgradeFlow.Acceptor during contract upgrade process. Invoking this method indicate the node is willing to upgrade the state using the upgradedContractClass. This method will NOT initiate the upgrade process. To start the upgrade process, see ContractUpgradeFlow.Instigator.
public void deauthoriseContractUpgrade(StateAndRef<?> state)
Authorise a contract state upgrade. This will remove the upgrade authorisation from the vault.
public java.time.Instant currentNodeTime()
Returns the node's current time.
public java.lang.String uploadFile(java.lang.String dataType, java.lang.String name, java.io.InputStream file)
public com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> waitUntilRegisteredWithNetworkMap()
Returns a ListenableFuture which completes when the node has registered wih the network map service. It can also complete with an exception if it is unable to.
public Party partyFromKey(CompositeKey key)
Returns the Party corresponding to the given key, if found.
public Party partyFromName(java.lang.String name)
Returns the Party with the given name as it's Party.name
public ServiceHub getServices()
public StateMachineManager getSmm()
public org.jetbrains.exposed.sql.Database getDatabase()