Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ heraj Public

Java client framework for aergo

License

aergoio/heraj

Repository files navigation

heraj - Java client framework for aergo

MIT License LoC Travis_ci codecov.io Maintainability

The hera is the client-side framework for the aergo. This repository, heraj is java implementation for hera.

Latest

v1.2.1

build with aergo-protobuf e4c13cc39d766b275e940cebeb41ed6b9ac197ab

Compatibility

  • Aergo : v1.2.x
  • Java : JDK 7 or higher
  • Android : Android 3.0 (API 11) or higher

Download

There are 3 kind of library:

  • heraj-transport : minimum library including all of the base
  • heraj-wallet : nonce handling wallet library (depends on heraj-transport)
  • heraj-smart-contract : simple client to call smart contract with a java interface (depends on heraj-wallet)

If you just want a minimum one, use heraj-transport. Or need more feature, use heraj-wallet or heraj-smart-contract.

Maven

<repositories>
  <repository>
    <id>jcenter</id>
    <url>https://jcenter.bintray.com</url>
  </repository>
</repositories>

...

<dependencies>
  <dependency>
    <groupId>io.aergo</groupId>
    <artifactId>heraj-transport</artifactId>
    <version>${herajVersion}</version>
  </dependency>
  <dependency>
    <groupId>io.aergo</groupId>
    <artifactId>heraj-wallet</artifactId>
    <version>${herajVersion}</version>
  </dependency>
  <dependency>
    <groupId>io.aergo</groupId>
    <artifactId>heraj-smart-contract</artifactId>
    <version>${herajVersion}</version>
  </dependency>
</dependencies>

Gradle

repositories {
  jcenter()
}

...

dependencies {
  implementation "io.aergo:heraj-transport:${herajVersion}"
  implementation "io.aergo:heraj-wallet:${herajVersion}"
  implementation "io.aergo:heraj-smart-contract:${herajVersion}"
}

Modules

The repository contains next:

  • core/annotation
  • core/util
  • core/common
  • core/protobuf
  • core/transport
  • client/wallet
  • client/smart-contract
  • examples

Integration

TBD

Build

Prerequisites

JDK

Clone

$ git clone --recurse-submodule https://github.com/aergoio/heraj.git

Build and package

  • Initialize submodule (if not initialized)
$ git submodule init
  • Update submodule
$ git submodule update
  • Clean
$ ./build.sh clean
  • Run gradle
$ ./build.sh gradle
  • Install to maven local
$ ./build.sh install

Test

Kind of test

Unit test

They are classes with 'Test' suffix.

Integration test

They are classes with 'IT' suffix meaning integration test.

Benchmark test

They are classes with 'Benchmark' suffix, which using jmh.

Run tests

Unit test

$ ./build.sh test

Integration test

$ ./build.sh it

Documentation

We provides next in https://aergoio.github.io/heraj

  • JavaDoc
  • Test Coverage

How to build documents

$ ./build.sh docs

Contribution

Guidelines for any code contributions:

  1. Any changes should be accompanied by tests. It's guaranteed by travis ci.
  2. Code coverage should be maintained. Any requests dropping down code coverage significantly will be not confirmed.
  3. All contributions must be licensed MIT and all files must have a copy of statement indicating where license is (can be copied from an existing file).
  4. All java files should be formatted according to Google's Java style guide. You can use checkstyle plugin for eclipse or IntelliJ. And you can check by running ./build.sh gradle
  5. Please squash all commits for a change into a single commit (this can be done using git rebase -i). Make sure to have a meaningful commit message for the change.