Created
June 12, 2019 11:23
-
-
Save torkelrogstad/12c975961ea1ef11f566d3685233a7f8 to your computer and use it in GitHub Desktop.
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
import scala.concurrent._ | |
import akka.actor.ActorSystem | |
import org.bitcoins.{rpc, core} | |
import core.currency.Bitcoins | |
import rpc.client.common._ | |
implicit val system = ActorSystem.create() | |
implicit val ec: ExecutionContext = system.dispatcher | |
// this reads authentication credentials and | |
// connection details from the default data | |
// directory on your platform | |
val client = BitcoindRpcClient.fromDatadir() | |
val balance: Future[Bitcoins] = for { | |
_ <- client.start() | |
balance <- client.getBalance | |
} yield balance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment