The Java JSON-RPC client for QuarkChain.
Add the following dependency to your pom.xml:
<dependency>
<groupId>org.quarkchain</groupId>
<artifactId>web3j</artifactId>
<version>0.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/quarkchain-web3j.jar</systemPath>
</dependency>
Start up a QuarkChain cluster such as GoQuarkChain. Or connect to devnet with url: http://jrpc.devnet.quarkchain.io:38391.
To send asynchronous requests:
Web3j web3 = Web3j.build(new HttpService()); // defaults to http://localhost:38391/
NetworkInfo network = web3.networkInfo().sendAsync().get();
Info networkInfo = network.getResult();
To send synchronous requests:
Web3j web3 = Web3j.build(new HttpService()); // defaults to http://localhost:38391/
NetworkInfo network = web3.networkInfo().send();
Info networkInfo = network.getResult();
See here for more examples.
See JSON-RPC documentation for API references.