-
Notifications
You must be signed in to change notification settings - Fork 10
Home
This Wiki provides information about interaction with Polkadot or Substrate based networks via the Substrate Client Java Library.
This documentation also provides description of the main components included into the library as well as some valuable usage examples.
The Substrate Client Java Library project comprises the following main components:
-
API - the entry point of the client library;
Api
allows interacting with a blockchain in various ways: using RPC's queries directly or accessing Pallet and its APIs; -
Transport contains abstractions which represent the transport layer of the API, particularly
ProviderInterface
that is required for the construction of theApi
; - RPC. The RPC calls provide the backbone for the transmission of data to and from the node. This means that all Pallet APIs such as storage, transaction and other just wrap RPC calls, providing information in the encoded format as expected by the node. This component also delivers tools for the construction and definition of these APIs;
- SCALE brings tools and abstractions which allow to define and/or generate SCALE codecs for entities;
- Pallet provides tools which allow to generate proxies to the blockchain's pallet to access it's data storage structures, events, etc.;
Api
provides high-level API to interact with a node in two different ways: using defined RPC's queries directly or accessing standard or user-defined Pallet and its API.
This component represents the transport layer of the library. It contains a low-level abstractions to handle the transport of method calls to and from Substrate based nodes.
This abstraction is ProviderInterface
that allows to connect to a node and do RPC calls.
This component contains known RPC sections and their methods that are available for Remote Calls to the node by default. Currently not all of them are implemented.
Also this component provides tools for defining such a section. These tools help to generate code for calling RPC methods or subscribing to them. This approach reduces the boilerplate code.
The SCALE (Simple Concatenated Aggregate Little-Endian) Codec is a lightweight, efficient, binary serialization and deserialization codec.
SCALE is used in many different ways:
- serialization of parameters in RPC methods and subscriptions;
- deserialization of results in RPC methods and subscriptions;
- serialization of parameters in transactions;
- serialization of keys in storage items;
- deserialization values of storage items.
This component provides tools which make possible proxies to be generated to the blockchain's pallet to access it's data storage structures, events, etc.