简体   繁体   中英

Error: error getting chaincode bytes: listing deps for package ../asset-transfer-basic/chaincode-go/ failed: exit status 2

I'm currently trying to using my chain code on my channel, by following the instruction of hyper ledger fabric documentation. I tried to answer on different sites but none of them truly helped me out. I'm attaching the screenshot of my terminal for further clarification. enter image description here

The problem is related to go path and it's dependency on different package.

Please set go path and go code's dependent package properly.

You can check the following link. Link: https://hyperledger-fabric.readthedocs.io/en/release-2.2/chaincode4ade.html#managing-external-dependencies-for-chaincode-written-in-go

From the docs:

Your Go chaincode depends on Go packages (like the chaincode shim) that are not part of the standard library. The source to these packages must be included in your chaincode package when it is installed to a peer. If you have structured your chaincode as a module, the easiest way to do this is to “vendor” the dependencies with go mod vendor before packaging your chaincode.

go mod tidy
go mod vendor

This places the external dependencies for your chaincode into a local vendor directory.

Once dependencies are vendored in your chaincode directory, peer chaincode package and peer chaincode install operations will then include code associated with the dependencies into the chaincode package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM