Boxd-unpack-java is a java library for working with integrating with clients(Boxd Rpc Node) on the Boxd network.
- Complete implementation of Boxd's RPC client API
- Boxd account related implementations
- Signature related implementations
The project is based on Java8. If your Java version is less than Java8, please upgrade your Java version first.
Add the relevant dependency to your project:
<dependency>
<groupId>one.contentbox.boxd</groupId>
<artifactId>boxd-client</artifactId>
<version>0.0.1</version>
</dependency>
implementation 'one.contentbox.boxd:boxd-client:0.0.1'
libraryDependencies += "one.contentbox.boxd" % "boxd-client" % "0.0.1"
<dependency org="one.contentbox.boxd" name="boxd-client" rev="0.0.1" />
@Grapes(
@Grab(group='one.contentbox.boxd', module='boxd-client', version='0.0.1')
)
'one.contentbox.boxd:boxd-client:jar:0.0.1'
maven_jar(
name = "boxd-client",
artifact = "one.contentbox.boxd:boxd-client:0.0.1",
sha1 = "7980490ab9c8de4ddad79fa49302f60a82ade908",
)
To send requests:
String host = "39.97.169.1";
int port = 19111;
BoxdClient boxdClient = new RpcBoxdClientImpl(host, port);
int height = boxdClient.getBlockHeight();
To listen the block event:
String host = "39.97.169.1";
int port = 19111;
BoxdDaemon boxdDaemon = new BoxdDaemon(host, port);
boxdDaemon.setBlockListener(new BlockListener() {
@Override
public void blockDetected(BlockDetail blockDetail) {
try {
one.contentbox.boxd.protocol.core.response.block.BlockDetail bd = ProtobufSerdeUtils
.protobufToJavaBean(blockDetail, one.contentbox.boxd.protocol.core.response.block.BlockDetail.class);
System.out.println(JSON.toJSONString(bd, true));
}catch (BoxdException e){
e.printStackTrace();
}
}
});
boxdDaemon.start();
Snapshot versions of boxd-unpack-java follow the <major>.<minor>.<build>-SNAPSHOT convention.
If you would like to use snapshots instead please add a new maven repository pointing to:
https://oss.sonatype.org/content/repositories/snapshots
Please refer to the maven or gradle documentation for further detail.
Sample gradle configuration:
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
Sample maven configuration:
<repositories>
<repository>
<id>sonatype-snasphots</id>
<name>Sonatype snapshots repo</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
To build:
git clone https://github.com/BOXFoundation/boxd-unpack-java.git
cd boxd-unpack-java/
./gradlew build
For bugs, questions and discussions please use the Github Issues.