Scala client library for different blockchain nodes. Currently, Bitcoin and Ethereum are supported Litecoin, Bitcoin cash and other Bitcoin-like nodes should be supported as well
This is RPC client library for connecting to bitcoind and geth/parity nodes. Please, consider this library as experimental. API in future can be changed.
This library is not replacement of Bitcoin/Ethereum nodes. It connects to nodes using http json rpc protocol.
Different http transport libraries are supported. Currently there are implementations using:
- Spring's WebClient (for non-blocking IO).
- scalaj-http for blocking IO
Library uses Typelevel's https://github.com/typelevel/cats to support different types of results (Try for blocking API and Mono for Spring's WebClient)
Library is modular and provides different layers:
- thin layer over JSON RPC
- different transaction senders for Ethereum (you can use the same API for sending transactions and sign them in the node or sign them right in Java code, from your client)
- common blockchain listeners for Bitcoin/Ethereum: you can listen to different events using the same api for both blockchains
- contract wrappers for Ethereum
- Add bintray daonomic repository
<repositories>
<repository>
<id>daonomic-bintray</id>
<name>daonomic-bintray</name>
<url>https://dl.bintray.com/daonomic/maven/</url>
</repository>
</repositories>
- Add scalether dependency
<dependency>
<groupId>io.daonomic.scalether</groupId>
<artifactId>contract_2.13</artifactId>
<version>${scalether.version}</version>
</dependency>
- Add bintray daonomic repository
resolvers += Resolver.bintrayRepo("daonomic", "maven")
- Add scalether dependency
libraryDependencies += "io.daonomic.scalether" %% "contract" % scaletherVersion
see https://github.com/daonomic/scala-rpc/tree/master/scalether for Ethereum examples
and https://github.com/daonomic/scala-rpc/tree/master/bitcoin for Bitcoin examples
For information about smart contract wrappers generator see https://github.com/daonomic/scalether-maven-plugin
You are welcome to suggest features and report bugs found!
scala-rpc is available under MIT License.