
com.github.jleskovar.btcrpc.examples.Main.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
fun main(args: Array) {
val rpcClient = BitcoinRpcClientFactory.createClient(
user = "james",
password = "james",
host = "james-machine",
port = 8334,
secure = true)
var start = System.currentTimeMillis()
for (i in 0..rpcClient.getBlockCount()) {
rpcClient.getBlockHash(i)
if (i % 100 == 0) println(i)
}
println("took ${System.currentTimeMillis() - start} ms")
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy