dockerhyperledger-fabrichyperledgerhyperledger-chaincode

Error deploying chaincode in Hyperledger Firefly Fabric


When you run the following command to raise a smart contract:

ff deploy fabric devtest asset_transfer.zip firefly asset_transfer 1.0 

I get the following error:

Error: docker run --platform linux/amd64 --rm --network=devtest_default -e 
CORE_PEER_ADDRESS=fabric_peer:7051 -e 
CORE_PEER_TLS_ENABLED=true -e CORE_PEER_TLS_ROOTCERT_FILE=/etc/firefly/organizations/peerOrganizations/
org1.example.com/peers/fabric_peer.org1.example.com/tls/ca.crt -e 
CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_MSPCONFIGPATH=/etc/firefly/organizations/peerOrganizations/
org1.example.com/users/Admin@org1.example.com/msp -v 
  /home/ubuntu/fabric-samples/asset-transfer-basic/chaincode-go/asset_transfer.zip:/package.tar.gz -v 
devtest_firefly_fabric:/etc/firefly hyperledger/fabric-tools:2.3 peer lifecycle chaincode install /package.tar.gz 
[1] 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: 2 "go: downloading github.com/hyperledger/fabric-contract-api-go v1.2.1

My versions:

  peer:
   Version: v2.5.4
   Commit SHA: e1e8e2e
   Go version: go1.20.6
   OS/Arch: linux/amd64
  Chaincode:
   Base Docker Label: org.hyperledger.fabric
   Docker Namespace: hyperledger
   go version go1.20.6 linux/amd64
   Docker version 24.0.6, build ed223bc
   FireFly version:  "Version": "1.2.2",

Is there any way to solve this?

First I did a go build and then executed the following command:

  ff deploy fabric devtest asset_transfer.zip firefly asset_transfer 1.0

Solution

  • your problem is with go version that doesnt match with go.mod, you can download fabric-samples 2.2.9 and downgrade your go to version 1.14