Search code examples
androidandroid-studiohyperledger-fabricblockchainchaincode

Connecting Android to Hyperledger Fabric network


So I have a 4 organization (10 peers altogether, CLI and 1 orderer) Hyperledger Fabric network up and running on my PC. I use Docker and chaincode written in Go without any additional tools that Hyperledger offers.

On the other side, I'm developing an Android application in Android Studio. In this app, one can create an account and keep track of some points that come from the above mentioned organizations. For this I need to access my running chaincode form the android app - I need to query data, read it & change it in my blockchain.

Essentially I need to invoke my chaincode & make changes to my blockchain from my Android app.

What would be the best solution for this? Do I incorporate CA's and somehow connect them with the Android app? Is there some kind of API I could use? It doesn't make sense to create an additional database for my android app to use, since I also need info from my blockchain.


Solution

  • Solutions:

    1. You can make your own gRPC clients. This process is very costly but this is the best way till now. To make your own gRPC clients, you can take help from Hyperledger Fabric Java SDK
    2. You can convert Hyperledger Fabric Java SDK to Android.
    3. You can use keyhole-fabric-api-gateway though it has some security problems.

    & obviously there are other options too.