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

acceptNewNetworkParameters

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.

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.

isFlowsDrainingModeEnabled

abstract fun isFlowsDrainingModeEnabled(): Boolean

Returns whether the flows draining mode is enabled.

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.

networkParametersFeed

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.

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. 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.

notaryIdentities

abstract fun notaryIdentities(): List<Party>

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

notaryPartyFromX500Name

abstract fun notaryPartyFromX500Name(x500Name: CordaX500Name): Party?

Get a notary identity by name.

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.

queryAttachments

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

Queries attachments metadata

registeredFlows

abstract fun registeredFlows(): List<String>

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

setFlowsDrainingModeEnabled

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.

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.

uploadAttachmentWithMetadata

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

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

vaultQuery

abstract 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

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

vaultQueryByWithPagingSpec

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

vaultQueryByWithSorting

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

vaultTrack

abstract 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

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

vaultTrackByWithPagingSpec

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

vaultTrackByWithSorting

abstract 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

contextLogger

fun Any.contextLogger(): Logger

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

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>>