
com.github.jleskovar.btcrpc.examples.WebSocketTests.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of btc-rpc-client Show documentation
Show all versions of btc-rpc-client Show documentation
Kotlin-based JSON-RPC client for bitcoind/btcd
The newest version!
package com.github.jleskovar.btcrpc.examples
import com.github.jleskovar.btcrpc.BitcoinRpcClientFactory
/**
* Created by james on 17/12/17.
*/
fun main(args: Array) {
val webSocketClient = BitcoinRpcClientFactory.createWsClient("james", "james", "localhost", 18334, true)
webSocketClient.connect()
println(webSocketClient.getBlockCount())
webSocketClient.disconnect()
val asyncWebSockets = BitcoinRpcClientFactory.createAsyncWsClient("james", "james", "localhost", 18334, true)
asyncWebSockets.connect()
val future = asyncWebSockets.getBlockCount()
println(future.get())
asyncWebSockets.disconnect()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy