A Java library for building applications on Libra
The API for creating transactions and querying the database of Libra uses gRPC - a high performance remote procedure call system utilizing HTTP/2 for transport and Protocol Buffers for data serialization.
gRPC is designed to be usable from several platforms, but using the gRPC api directly from an application would not be optimal and would result in lots of boiler plate code - and that's where JLibra shows it's power for Java application developers.
JLibra simplifies integration to Libra but does not hide any features of the Libra api, this makes it possible to implement anything supported by Libra with Java.
- JDK 8+
- Maven 3+
- Clone this repo
- Build project with
mvn install(this is important because the project contains classes that will be created during the Maven build and simply checking the project out is not enough)
Try the examples
Start sample Main classes in
dev.jlibra.example package for examples (for a complete example with creating accounts to moving coins between them check the how to)
Use JLibra in your project
Versions of JLibra are deployed to the Central Maven repository, you can add JLibra as a dependency to your project:
<dependency> <groupId>dev.jlibra</groupId> <artifactId>jlibra-core</artifactId> <version>0.4.0</version> </dependency>
How-Tos & Step-by-Step Guides
How-Tos and Step-by-Step Guides are gathered in a separate document.
Transaction is not executed, but without errors (no events, no transaction in librabrowser.io)
- The execution of the example main classes might terminate before the actual action is performed.
- To prevent this, add
Thread.sleep(2000)after the last statement of the example.
- You might have specified too few gas.
- Try increasing