corda / net.corda.node.internal / CordaRPCOpsImpl

CordaRPCOpsImpl

class CordaRPCOpsImpl : 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.

Constructors

<init> CordaRPCOpsImpl(services: ServiceHub, smm: StateMachineManager, 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.

Properties

database val database: Database
protocolVersion val protocolVersion: Int

Returns the RPC protocol version. Exists since version 0 so guaranteed to be present.

services val services: ServiceHub
smm val smm: StateMachineManager

Functions

addVaultTransactionNote fun addVaultTransactionNote(txnId: SecureHash, txnNote: String): Unit
attachmentExists fun attachmentExists(id: SecureHash): Boolean

Checks whether an attachment with the given hash is stored on the node.

authoriseContractUpgrade fun authoriseContractUpgrade(state: StateAndRef<*>, upgradedContractClass: Class<out UpgradedContract<*, *>>): Unit

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.

currentNodeTime fun currentNodeTime(): Instant

Returns the node's current time.

deauthoriseContractUpgrade fun deauthoriseContractUpgrade(state: StateAndRef<*>): Unit

Authorise a contract state upgrade. This will remove the upgrade authorisation from the vault.

getCashBalances fun getCashBalances(): Map<Currency, Amount<Currency>>
getVaultTransactionNotes fun getVaultTransactionNotes(txnId: SecureHash): Iterable<String>
networkMapUpdates fun networkMapUpdates(): Pair<List<NodeInfo>, Observable<MapChange>>

Returns all parties currently visible on the network with their advertised services and an observable of future updates to the network.

nodeIdentity fun nodeIdentity(): NodeInfo

Returns Node's identity, assuming this will not change while the node is running.

openAttachment fun openAttachment(id: SecureHash): InputStream

Download an attachment JAR by ID

partyFromKey fun partyFromKey(key: CompositeKey): Party?

Returns the Party corresponding to the given key, if found.

partyFromName fun partyFromName(name: String): Party?

Returns the Party with the given name as it's Party.name

startFlowDynamic fun <T : Any> startFlowDynamic(logicType: Class<out FlowLogic<T>>, vararg args: Any?): FlowHandle<T>

Start the given flow with the given arguments, returning an Observable with a single observation of the result of running the flow.

stateMachineRecordedTransactionMapping fun stateMachineRecordedTransactionMapping(): Pair<List<StateMachineTransactionMapping>, Observable<StateMachineTransactionMapping>>

Returns a snapshot list of existing state machine id - recorded transaction hash mappings, and a stream of future such mappings as well.

stateMachinesAndUpdates fun stateMachinesAndUpdates(): Pair<List<StateMachineInfo>, Observable<StateMachineUpdate>>

Returns a pair of currently in-progress state machine infos and an observable of future state machine adds/removes.

uploadAttachment fun uploadAttachment(jar: InputStream): SecureHash

Uploads a jar to the node, returns it's hash.

uploadFile fun uploadFile(dataType: String, name: String?, file: InputStream): String
vaultAndUpdates fun vaultAndUpdates(): Pair<List<StateAndRef<ContractState>>, Observable<Update>>

Returns a pair of head states in the vault and an observable of future updates to the vault.

verifiedTransactions fun verifiedTransactions(): Pair<List<SignedTransaction>, Observable<SignedTransaction>>

Returns a pair of all recorded transactions and an observable of future recorded ones.

waitUntilRegisteredWithNetworkMap fun waitUntilRegisteredWithNetworkMap(): ListenableFuture<Unit>

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.

Extension Functions

startFlow fun <T : Any, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: () -> R): FlowHandle<T>

These allow type safe invocations of flows from Kotlin, e.g.:

fun <T : Any, A, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: (A) -> R, arg0: A): FlowHandle<T>
fun <T : Any, A, B, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: (A, B) -> R, arg0: A, arg1: B): FlowHandle<T>
fun <T : Any, A, B, C, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: (A, B, C) -> R, arg0: A, arg1: B, arg2: C): FlowHandle<T>
fun <T : Any, A, B, C, D, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: (A, B, C, D) -> R, arg0: A, arg1: B, arg2: C, arg3: D): FlowHandle<T>