hickel.dev
open main menu

JXCH-RPC-Library

JXCH logo

This library aims to provide a modular and robust RPC library for interacting with the Chia blockchain and directly interfacing with node/wallets via Java. Offers a drop in library for directly interfacing with all RPC endpoints, as well as various utilities for conversion and builder for large requests. Designed with null safety around optional values and immutable data structures to ensure integrity


Currently supporting the backend of outerfields.space and dpool.cc


The Goals of the library are as follows:


  • Provide a modern simple to use library for interfacing with the Chia blockchain via RPC requests to nodes and wallets.


  • Provide a modular/granular library implementation that allows for various levels of use.


  • Provide a means to load self-signed certificates via their .crt & .key files into a keystore.


  • Provide a RPCClient wrapper around Apache Closeable HTTP Client for making direct requests to predefined endpoints using defined configs.


  • Provide API classes that provide a higher level implementation of methods for making RPC request.


  • Provide the option to manually handle response json.


  • Provide immutable java records that correspond to the schemas of the response json.


  • Ensure immutability of all response data.


  • Provide the ability to easily communicate to various nodes, with the ability to pool the responses and differentiate between requests.


Using the above outlined features the library can be used simply to load self-signed certificate/key pairs (which can be a challenge with java), be used simply as a RPCClient to make a process requests/response json manually, or be used as a full abstraction for making RPC calls with requests returned as predefined immutable java records that map 1:1 with response data. Due to the nature of blockchains being immutable, and immutability being generally preferable whenever possible, all data relating to responses is contained in immutable records, and all collections that returned are also wrapped immutably. As such this library can provide a solid backbone for interfacing via RPC in a simple and safe manner, allowing for thread safe high performance processing of RPC requests across multiple nodes/wallets.

More information regarding use and architecture can be found at the github link above.