JNano Client

JNano Client is the first Java RPC client which allows you to fully manage yours keys localy. Together with JNano Commons you will have all needed operations to create a light wallet without the need to dig in Nano implementation and focus more in delivery new awesome features.

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем JNA Инструменты разработки Native
Группа

Группа

com.rotilho.jnano
Идентификатор

Идентификатор

jnano-client
Последняя версия

Последняя версия

1.1.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

JNano Client
JNano Client is the first Java RPC client which allows you to fully manage yours keys localy. Together with JNano Commons you will have all needed operations to create a light wallet without the need to dig in Nano implementation and focus more in delivery new awesome features.
Ссылка на сайт

Ссылка на сайт

https://github.com/rotilho/jnano-client
Система контроля версий

Система контроля версий

https://github.com/rotilho/jnano-client

Скачать jnano-client

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.rotilho.jnano/jnano-client/ -->
<dependency>
    <groupId>com.rotilho.jnano</groupId>
    <artifactId>jnano-client</artifactId>
    <version>1.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.rotilho.jnano/jnano-client/
implementation 'com.rotilho.jnano:jnano-client:1.1.2'
// https://jarcasting.com/artifacts/com.rotilho.jnano/jnano-client/
implementation ("com.rotilho.jnano:jnano-client:1.1.2")
'com.rotilho.jnano:jnano-client:jar:1.1.2'
<dependency org="com.rotilho.jnano" name="jnano-client" rev="1.1.2">
  <artifact name="jnano-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.rotilho.jnano', module='jnano-client', version='1.1.2')
)
libraryDependencies += "com.rotilho.jnano" % "jnano-client" % "1.1.2"
[com.rotilho.jnano/jnano-client "1.1.2"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
com.rotilho.jnano : jnano-commons jar 1.5.0
com.squareup.okhttp3 : okhttp jar 3.11.0
com.fasterxml.jackson.core : jackson-databind jar 2.9.7
com.fasterxml.jackson.module : jackson-module-parameter-names jar 2.9.7

test (4)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.skyscreamer : jsonassert jar 1.5.0
org.mockito : mockito-core jar 2.18.3
com.github.tomakehurst : wiremock jar 2.17.0

Модули Проекта

Данный проект не имеет модулей.

Build Status Codacy Badge Codacy Badge Maven Central

JNano Client

JNano Client is the first Java RPC client which allows you to fully manage yours keys localy. Together with JNano Commons you will have all needed operations to create a light wallet without the need to dig in Nano implementation and focus more in delivery new awesome features.

JNano Client is complience with external key management.

How to use it?

First, take a look in JNano Commons. It will provide you basic knowledge about low level operations.

Gradle compile 'com.rotilho.jnano:jnano-client:1.1.2

Maven

<dependency>
    <groupId>com.rotilho.jnano</groupId>
    <artifactId>jnano-client</artifactId>
    <version>1.1.2</version>
</dependency>

Sample

NanoAPI nanoAPI = NanoAPI.builder().endpoint("http://my-wallet").build();
NanoAccountOperations accountOperations = NanoAccountOperations.of(NanoBaseAccountType.NANO, nanoAPI);

Optional<NanoAccountInfo> info = accountOperations.getInfo(account);
info.ifPresent(i-> log.info(i));

// Work may take several seconds, better have higher timeout
NanoAPI workNanoAPI = NanoAPI.builder().endpoint("http://my-wallet").readTimeoutMillis(100_000).build();
NanoWorkOperations workOperations = NanoRemoteWorkOperations.of(workNanoAPI);

NanoTransactionOperations transactionOperations = NanoTransactionOperations.of(NanoBaseAccountType.NANO, api, accountOperations, workOperations);

List<NanoTransaction<NanoStateBlock>> transactions = transactionOperations.receive(privateKey);
transactions.forEach(t -> log.info(t));

All classes are thread safe and can be used as singleton

How to cache work?

The possibility to pre-cache the work give to the user a nice user experience and one of the main fatures which make Nano be almost instant.

To pre-cache work you need to just wrap a NanoWorkOperations with NanoCachedWorkOperations

NanoCachedWorkOperations workOperations = NanoCachedWorkOperations.of(NanoRemoteWorkOperations.of(workNanoAPI));

// Now after finish to process a transaction you can simpltly call NanoCachedWorkOperations to pre-calculated the work
workOperations.cache(newTransaction.getHash())

Missing feature?

If you notice a missing feature let me know and I'll try to do my best to implement ASAP.

Just keep in mind that I don't plan to support any wallet RPC method, they are not going to exist for too long.

Версии библиотеки

Версия
1.1.2
1.1.1
1.1.0
1.0.0