Hyperledger Fabric Error Error getting chaincode code chaincode cannot find package

0 votes

I want to use cid package inside my chaincode. When I try to install chaincode, I get the following error:

Error: Error getting chaincode code chaincode: 
Error getting chaincode package bytes: Error obtaining dependencies for github.com/hyperledger/fabric/core/chaincode/lib/cid: 
<go, [list -f {{ join .Deps "\n"}} github.com/hyperledger/fabric/core/chaincode/lib/cid]>: failed with error: "exit status 1" 
cannot load package: package github.com/hyperledger/fabric/core/chaincode/lib/cid: cannot find package "github.com/hyperledger/fabric/core/chaincode/lib/cid" in any of:
/opt/go/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOROOT)
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOPATH)

I am usind Docker to run peer, orderer, ca, and cli containers. 



How to solve this?

Nov 12, 2018 in Blockchain by digger
• 26,740 points
5,328 views

1 answer to this question.

0 votes

In the startFabric.sh launch the cli container using:

docker-compose -f ./docker-compose.yml up -d cli

In your compose yaml file, you should see something like this:

./../chaincode/:/opt/gopath/src/github.com/

If you see this declaration, copy in your local machine the folder /hyperledger/fabric/core/chaincode/lib/cid into your chaincode folder. You should find it in chaincode/abac if you are using the last version of fabric samples 

answered Nov 12, 2018 by Omkar
• 69,220 points

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer
+2 votes
1 answer
0 votes
3 answers
0 votes
1 answer
+1 vote
4 answers
0 votes
4 answers

Hyperledger fabric: enrollAdmin.js Error: Cannot find module 'fabric-client'

Change your directory to fabric-samples/fabrcar. And run: npm ...READ MORE

answered Nov 21, 2018 in Blockchain by Omkar
• 69,220 points
5,278 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP