Error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "can't load package: package ../../bin/github.com/hyperledger/fabric/chaincode/marbles: open /bin/github.com/hyperledger/fabric/chaincode/marbles: no such file or directory.
I see it is looking for a relative directory. relative to what? chaincode install was fine. If the chaincode is installed, why can it not be found for instantiate? 1 peer. 1 solo orderer. channel joined fine.
Chaincode install doesn't mean you have correctly mapped your chaincode path,
peer chaincode install -p {path} -n {} -v {}
Chaincode instantiate builds and instantiate your chaincode.
peer chaincode instantiate -n {} -v {} -c {} -C {}
There's a "hidden" expectation in the path mapping. It expects there to be a /src directory under gopath that caused me some trouble until I figured it out.
Here's my solution fwiw:
In your compose yaml for the peer you would set the env variable :
- GOPATH=/opt/gopath
Then in the CLI you can install and instantiate thus:
SIGNED_CHAINCODE_LOCATION=/opt/gopath/src/chaincode/<cc_dir>/<signed_cc>.out
peer chaincode install /${SIGNED_CHAINCODE_LOCATION}
And instantiate as normal. Just use the directory instead of the .out file if you don't need to package and sign.
In my case I added a working dir in the peer that set the chain code to a relative directory to my base blockchain directory: - ./chaincode/:/opt/gopath/src/chaincode/
and dumped the go folder into there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With