-1

I've been following the hyperledger fabric tutorials and the asset-transfer-basic chaincode is not being deployed properly. My fabric version is 2.2, and my golang version is 1.18.x .

I've run this command :

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

I'm being presented with this error :

Error: failed to read chaincode package at 'basic.tar.gz': open basic.tar.gz: no such 
file or directory
+ PACKAGE_ID=
Error: failed to normalize chaincode path: 'go list' failed with: go: could not 
create module cache: mkdir /home/hypernew/go/pkg/mod: permission denied: exit status 1

What can I do to solve this?

Volker
  • 40,468
  • 7
  • 81
  • 87
Devdatt N
  • 21
  • 5

1 Answers1

0

It would be better to go through the Getting Started and Prerequisites. Have you pulled the code properly from github fabric-samples ? Most of the cases, this should solve the problem.

There is a possibility that the GOPATH env variable is not set properly. As the go module is enabled in the 2.2+ for vendoring, the GOPATH setup is critical.

Try the following command

go mod vendor 

from the chaincode directory. You can even try to compile this package locally and see whether the golang/ gopath etc is correctly handled. Compile using the following

go build --tags nopkcs11

If this works locally, then the same should work from network.sh also.

Ashishkel
  • 953
  • 11
  • 20