core

pweb3j core module

License

License

Categories

Categories

Parity Business Logic Libraries Financial
GroupId

GroupId

io.github.pchain-org
ArtifactId

ArtifactId

parity
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

core
pweb3j core module
Project URL

Project URL

https://github.com/pchain-org/pweb3j
Source Code Management

Source Code Management

https://github.com/pchain-org/pweb3j

Download parity

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.pchain-org/parity/ -->
<dependency>
    <groupId>io.github.pchain-org</groupId>
    <artifactId>parity</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.pchain-org/parity/
implementation 'io.github.pchain-org:parity:1.0.1'
// https://jarcasting.com/artifacts/io.github.pchain-org/parity/
implementation ("io.github.pchain-org:parity:1.0.1")
'io.github.pchain-org:parity:jar:1.0.1'
<dependency org="io.github.pchain-org" name="parity" rev="1.0.1">
  <artifact name="parity" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.pchain-org', module='parity', version='1.0.1')
)
libraryDependencies += "io.github.pchain-org" % "parity" % "1.0.1"
[io.github.pchain-org/parity "1.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
io.github.pchain-org : core jar 1.0.1

Project Modules

There are no modules declared in this project.

pweb3j

Pchain java API

This repository is evloved from web3j https://github.com/web3j/web3j, with changing package name from 'org.web3j' to 'org.pweb3j', and rewrite related classes/functions to adapt to pchain.

All pchain specific RPC APIs are listed in https://github.com/pchain-org/pchain/wiki/JSON-RPC

maven

java 8

<dependency>
  <groupId>io.github.pchain-org</groupId>
  <artifactId>core</artifactId>
  <version>1.0.2</version>
</dependency>

sending requests

For pchain is multi-chain structure, so the request should be sent to specific chain. And it just needs to add chain name after the http://host:port/. The following examples are using main chain - "pchain".

To send synchronous requests:

Web3j web3 = Web3j.build(new HttpService());  // defaults to http://localhost:6969/pchain
Web3ClientVersion web3ClientVersion = web3.web3ClientVersion().send();
String clientVersion = web3ClientVersion.getWeb3ClientVersion();

To send asynchronous requests using a CompletableFuture (Future on Android):

Web3j web3 = Web3j.build(new HttpService());  // defaults to http://localhost:6969/pchain
Web3ClientVersion web3ClientVersion = web3.web3ClientVersion().sendAsync().get();
String clientVersion = web3ClientVersion.getWeb3ClientVersion();

To use an RxJava Flowable:

Web3j web3 = Web3j.build(new HttpService());  // defaults to http://localhost:6969/pchain
web3.web3ClientVersion().flowable().subscribe(x -> {
    String clientVersion = x.getWeb3ClientVersion();
    ...
});

more

All tests/examples can be found in https://github.com/pchain-org/pweb3j/tree/master/integration-tests

More guides and instructions could refer to https://github.com/web3j/web3j

Versions

Version
1.0.1