All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jleskovar.btcrpc.examples.WebSocketTests.kt Maven / Gradle / Ivy

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