A Factom Java enterprise client to interact with Factom. Please see the docs module for documentation.
Currently the client implements all factomd and factom-walletd lowlevel API calls both synchronously and asynchronously. Higher level functions are being worked on.
The client consists of several modules to support the following use cases:
-
Java Standard Edition >= 1.8
-
Java Enterprise Edition (JEE)
-
Dependency Injection
-
Managed Threads
-
JSON processing using javax.json and jsonb
-
-
Spring (boot)
-
Dependency Injection
-
Managed Threads
-
Configuration
-
To minimize dependencies and allow the implementor to choose, Factom Java has plugable JSON (de)serialization support. This is handled as an SPI. That means you need to have one of the following json-providers below on the classpath together with the corresponding plugin project found in the sourcecode repository and releases!
-
GSON 2.8.X: json-converter-gson
-
JEE (javax.json) : json-converter-jee
-
Jackson (not implemented yet)
Whenever one of the JSON plugins is on the classpath it will use that plugin to do the (de)serialization. Please note that at least one plugin is needed for this library to function.
There is pluggable support for logging as well. We will enhance that support in the future. Currently it needs the SLF4J (logger-slf4j) SPI together with an SLF4J implementation on the classpath. Without it, the library will not function. That will be fixed in future releases.
Instead of using walletd to sign transactions and entry commits it is also possible to do complete offline signing using private keys directly. To enable this you will need to include the offline signing (factom-client-offline-signing) on the classpath. For FCT/EC transactions you can use the transaction class together with the commit method on the client.
The IoT SAS module allows you to sign directly using integrated IoT chips integrated in hardware. The private key of the Factom Entry credit address is stored within the hardware protected portion of the device. Factom-java can use the IoT SAS integration to sign offline using the SAS device. An example project can be found at Github.
Since this project has no external dependencies besides a JSON library and optional logging, it is fully compatible with Android 7 and up. An example project can be found at Github.
Javadocs can be found at https://bi-foundation.github.io/factom-java/javadoc/
This is a gradle project but maven snapshots and releases are distributed on the Nexus installation of Sphereon at https://nexus.qa.sphereon.com/repository/sphereon-opensource-releases/
You need at least the following dependencies in your application
<dependency> <groupId>org.blockchain-innovation.factom.client</groupId> <artifactId>factom-client-impl</artifactId> <version>0.4.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.blockchain-innovation.factom.client</groupId> <artifactId>logger-slf4j</artifactId> <version>0.4.1</version> <scope>compile</scope> </dependency> <!-- At least one of the following dependencies --> <dependency> <groupId>org.blockchain-innovation.factom.client</groupId> <artifactId>json-converter-jee</artifactId> <version>0.4.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.blockchain-innovation.factom.client</groupId> <artifactId>json-converter-gson</artifactId> <version>0.4.1</version> <scope>compile</scope> </dependency> <!-- Offline signing support --> <dependency> <groupId>org.blockchain-innovation.factom.client</groupId> <artifactId>factom-client-offline-signing</artifactId> <version>0.4.1</version> <scope>compile</scope> </dependency> <!-- Optional IoT Signed at Source support --> <dependency> <groupId>org.blockchain-innovation.factom.client</groupId> <artifactId>factom-client-offline-signing</artifactId> <version>0.4.1</version> <scope>compile</scope> </dependency> <!-- Optional JEE support (only in JEE environment) --> <dependency> <groupId>org.blockchain-innovation.factom.client</groupId> <artifactId>jee-support</artifactId> <version>0.4.1</version> <scope>compile</scope> </dependency> <!-- Optional Spring Boot support (only in Spring Boot environment) --> <dependency> <groupId>org.blockchain-innovation.factom.client</groupId> <artifactId>spring-boot-support</artifactId> <version>0.4.1</version> <scope>compile</scope> </dependency>
You will also need to specify Sphereon’s maven repository if you would like to include releases in your project
<repositories> <repository> <id>BIF-releases</id> <url>https://nexus.qa.sphereon.com/repository/bif/</url> </repository> </repositories>