In order to execute the script to demonstrate java client library, you need to have java 1.8 and gradle
build automation system installed.
Once you have the prerequisites please follow the steps:
- Run
prepare.sh
script to build iroha java library and compile proto files:
./prepare.sh
-
Build java client library using gradle.
-
Make sure you have running iroha on your machine. You can follow this guide to launch iroha daemon. Please run iroha from
iroha/example
folder, since java code uses keys from there.
Code in TransactionExample.java
does the following:
- Assembles transaction from several commands using tx builder.
- Signs it using keys from
iroha/example
folder. - Sends it to iroha.
- Waits 5 secs and checks transaction's status using it's hash.
- Assembles query using query builder.
- Sends query to iroha.
- Reads query response.
Launch it using gradle:
gradle run