Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.21 KB

README.md

File metadata and controls

44 lines (30 loc) · 1.21 KB

QuarkChain Web3j

The Java JSON-RPC client for QuarkChain.

Getting Started

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.

APIs

See JSON-RPC documentation for API references.