Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot compile chaincode

I am trying to compile the chaincode_example02 followed by this guide with Option 2 (for Mac). All steps were passed except compiling the code. I have the following error:

cd $GOPATH/src/github.com/chaincode_example02
go build
chaincode_example02.go:30:2: cannot find package "github.com/hyperledger/fabric/core/chaincode/shim" in any of:
    /usr/local/Cellar/go/1.7.1/libexec/src/github.com/hyperledger/fabric/core/chaincode/shim (from $GOROOT)
    ($GOPATH not set)
like image 428
eugenn Avatar asked Oct 10 '16 13:10

eugenn


2 Answers

You need to prepare the fabric source as libs follow command. Make sure GOPATH had been set first.

mkdir -p $GOPATH/src/github.com/hyperledger
cd $GOPATH/src/github.com/hyperledger
git clone -b release-1.2 https://github.com/hyperledger/fabric.git
like image 93
Nhan Cao Avatar answered Oct 08 '22 17:10

Nhan Cao


“Fabric” source code should be available locally in your GOPATH.

cd $GOPATH/src/github.com
mkdir hyperledger
cd hyperledger
git clone http://gerrit.hyperledger.org/r/fabric
like image 20
Sergey Balashevich Avatar answered Oct 08 '22 19:10

Sergey Balashevich