Skip to main content

Install Postchain clients

JavaScript (JS)/TypeScript(TS)

The JavaScript/TypeScript client library, known as postchain-client, provides functionality for interacting with a blockchain using JavaScript or TypeScript. It allows you to send transactions and retrieve information from a blockchain node running Rell.

For a detailed introduction to the clients functionality, read the projects Readme.

The library is distributed on npm (Node Package Manager) and can be easily installed in your project. You have two options to install it:

  1. Visit the npm package page for postchain-client and follow the installation instructions provided there, see npm-postchain-client.

  2. In your project's terminal or command prompt, execute the following command: npm install postchain-client. This command will download and install the library in your project.

tip

You can find detailed example usage of the JavaScript client in the React/Rell course.

Kotlin

The Kotlin client library, postchain-client, provides capability for interacting with a blockchain from a client app written in Kotlin or Java. With this library, you can easily send transactions and retrieve queries from a Rell blockchain node.

To utilize the library, you'll need to add the postchain package registry URL since it's not available on Maven Central. The specific steps for adding the URL may differ based on your chosen build tool.

<project>
<dependencies>
<dependency>
<groupId>net.postchain.client</groupId>
<artifactId>postchain-client</artifactId>
</dependency>
</dependencies>

<repositories>
<repository>
<id>chromia-parent</id>
<name>Chromia parent GitLab Registry</name>
<url>https://gitlab.com/api/v4/projects/50818999/packages/maven</url>
</repository>
<repository>
<id>postchain</id>
<name>Postchain GitLab Registry</name>
<url>https://gitlab.com/api/v4/projects/32294340/packages/maven</url>
</repository>
<repository>
<id>postchain-client</id>
<name>Postchain Client GitLab Registry</name>
<url>https://gitlab.com/api/v4/projects/46288950/packages/maven</url>
</repository>
</repositories>
</project>

You can access the project repository here, where you'll find a detailed README explaining how to utilize the client. If you come across any problems, feel free to report them in the repository's issue tracker.

C#

The client library, known as postchain-client, provides functionality for interacting with a blockchain using C#. It allows you to send transactions and retrieve information from a blockchain node running Rell. It can be integrated into your C# projects through the NuGet package or by referencing the DLL files directly. Additionally, if you're working with Unity or Unity WebGL, specific instructions apply. Follow the steps below to properly use the library:

Installation and setup

Using NuGet

At the NuGet library's page, you'll discover clear instructions that explain different ways to install the library.

Referencing DLL files

  1. Download the Postchain client library release.
  2. Locate the DLL files corresponding to your project's target platform (e.g., NET Standard 2.1).
  3. In your project, add references to these DLL files.

Integration with Unity

If you're using Unity for your project, you can integrate the Postchain client library as follows:

  1. Download the Postchain client library release.
  2. Unpack the contents from the releases section.

Importing into Unity

  1. In your Unity project, navigate to the Assets menu.
  2. Create a folder named "Plugins" within the Assets folder if it doesn't exist.
  3. Move the unpacked DLL files into the "Plugins" folder.

Unity WebGL compatibility

When working with Unity WebGL, you might encounter compatibility issues with the default transport library (System.Net). Follow these steps to address this issue:

  1. Download the UnityTransport.cs file or implement your own custom transport as needed.
  2. In your Unity project, locate the scripts folder or create one if needed.
  3. Place the UnityTransport.cs file in the scripts folder.

Injecting custom transport

Before creating a ChromiaClient instance, inject the custom transport using the following code snippet:

// Add this code before creating a ChromiaClient instance
ChromiaClient.DefaultTransport = new UnityTransport(); // Replace UnityTransport() with your custom transport if applicable

Usage

For a detailed introduction to the clients functionality, read the projects Readme.