Re: Install fabric-chaincode-java to raspberry 4 #fabric-chaincode #fabric-questions

Brett T Logan <development.brett@...>

Somewhere I have the instructions on how to build this, but the net-net is, the Java protobuf library doesnt have a native distribution for ARM. You need to clone the protobuf repo (which will also have a missing dependency that will require you to build it as well, though I can't remember off the top of my head which one), and you will need to build it, and deploy it to your local maven repo on your machine, so the chaincode-java build process can find these two dependencies prebuilt in your local maven repo.

I'll try to dig up the RocketChat post, or mailing list post where I gave detailed instructions on doing this, but it's been a while and I'm not confident I'll find it.

Brett Logan

On Thu, Feb 25, 2021, 03:44 Nikos Karamolegkos <nkaram@...> wrote:

Hello, I would like to build latest version of hypeledger fabric into a raspberry 4 (using java). As I can see in the bash script used by curl here (latest installation) the versions that are used are:

  • fabric 2.3.1
  • fabric-ca 1.4.9
  • fabric-chaincode-java 2.3.1

Unfortunately, there are not pre-built images for all these repositories so I have to build them from source. In order to build fabric 2.3.1 I can make some changes to the Dockerfile (as in master branch i.e add binutils-gold) in order to support raspberry. Respectively, I can do the same for the fabric-ca 1.4.9. The real problem is the fabric-chaincode-java 2.3.0 (there is no 2.3.1 tag in github!!), I have the same problem as here so I try to follow the suggested instructions but I fail. Specifically, when I run ../gradlew java_pluginExecutable -PskipAndroid=true

I end up with a message:


/usr/bin/ld: /usr/local/lib/libprotoc.a(plugin.pb.o):( undefined reference to `descriptor_table_google_2fprotobuf_2fdescriptor_2eproto'
collect2: error: ld returned 1 exit status
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':grpc-compiler:linkJava_pluginExecutable'.
> A build operation failed.
      Linker failed while linking protoc-gen-grpc-java.

Are they any instructions with the prerequisites in order to build it?  Note that there is a  pre-build image but for the version 2.2.0 so there is way to build it. Finally, I have not seen any information about the compatible versions of the different repositories, for example can I use fabric 2.3.1 with the 2.2 fabric-chaincode-java or I would have a version mismatch? Thus, which versions are compatible with each other?


Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)

Join to automatically receive all group messages.