corda / net.corda.core.messaging / CordaRPCOps


interface CordaRPCOps : RPCOps

RPC operations that the node exposes to clients.



abstract val networkParameters: NetworkParameters

Returns the network parameters the node is operating under.

Inherited Properties


abstract val protocolVersion: Int

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



abstract fun acceptNewNetworkParameters(parametersHash: SecureHash): Unit

Accept network parameters with given hash, hash is obtained through networkParametersFeed method. Information is sent back to the zone operator that the node accepted the parameters update - this process cannot be undone. Only parameters that are scheduled for update can be accepted, if different hash is provided this method will fail. Note: This operation may be restricted only to node administrators.


abstract fun addVaultTransactionNote(txnId: SecureHash, txnNote: String): Unit

Add note(s) to an existing Vault transaction.


abstract fun attachmentExists(id: SecureHash): Boolean

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


abstract fun clearNetworkMapCache(): Unit

Clear all network map data from local node cache. Notice that after invoking this method your node will lose network map data and effectively won't be able to start any flow with the peers until network map is downloaded again on next poll - from additional-node-infos directory or from network map server. It depends on the polling interval when it happens. You can also use refreshNetworkMapCache to force next fetch from network map server (not from directory - it will happen automatically). If you run local test deployment and want clear view of the network, you may want to clear also additional-node-infos directory, because cache can be repopulated from there.


abstract fun currentNodeTime(): Instant

Returns the node's current time.


abstract fun getVaultTransactionNotes(txnId: SecureHash): Iterable<String>

Retrieve existing note(s) for a given Vault transaction.


abstract fun isFlowsDrainingModeEnabled(): Boolean

Returns whether the flows draining mode is enabled.


abstract fun isWaitingForShutdown(): Boolean

Returns whether the node is waiting for pending flows to complete before shutting down. Disabling draining mode cancels this state.


abstract fun killFlow(id: StateMachineRunId): Boolean

Attempts to kill a flow. This is not a clean termination and should be reserved for exceptional cases such as stuck fibers.


abstract fun networkMapFeed(): DataFeed<List<NodeInfo>, MapChange>

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


abstract fun networkMapSnapshot(): List<NodeInfo>

Returns all parties currently visible on the network with their advertised services.


abstract fun networkParametersFeed(): DataFeed<ParametersUpdateInfo?, ParametersUpdateInfo>

Returns DataFeed object containing information on currently scheduled parameters update (null if none are currently scheduled) and observable with future update events. Any update that occurs before the deadline automatically cancels the current one. Only the latest update can be accepted. Note: This operation may be restricted only to node administrators.


abstract fun nodeDiagnosticInfo(): NodeDiagnosticInfo

Returns Node's NodeDiagnosticInfo, including the version details as well as the information about installed CorDapps.


abstract fun nodeInfo(): NodeInfo

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


abstract fun nodeInfoFromParty(party: AbstractParty): NodeInfo?

Returns a node's info from the network map cache, where known. Notice that when there are more than one node for a given name (in case of distributed services) first service node found will be returned.


abstract fun notaryIdentities(): List<Party>

Returns network's notary identities, assuming this will not change while the node is running.


abstract fun notaryPartyFromX500Name(x500Name: CordaX500Name): Party?

Get a notary identity by name.


abstract fun openAttachment(id: SecureHash): InputStream

Download an attachment JAR by ID.


abstract fun partiesFromName(query: String, exactMatch: Boolean): Set<Party>

Returns a list of candidate matches for a given string, with optional fuzzy(ish) matching. Fuzzy matching may get smarter with time e.g. to correct spelling errors, so you should not hard-code indexes into the results but rather show them via a user interface and let the user pick the one they wanted.


abstract fun partyFromKey(key: PublicKey): Party?

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


abstract fun queryAttachments(query: AttachmentQueryCriteria, sorting: AttachmentSort?): List<AttachmentId>

Queries attachments metadata


abstract fun refreshNetworkMapCache(): Unit

Poll network map server if available for the network map. Notice that you need to have compatibilityZone or networkServices configured. This is normally done automatically on the regular time interval, but you may wish to have the fresh view of network earlier.


abstract fun registeredFlows(): List<String>

Enumerates the class names of the flows that this node knows about.


abstract fun setFlowsDrainingModeEnabled(enabled: Boolean): Unit

Sets the value of the node's flows draining mode. If this mode is enabled, the node will reject new flows through RPC, ignore scheduled flows, and do not process initial session messages, meaning that P2P counterparties will not be able to initiate new flows involving the node.


abstract fun shutdown(): Unit

Shuts the node down. Returns immediately. This does not wait for flows to be completed.


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

Start the given flow with the given arguments. logicType must be annotated with net.corda.core.flows.StartableByRPC.


abstract fun <T> startTrackedFlowDynamic(logicType: Class<out FlowLogic<T>>, vararg args: Any?): FlowProgressHandle<T>

Start the given flow with the given arguments, returning an Observable with a single observation of the result of running the flow. logicType must be annotated with net.corda.core.flows.StartableByRPC.


abstract fun stateMachineRecordedTransactionMappingFeed(): DataFeed<List<StateMachineTransactionMapping>, StateMachineTransactionMapping>

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


abstract fun stateMachineRecordedTransactionMappingSnapshot(): List<StateMachineTransactionMapping>

Returns a snapshot list of existing state machine id - recorded transaction hash mappings.


abstract fun stateMachinesFeed(): DataFeed<List<StateMachineInfo>, StateMachineUpdate>

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


abstract fun stateMachinesSnapshot(): List<StateMachineInfo>

Returns a list of currently in-progress state machine infos.


abstract fun terminate(drainPendingFlows: Boolean = false): Unit

Shuts the node down. Returns immediately.


abstract fun uploadAttachment(jar: InputStream): SecureHash

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


abstract fun uploadAttachmentWithMetadata(jar: InputStream, uploader: String, filename: String): SecureHash

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


abstract fun <T : ContractState> vaultQuery(contractStateType: Class<out T>): Page<T>


abstract fun <T : ContractState> vaultQueryBy(criteria: QueryCriteria, paging: PageSpecification, sorting: Sort, contractStateType: Class<out T>): Page<T>

Returns a snapshot of vault states for a given query criteria (and optional order and paging specification)


abstract fun <T : ContractState> vaultQueryByCriteria(criteria: QueryCriteria, contractStateType: Class<out T>): Page<T>


abstract fun <T : ContractState> vaultQueryByWithPagingSpec(contractStateType: Class<out T>, criteria: QueryCriteria, paging: PageSpecification): Page<T>


abstract fun <T : ContractState> vaultQueryByWithSorting(contractStateType: Class<out T>, criteria: QueryCriteria, sorting: Sort): Page<T>


abstract fun <T : ContractState> vaultTrack(contractStateType: Class<out T>): DataFeed<Page<T>, Update<T>>


abstract fun <T : ContractState> vaultTrackBy(criteria: QueryCriteria, paging: PageSpecification, sorting: Sort, contractStateType: Class<out T>): DataFeed<Page<T>, Update<T>>

Returns a snapshot (as per queryBy) and an observable of future updates to the vault for the given query criteria.


abstract fun <T : ContractState> vaultTrackByCriteria(contractStateType: Class<out T>, criteria: QueryCriteria): DataFeed<Page<T>, Update<T>>


abstract fun <T : ContractState> vaultTrackByWithPagingSpec(contractStateType: Class<out T>, criteria: QueryCriteria, paging: PageSpecification): DataFeed<Page<T>, Update<T>>


abstract fun <T : ContractState> vaultTrackByWithSorting(contractStateType: Class<out T>, criteria: QueryCriteria, sorting: Sort): DataFeed<Page<T>, Update<T>>


abstract fun waitUntilNetworkReady(): CordaFuture<Void?>

Returns a CordaFuture which completes when the node has registered wih the network map service. It can also complete with an exception if it is unable to.


abstract fun wellKnownPartyFromAnonymous(party: AbstractParty): Party?

Returns the well known identity from an abstract party. This is intended to resolve the well known identity from a confidential identity, however it transparently handles returning the well known identity back if a well known identity is passed in.


abstract fun wellKnownPartyFromX500Name(x500Name: CordaX500Name): Party?

Returns the Party with the X.500 principal as it's

Extension Functions


fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.


fun CordaRPCOps.getCashBalance(currency: Currency): Amount<Currency>


fun CordaRPCOps.getCashBalances(): Map<Currency, Amount<Currency>>


fun CordaRPCOps.pendingFlowsCount(): DataFeed<Int, Pair<Int, Int>>

Returns a DataFeed of the number of pending flows. The Observable for the updates will complete the moment all pending flows will have terminated.


fun <T, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: () -> R): FlowHandle<T>
fun <T, A, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: (A) -> R, arg0: A): FlowHandle<T>
fun <T, A, B, C, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: (A, B, C) -> R, arg0: A, arg1: B, arg2: C): FlowHandle<T>
fun <T, 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>
fun <T, A, B, C, D, E, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: (A, B, C, D, E) -> R, arg0: A, arg1: B, arg2: C, arg3: D, arg4: E): FlowHandle<T>
fun <T, A, B, C, D, E, F, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: (A, B, C, D, E, F) -> R, arg0: A, arg1: B, arg2: C, arg3: D, arg4: E, arg5: F): FlowHandle<T>fun <T, A, B, R : FlowLogic<T>> CordaRPCOps.startFlow(flowConstructor: (A, B) -> R, arg0: A, arg1: B): FlowHandle<T>

Extension function for type safe invocation of flows from Kotlin, for example:


fun <T, R : FlowLogic<T>> CordaRPCOps.startTrackedFlow(flowConstructor: () -> R): FlowProgressHandle<T>

Extension function for type safe invocation of flows from Kotlin, with progress tracking enabled.

fun <T, A, R : FlowLogic<T>> CordaRPCOps.startTrackedFlow(flowConstructor: (A) -> R, arg0: A): FlowProgressHandle<T>
fun <T, A, B, R : FlowLogic<T>> CordaRPCOps.startTrackedFlow(flowConstructor: (A, B) -> R, arg0: A, arg1: B): FlowProgressHandle<T>
fun <T, A, B, C, R : FlowLogic<T>> CordaRPCOps.startTrackedFlow(flowConstructor: (A, B, C) -> R, arg0: A, arg1: B, arg2: C): FlowProgressHandle<T>
fun <T, A, B, C, D, R : FlowLogic<T>> CordaRPCOps.startTrackedFlow(flowConstructor: (A, B, C, D) -> R, arg0: A, arg1: B, arg2: C, arg3: D): FlowProgressHandle<T>
fun <T, A, B, C, D, E, R : FlowLogic<T>> CordaRPCOps.startTrackedFlow(flowConstructor: (A, B, C, D, E) -> R, arg0: A, arg1: B, arg2: C, arg3: D, arg4: E): FlowProgressHandle<T>
fun <T, A, B, C, D, E, F, R : FlowLogic<T>> CordaRPCOps.startTrackedFlow(flowConstructor: (A, B, C, D, E, F) -> R, arg0: A, arg1: B, arg2: C, arg3: D, arg4: E, arg5: F): FlowProgressHandle<T>


fun <T : ContractState> CordaRPCOps.vaultQueryBy(criteria: QueryCriteria = QueryCriteria.VaultQueryCriteria(), paging: PageSpecification = PageSpecification(), sorting: Sort = Sort(emptySet())): Page<T>


fun <T : ContractState> CordaRPCOps.vaultTrackBy(criteria: QueryCriteria = QueryCriteria.VaultQueryCriteria(), paging: PageSpecification = PageSpecification(), sorting: Sort = Sort(emptySet())): DataFeed<Page<T>, Update<T>>