We have been developing and deploying smart contracts (chaincode) to our Hyperledger Fabric network on Amazon Managed Blockchain to manage and store data securely. We initially succeeded in deploying a simple example from the AMB documentation, but we now face issues with a more complex setup involving additional libraries. Below are the details of our current issue and what we have tried so far.
-
What is the code trying to achieve?
The smart contract code for Hyperledger aims to preserve various details from the backend on the blockchain. The primary function of the code, written in Go language, is to accurately save data in the blockchain. We are trying to install chaicode on peer nodes. -
What is the expected behavior I am looking for?
We previously managed to execute a simple code example from the AMB documentation that did not involve additional libraries. We were able to call transactions and interact with the blockchain via Docker successfully. We expect similar behavior with our current, more complex code that includes additional libraries, but we are facing compatibility issues. -
What is the problem I am encountering
We have encountered a problem (as it seems to us) of incompatibility of versions, and non-support of this code on the container/EC2/AMB. Every time we try to run our code we encounter a number of strange errors. For example, 1 error we encountered was this:
Error: chaincode install failed with status: 500 – failed to invoke backing implementation of ‘InstallChaincode’: could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 1 “vendor/github.com/go-openapi/jsonreference/reference.go:36:2: //go:build comment without // +build comment.
Despite the fact that our code is developed on the latest version of GO and libraries. After encountering this error, we added “// +build comment” manually. But we encountered the following error, which we do not know how to solve. And selecting versions did not help.
I have a problem when I try to do docker exec cli-node1 peer lifecycle chaincode install of my GO code in the AWS EC2 . The error that I get is the following:
[ec2-user@ip-10-0-1-189 ~]$ docker exec cli-node1 peer lifecycle chaincode install traceability_private_v2.tar.gz Error: chaincode install failed with status: 500 – failed to invoke backing implementation of ‘InstallChaincode’: could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 1 “package github.com/rubanik-0/traceability imports github.com/hyperledger/fabr ic-contract-api-go/contractapi: build constraints exclude all Go files in /chaincode/input/src/vendor/github.com/hyperledger/fabric-contract-api-go/contractapi The version of my fabric-contract-api-go/contractapi is 1.1.0 or I even try with 1.2.2
- What are the things I have tried?
- Select different versions of packages and the GO language.
- Follow the errors and fix them as they suggest
-
What is my current diagnosis?
Version of Go/Hyperledger in AMB is not supporting the chaincode.
Container version error or incorrectly implemented project on GO for Hyperledger. -
What is the help I require?
We need an experienced developer in the field of Amazon Managed Blockchain Hyperledger Fabric (Chaincode -Go language) to identify the root cause of our issue and provide a solution for proper implementation and deployment of our chaincode on Amazon Managed Blockchain – Hyperledger Fabric.
Any insights or recommendations on resolving these compatibility issues would be greatly appreciated. Thank you in advance for your assistance.
jona joy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.