Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 2.28 KB

README.md

File metadata and controls

30 lines (24 loc) · 2.28 KB

Hyperledger SDK For Android

Note - The jar file for fabric is fabric-sdk-java/target/fabric-sdk-java01.1.0-alpha.jar. This file includes all the dependendencies. This jar will work on only on API >26 since android support Java 8 from API 26 and above. To make compatible with lower version you might have to make following changes:

1. Java.util.Base64 class should be replaced with android Base64 package.
2. Java.time.Instant class should be replaced with java.sql.Timestamp. +There might be other changes required as well.


Sofwares


Changes Made for Fabric-java-SDK

1. Shaded maven dependencies (org.apache.commons.codec, org.apache.http, javax.naming) and also included some dependencies in the jar. (check pom.xml for more details)
2. Replaced grpc-netty package with grpc-okhttp package as grpc-netty is not suporrted by android.
2. Replaced NettyChannelBuilder with OkHttpChannelBuilder class and added javax.net.ssl.SSLSocketFactory to OkHttpChannelBuilder for enabling tls communication. (Check Endpoint.java for more details)


Usage

1. Clone the project on your local machine.
2. Import HyperledgerSDKTest project in you android studio
3. Make sure Hyperledger network is up and running with orderer and peers + CA
4. Edit config.properties to update the hyperldegr configuration settings
5. Replace corret atrifacts in asset folder in HyperledgerSDKTest project directory
5. Run MainActivity.class as Android Application
Note MainActivity.class has many function like channelCreate, joinChannel , installChaincode , instantiateChaincode, invokeChaincode, queryChaincode. kindly uncomment the required one and run the application. The output is displayed in the console.