Published 23 October 2018

Creating user tools (applications) on the basis of the CREDITS API and Java




Java IDE (optional, JetBrains IntelliJ is considered)

Text editor (for example, Visual Studio Code)

Maven (installation is described in the "Installing Maven on Windows 10" article)

GIT (installation)

Installing GitHub for Windows. Its installer includes command-line utilities and a Git GUI. It also works correctly with Powershell, provides clear credential retention, and correct CRLF settings. You can download GitHub for Windows from

Verifying the installation:

git --version

result (git version

Assembly. Sequence of steps

Assembly. Sequence of steps

After preliminary requirements are met, the next step is to take the project from GitHub, which is CREDITS Wallet Desktop. It is downloaded using the following command:

git clone

folder contents after download

Assume that the project is located at this path: D:\dev\credits\CS-Wallet-desktop\

Next, run CMD and go to the CS-Wallet-desktop folder as shown below

in this folder go to the leveldb-client by the command

cd leveldb-client

in the folder type:

mvn compile


mvn package

the result is a leveldb-client.jar file in D:\dev\credits\CS-Wallet-desktop\leveldb-client\target folder

Creating an application in JetBrains IntelliJ

Step 1. A simple Maven project is created

Step 2. File install-to-rep.bat is launched from the D:\dev\credits\CS-Wallet-desktop\leveldb-client\ folder to register the leveldb-client.jar library

Step 3. Dependencies are added in pom.xml of our file:








Step 4. Example of a simple application source file:

import com.credits.common.exception.CreditsCommonException;

import com.credits.common.utils.Converter;

import com.credits.leveldb.client.ApiClient;

import com.credits.leveldb.client.exception.CreditsNodeException;

import com.credits.leveldb.client.exception.LevelDbClientException;

import java.math.BigDecimal;


public class app {

   public static void main(String[] args) throws CreditsCommonException, LevelDbClientException, CreditsNodeException {

       String account = "6zxLh3nbbtxt36ED211Y3askbbSY4E1iV98TKcFzjoUk";

       ApiClient client = ApiClient.getInstance("", 9090);

       BigDecimal balance = client.getBalance(Converter.decodeFromBASE58(account), (byte)1);




Check. Running the application

Check. Running the application

Assembling the application:

in the folder of our application execute the following commands from CMD

mvn compile

mvn package

Running the application through Maven looks like this:

mvn -e exec:java -Dexec.mainClass="com.credits.wallet.desktop.App"


0 Useful article