corda / net.corda.core.messaging / CordaRPCOps

CordaRPCOps

interface CordaRPCOps : RPCOps

RPC operations that the node exposes to clients.

Properties

protocolVersion

open val protocolVersion: Int

Returns the RPC protocol version, which is the same the node's Platform Version. Exists since version 1 so guaranteed to be present.

Functions

addVaultTransactionNote

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

Add note(s) to an existing Vault transaction.

attachmentExists

abstract fun attachmentExists(id: SecureHash): Boolean

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

clearNetworkMapCache

abstract fun clearNetworkMapCache(): Unit

Clear all network map data from local node cache.

currentNodeTime

abstract fun currentNodeTime(): Instant

Returns the node's current time.

getVaultTransactionNotes

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

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

networkMapFeed

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.

networkMapSnapshot

abstract fun networkMapSnapshot(): List<NodeInfo>

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

nodeInfo

abstract fun nodeInfo(): NodeInfo

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

nodeInfoFromParty

abstract fun nodeInfoFromParty(party: AbstractParty): NodeInfo?

Returns a node's info from the network map cache, where known.

notaryIdentities

abstract fun notaryIdentities(): List<Party>

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

openAttachment

abstract fun openAttachment(id: SecureHash): InputStream

Download an attachment JAR by ID.

partiesFromName

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.

partyFromKey

abstract fun partyFromKey(key: PublicKey): Party?

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

registeredFlows

abstract fun registeredFlows(): List<String>

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

startFlowDynamic

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.

startTrackedFlowDynamic

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.

stateMachineRecordedTransactionMappingFeed

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.

stateMachineRecordedTransactionMappingSnapshot

abstract fun stateMachineRecordedTransactionMappingSnapshot(): List<StateMachineTransactionMapping>

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

stateMachinesFeed

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.

stateMachinesSnapshot

abstract fun stateMachinesSnapshot(): List<StateMachineInfo>

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

uploadAttachment

abstract fun uploadAttachment(jar: InputStream): SecureHash

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

vaultQuery

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

vaultQueryBy

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)

vaultQueryByCriteria

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

vaultQueryByWithPagingSpec

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

vaultQueryByWithSorting

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

vaultTrack

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

vaultTrackBy

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.

vaultTrackByCriteria

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

vaultTrackByWithPagingSpec

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

vaultTrackByWithSorting

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

waitUntilNetworkReady

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.

wellKnownPartyFromAnonymous

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.

wellKnownPartyFromX500Name

abstract fun wellKnownPartyFromX500Name(x500Name: CordaX500Name): Party?

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

Extension Functions

getCashBalance

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

getCashBalances

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

startFlow

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:

startTrackedFlow

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>

vaultQueryBy

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

vaultTrackBy

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