Duniter4j: a new command line tool, written in Java

Duniter4j > a java Command line tool

Introducing Duniter4j-client v0.10.1 : a cross-plateform command line tool for Duniter.

Installation

  • Download the file duniter4j-client-<version>-full-<platform>.zip from the lastest releases page

  • Unzip the archive;

  • The open a terminal and execute the script duniter4j.sh

    cd duniter4j-client-<version>
    ./duniter4j.sh --help
    

on Windows : use the duniter4j.bat script file.

Usage

Sending transaction

To send money to a pubkey, execute this command :

./duniter4j.sh transaction --auth-scrypt --amount 10 --output 2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ 
Veuillez entrer votre identifiant secret Scrypt (Salt): *****
Veuillez entrer votre mot de passe Scrypt (password) : *****
Veuillez entrer les paramètres de Scrypt (N,r,p): [4096,16,1]
INFO - Noeud Duniter (par défaut) : [g1.duniter.org:10901]
Envoi de la transation:
        - De:   G2CBgZBP
        - A:     2ny7YAdm
        - Montant: 10 G1
Transaction envoyé avec succès.

to broadcast the transfer order to each BlockChain fork, just add the option --broadcast.

Network peers

To show network peers, simply execute :

./duniter4j.sh network

Add --continue to auto-refresh the peers list.

Need help ?

To get the help, execute this simple command :

  ./duniter4j.sh --help  
7 Likes

Cool cool tout ça :slight_smile:

Petite question : pourquoi avoir développé un client console supplémentaire, qu’est-ce qui le différencie de silkaj ?

1 Like

En fait les 95% du code était déjà fait, dans l’API Java Duniter4j (utilisée par l’ancienne app Android et les noeuds ElasticSearch).

Au moment où j’ai codé l’aspiration des noeuds du réseau dans l’API Java, je me suis rendu compte que j’avais besoin de visualiser rapidement le résultat.
J’ai donc ajouté une lib qui permet la visualisation en mode tableau… et voilou ! :wink:

L’avantage du Java, c’est aussi sa portabilité : la on a déjà une version pour Windows, sans 1000 trucs à installer. Juste un zip.

Merci @kimamila, je n’arrive pas à le faire fonctionner chez moi :confused:
J’ai télécharger et installer la release duniter4j-client-0.10.2-full-linux-i586.zip et voici l’erreur que j’ai :

si quelqu’un a une piste ?

 $ ./duniter4j.sh network
Exception in thread "main" java.util.ServiceConfigurationError: org.duniter.core.beans.Bean: Provider org.duniter.core.service.Ed25519CryptoServiceImpl could not be instantiated
	at java.util.ServiceLoader.fail(ServiceLoader.java:232)
	at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
	at org.duniter.core.beans.BeanFactory.newBean(BeanFactory.java:97)
	at org.duniter.core.beans.BeanFactory.getBean(BeanFactory.java:60)
	at org.duniter.core.client.service.ServiceLocator.getBean(ServiceLocator.java:159)
	at org.duniter.core.client.service.ServiceLocator.getDataContext(ServiceLocator.java:133)
	at org.duniter.client.Main.run(Main.java:125)
	at org.duniter.client.Main.main(Main.java:68)
Caused by: java.lang.UnsatisfiedLinkError: /usr/local/lib/libsodium.so.18: mauvaise classe ELF : ELFCLASS64
	at jnr.ffi.provider.jffi.NativeLibrary.loadNativeLibraries(NativeLibrary.java:87)
	at jnr.ffi.provider.jffi.NativeLibrary.getNativeLibraries(NativeLibrary.java:70)
	at jnr.ffi.provider.jffi.NativeLibrary.getSymbolAddress(NativeLibrary.java:49)
	at jnr.ffi.provider.jffi.NativeLibrary.findSymbolAddress(NativeLibrary.java:59)
	at jnr.ffi.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:117)
	at jnr.ffi.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:59)
	at jnr.ffi.provider.jffi.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:43)
	at jnr.ffi.LibraryLoader.load(LibraryLoader.java:290)
	at jnr.ffi.LibraryLoader.load(LibraryLoader.java:269)
	at org.abstractj.kalium.NaCl$SingletonHolder.<clinit>(NaCl.java:51)
	at org.abstractj.kalium.NaCl.sodium(NaCl.java:29)
	at org.duniter.core.service.Ed25519CryptoServiceImpl.<init>(Ed25519CryptoServiceImpl.java:73)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
	... 8 more
INFO - Application stopped with exitcode: 1

Il faut sur tu installes libsodium sur ton système, je pense.

Oui, il doit te manquer libsodium.
Je vais ajouter une autodétection plus propre.

Merci pour la remontée

1 Like

le truc c’est que j’ai déjà libsodium …

On dirait un problème de compatibilité 32/64 bits.

1 Like

MĂŞme erreur chez moi, sur une Xubuntu :frowning:

Chez moi aussi, sur Ubuntu-Gnome 64bits.

Sorry, previous version had a bad java/JRE version.

The last release (v0.11.0) should fix that : https://github.com/duniter/duniter4j/releases/tag/duniter4j-0.11.0
(try duniter4j-client-xx files)

Pourquoi duniter4j n’est pas dans le gitlab ? je pensais que la communauté était réfractaire au java-istes moi!

Et bien voila un bout de code que je vais pouvoir lire de plus près.

2 Likes

Cesium+ s’appuie sur un backend en java donc non, on est réfractaire à rien du tout ici :stuck_out_tongue: je veux dire même WoT wizard utilise un langage dont j’ignorais que certains l’utilisaient encore ;D

Mais bonne remarque, il faudrait migrer sur le gitlab duniter4j.

2 Likes