net.corda.node.services.messaging / CordaRPCClient

# CordaRPCClient

`class CordaRPCClient : Closeable, ArtemisMessagingComponent`

An RPC client connects to the specified server and allows you to make calls to the server that perform various useful tasks. See the documentation for proxy or review the docsite to learn more about how this API works.

### Parameters

`host` - The hostname and messaging port of the node.
`config` - If specified, the SSL configuration to use. If not specified, SSL will be disabled and the node will not be authenticated, nor will RPC traffic be encrypted.

### Constructors

<init> | `CordaRPCClient(host: <ERROR CLASS>, config: NodeSSLConfiguration?)` An RPC client connects to the specified server and allows you to make calls to the server that perform various useful tasks. See the documentation for proxy or review the docsite to learn more about how this API works.

### Properties

config | `val config: NodeSSLConfiguration?` The config object is used to pass in the passwords for the certificate KeyStore and TrustStore
host | `val host: <ERROR CLASS>`

### Functions

close | `fun close(): Unit` Shuts down the client and lets the server know it can free the used resources (in a nice way).
proxy | `fun proxy(timeout: Duration? = null, minVersion: Int = 0): CordaRPCOps` Returns a fresh proxy that lets you invoke RPCs on the server. Calls on it block, and if the server throws an exception then it will be rethrown on the client. Proxies are thread safe but only one RPC can be in flight at once. If youd like to perform multiple RPCs in parallel, use this function multiple times to get multiple proxies.
start | `fun start(username: String, password: String): CordaRPCClient` Opens the connection to the server with the given username and password, then returns itself. Registers a JVM shutdown hook to cleanly disconnect.
use | `fun <T> use(username: String, password: String, block: CordaRPCOps.() -> T): T` A convenience function that opens a connection with the given credentials, executes the given code block with all available RPCs in scope and shuts down the RPC connection again. Its meant for quick prototyping and demos. For more control you probably want to control the lifecycle of the client and proxies independently, as well as configuring a timeout and other such features via the proxy method.

### Inherited Functions

checkStorePasswords | `fun checkStorePasswords(): Unit` Returns nothing if the keystore was opened OK or throws if not. Useful to check the password, as unfortunately Artemis tends to bury the exception when the password is wrong.
expectedOnDefaultFileSystem | `fun Path.expectedOnDefaultFileSystem(): Unit`
tcpTransport | `fun tcpTransport(direction: ConnectionDirection, host: String, port: Int): <ERROR CLASS>`

### Companion Object Properties

log | `val log: <ERROR CLASS>`