Skip to content

Instantly share code, notes, and snippets.

@lankydan
Created August 12, 2019 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lankydan/d7a50352ab17a7fffb797ed91e994b4c to your computer and use it in GitHub Desktop.
Save lankydan/d7a50352ab17a7fffb797ed91e994b4c to your computer and use it in GitHub Desktop.
Corda + Ktor - connecting to the node
fun connectToNode(
host: String = System.getProperty("config.rpc.host"),
rpcPort: Int = System.getProperty("config.rpc.port").toInt(),
username: String = System.getProperty("config.rpc.username"),
password: String = System.getProperty("config.rpc.password")
): CordaRPCConnection {
val rpcAddress = NetworkHostAndPort(host, rpcPort)
val rpcClient = CordaRPCClient(rpcAddress)
return rpcClient.start(username, password)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment