• This repository has been archived on 20/Aug/2020
  • Stars
    star
    107
  • Rank 321,742 (Top 7 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android library for Iroha, a Distributed Ledger Technology (blockchain) platform.

This repository is not maintained anymore. To create awesome Android apps on Iroha, please use Java library. It is compatable with Android and is carefully maintained.

Iroha Android bindings

The library, in essence, is a set of Java interfaces and binary libraries compiled for different architectures. Supported architectures are arm, x86, x86_64.

build status Codacy Badge

Where to Get

There are two ways to get Iroha library for Android:

  1. Grab via Gradle (see details in the section Importing the Library from jcenter)

    implementation 'jp.co.soramitsu.iroha.android:iroha-android-bindings:+'
    
  2. Compile the library on your own.

Both options are described in the following sections.

Manual Build

The guide was tested on systems running Ubuntu 16.04 and macOS.

Prerequisites

Android NDK
Please download and unpack NDK to any suitable folder.

automake

sudo apt install automake
automake --version
# automake (GNU automake) 1.15

bison

sudo apt install bison
bison --version
# bison (GNU Bison) 3.0.4

cmake

Minimum required version is 3.8, but we recommend to install the latest available version (3.10.3 at the moment).

Since Ubuntu repositories contain unsuitable version of cmake, you need to install the new one manually. Here is how to build and install cmake from sources.

wget https://cmake.org/files/v3.10/cmake-3.10.3.tar.gz
tar -xvzf cmake-3.10.3.tar.gz
cd cmake-3.10.3/
./configure
make
sudo make install
cmake --version
# cmake version 3.10.3

Building the Library

All you need now is to download build script android-build.sh to any empty folder and launch it there.

Launch parameters are listed in the table below.

Position Required Parameter name Description Possible Values
1 Yes Platform name Name of the target platform for binary part of the library. arm64-v8a, armeabi-v7a armeabi, x86, x86_64
2 Yes *Android API Level API level supported by your NDK. See the link under the table for details. 27 for android-ndk-r16b
3 Yes Android NDK Path Full path to unpacked NDK. Please ensure that path does not contain spaces. /home/user/lib/android-ndk-r16b
4 Yes Java Package Name Package name that will be used for Java interfaces generation. Note that the binary also depends on chosen package name. jp.co.soramitsu.iroha.android
5 No Build Type Defines build mode of binary part of the library. Release is the default option. Debug or Release

Android API levels

Please use the same root part of Java package name for library build as you use for your Android project. For example, your project is located in a package called com.mycompany.androidapp, so please consider to build the library in a package, which name starts with com.mycompany.androidapp (e.g. com.mycompany.androidapp.iroha).

A couple of launch commands examples:

# build Java bindings and binary library for arm64-v8a in Release mode
./android-build.sh arm64-v8a 27 /home/user/lib/android-ndk-r16b com.mycompany.iroha

# build Java bindings and binary library for x86 in Debug mode
./android-build.sh x86 27 /home/user/lib/android-ndk-r16b com.mycompany.iroha Debug

Build artefacts will be collected in lib directory near the script android-build.sh. There will be two files - an archive bindings.zip and libirohajava.so.

How to Use/Import

Importing the Library from jcenter

The easiest way to use Irohalib for Android is to import the library dependency from jcenter.

All you need to do is a simple set of four steps:

  1. Add to your build.gradle file the following line:

    implementation 'jp.co.soramitsu.iroha.android:iroha-android-bindings:+'
    
  2. Copy the latest version of *.proto files from develop branch of Iroha [repository] into app/src/main/proto/ folder inside your project in Android Studio.

    The resulting directory structure should look like as follows:

    app
    └── src
        └── main
            └── proto
                ├── google
                │   └── protobuf
                │       └── empty.proto
                ├── block.proto
                ├── commands.proto
                ├── endpoint.proto
                ├── loader.proto
                ├── ordering.proto
                ├── primitive.proto
                ├── proposal.proto
                ├── queries.proto
                ├── responses.proto
                └── yac.proto
    
  3. Create additional directories app/src/main/proto/google/protobuf/ and place there a file called empty.proto with the following contents:

syntax = "proto3";

package google.protobuf;

option java_package = "com.google.protobuf";
option java_outer_classname = "EmptyProto";
option java_multiple_files = true;

message Empty {
}
  1. Add protobuf and grpc dependecies and protobuf configuration block into your buld.gradle file.
apply plugin: 'com.google.protobuf' 

dependencies {

  implementation 'com.google.protobuf:protobuf-lite:3.0.1'
  implementation 'io.grpc:grpc-core:1.8.0'
  implementation 'io.grpc:grpc-stub:1.8.0'
  implementation 'io.grpc:grpc-okhttp:1.8.0'
  implementation('io.grpc:grpc-protobuf-lite:1.8.0') {
  // Otherwise Android compile will complain "Multiple dex files define ..."
  exclude module: "protobuf-lite"
}

protobuf {
        protoc {
            artifact = 'com.google.protobuf:protoc:3.5.1-1'
        }
        plugins {
            javalite {
                artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"
            }
            grpc {
                artifact = 'io.grpc:protoc-gen-grpc-java:1.10.0'
            }
        }
        generateProtoTasks {
            all().each { task ->
                task.plugins {
                    javalite {}
                    grpc {
                        // Options added to --grpc_out
                        option 'lite'
                        option 'generate_equals=true'
                    }
                }
            }
        }
    }

How to Use Manually Built Library

  1. Create directory structure inside your Android project according to the package name of build library. Put there all the .java files from bindings.zip archive. For example, the path could be app/src/main/java/com/mycompany/iroha if you built the library with com.mycompany.iroha package name.

  2. Create directory app/src/main/jniLibs/<platform> where <platform> is the name of target platform (e.g. arm64-v8a). Put there libirohajava.so. Repeat this step for all required platforms (in this case you need to build the library for each platform).

  3. Repeat steps 2-4 from the previous section [Importing the Library from jcenter].

    Example Code

    Explore sample package to view sample application.

Authors

Bulat Mukhutdinov

Ali Abdulmadzhidov

License

Copyright 2018 Soramitsu Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

composer

⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
JavaScript
1,629
star
2

sawtooth-core

Core repository for Sawtooth Distributed Ledger
Python
1,424
star
3

fabric

THIS IS A READ-ONLY historic repository. Current development is at https://gerrit.hyperledger.org/r/#/admin/projects/fabric . pull requests not accepted
Go
1,168
star
4

burrow

https://wiki.hyperledger.org/display/burrow
Go
1,027
star
5

iroha

Iroha - A simple, decentralized ledger
C++
989
star
6

indy-sdk

indy-sdk
Rust
669
star
7

education

Hyperledger training material
JavaScript
372
star
8

ursa

Hyperledger Ursa (a shared cryptographic library) has moved to end-of-life status, with the components of Ursa still in use moved to their relevant Hyperledger projects (AnonCreds, Indy, Aries and Iroha).
Rust
319
star
9

sawtooth-supply-chain

Sawtooth Supply Chain
JavaScript
261
star
10

aries-framework-go

Hyperledger Aries Framework Go provides packages for building Agent / DIDComm services.
Go
240
star
11

composer-sample-networks

⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
JavaScript
222
star
12

quilt

Hyperledger Quilt - An implementation of the Interledger Protocol
Java
219
star
13

grid

Grid has moved to end-of-life status.
Rust
208
star
14

fabric-chaincode-evm

Go
175
star
15

avalon

Hyperledger Avalon enables privacy in blockchain transactions, moving intensive processing from a main blockchain to improve scalability and latency, and to support attested Oracles
Python
136
star
16

composer-sample-applications

⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
JavaScript
105
star
17

education-cryptomoji

JavaScript
97
star
18

fabric-chaintool

Clojure
91
star
19

sawtooth-next-directory

HTML
87
star
20

aries-framework-dotnet

Aries Framework .NET for building multiplatform SSI services
C#
84
star
21

sawtooth-marketplace

Python
84
star
22

fabric-sdk-rest

Read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-rest
JavaScript
79
star
23

sawtooth-pbft

Sawtooth PBFT consensus engine
Rust
76
star
24

composer-tools

⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
JavaScript
74
star
25

caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions
JavaScript
74
star
26

sawtooth-seth

Rust
73
star
27

transact

Transact is a transaction execution platform designed to be used as a library or component when implementing distributed ledgers, including blockchains.
Rust
66
star
28

fabric-baseimage

Deprecated Fabric Base Images
Shell
54
star
29

sawtooth-sabre

Sawtooth Sabre (WASM Smart Contracts)
Rust
52
star
30

education-sawtooth-simple-supply

Python
51
star
31

fabric-api-archive

Read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/fabric-api
Java
49
star
32

indy-crypto

Archive of Indy Crypto library. Superseded by the Hyperledger Ursa Project.
Rust
49
star
33

aries-toolbox

Hyperledger Aries
Vue
43
star
34

indy-agent

Archive of Indy Reference Agents and Tools. Superseded by the Hyperledger Aries Project.
Python
43
star
35

composer-knowledge-wiki

⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
40
star
36

aries-mobile-agent-xamarin

C#
39
star
37

fabric-chaintool-original

THIS IS A READ-ONLY historic repository. Current development is at https://gerrit.hyperledger.org/r/#/admin/projects/fabric-chaintool . pull requests not accepted
Clojure
38
star
38

sawtooth-explorer

TypeScript
37
star
39

iroha-dotnet

.NET library for Hyperledger Iroha, a simple distributed ledger.
C++
32
star
40

iroha-api

Iroha API
HTML
32
star
41

fabric-api

Read-only historic repo. Current development is at https://gerrit.hyperledger.org/r/#/admin/projects/fabric-api . pull requests not accepted
Java
32
star
42

sawtooth-sdk-javascript

JavaScript
30
star
43

composer-sample-models

⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
JavaScript
29
star
44

hyperledgerwp

Hyperledger Whitepaper
TeX
28
star
45

sawtooth-sdk-go

Go
28
star
46

iroha-scala

Scala library for Hyperledger Iroha, a simple distributed ledger. http://iroha.tech
Scala
28
star
47

composer-vscode-plugin

⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
TypeScript
27
star
48

sawtooth-sdk-rust

Rust
27
star
49

aries-protocol-test-suite

Test Suite for testing protocol compliance of Aries Agents
Python
26
star
50

sawtooth-raft

Rust
26
star
51

aries-acapy-plugin-toolbox

Hyperledger Aries
Python
24
star
52

indy-anoncreds

Python
24
star
53

sawtooth-rfcs

22
star
54

indy-sdk-react-native

React Native wrapper around Indy SDK Java and Objective-C wrappers.
Java
22
star
55

ci-management

Read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/ci-management
Shell
20
star
56

sawtooth-sdk-java

Java
19
star
57

indy-client

Sovrin client
Python
18
star
58

aries-cloudagent-loadgenerator

aries-cloudagent-loadgenerator
Kotlin
17
star
59

grid-contrib

Grid has moved to end-of-life status.
JavaScript
17
star
60

sawtooth-sdk-python

Python
17
star
61

iroha-ametsuchi

Flatbuffer database for the Hyperledger Iroha project.
C++
15
star
62

aries-framework-go-ext

Go
14
star
63

ursa-rfcs

Hyperledger Ursa has moved to end-of-life status.
TeX
13
star
64

composer-atom-plugin

⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
CoffeeScript
12
star
65

fabric-cop

This is a read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/fabric-cop no pull requests accepted
Go
12
star
66

aries-sdk-javascript

C++
12
star
67

sawtooth-private-utxo

11
star
68

sawtooth-sdk-dotnet

C#
11
star
69

ursa-wrapper-go

Hyperledger Ursa has moved to end-of-life status.
Go
11
star
70

indy-common

Common utility functions for other sovrin repos (like sovrin-client, sovrin-node etc)
Python
10
star
71

sawtooth-docs

Documentation source for Sawtooth Lake. Published docs at the link.
Python
10
star
72

iroha-docker

Dockerfiles for Iroha
Shell
10
star
73

sawtooth-poet

Python
9
star
74

grid-rfcs

Grid has moved to end-of-life status.
8
star
75

cello-analytics

Shell
8
star
76

sawtooth-mktplace

Example trading system for Sawtooth Lake distributed ledger.
Python
8
star
77

sawtooth-sdk-swift

Sawtooth SDK Swift
Swift
8
star
78

indy-ledger

Python
8
star
79

sawtooth-validator

This repo builds a validator (miner) for the Sawtooth Lake ledger. Docs at the link:
Python
7
star
80

iroha-network-tools

Network tools for Hyperledger Iroha
7
star
81

smart-contracts-wg

Repository for HL Smart Contracts Working Group working products
7
star
82

aries-sdk-java

Java
7
star
83

learning-materials-dev

https://wiki.hyperledger.org/display/LMDWG
Shell
7
star
84

sawtooth-arcade

Example transaction families for Sawtooth Lake distributed ledger.
Python
7
star
85

sawtooth-lib

Rust
6
star
86

sawtooth-dev-tools

Development environment and tools for Sawtooth Lake distributed ledger.
Shell
6
star
87

fabric-test-resources-gerrit

READ ONLY MIRROR of https://gerrit.hyperledger.org/r/#/admin/projects/fabric-test-resources NO PULL REQUESTS
Java
6
star
88

transact-contrib

5
star
89

homebrew-fabric

Ruby
5
star
90

sawtooth-devmode

Simple consensus engine for Hyperledger Sawtooth for developers
Python
5
star
91

sawtooth-ansible

5
star
92

aries-sdk-ruby

Rust
5
star
93

composer-sample-applications-hlfv1

Sample applications for Composer (with Fabric v1.0 support)
JavaScript
5
star
94

sawtooth-sdk-cxx

C++
4
star
95

sawtooth-docs-archive

Source files for the Hyperledger Sawtooth website
HTML
4
star
96

IDWG

All resources related to the Identity Working Group in Hyperledger
4
star
97

fabric-docs

Read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/fabric-docs
4
star
98

transact-rfcs

3
star
99

fabric-gerrit

JavaScript
3
star
100

tf-security

Documentation and other things for the security task force.
TeX
3
star