Created
August 12, 2019 09:07
-
-
Save lankydan/d7a50352ab17a7fffb797ed91e994b4c to your computer and use it in GitHub Desktop.
Corda + Ktor - connecting to the node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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