无法编译链码

eug*_*enn 5 hyperledger hyperledger-fabric

我正在尝试编译带有选项2 的本指南(适用于Mac)的chaincode_example02 。除编译代码外,所有步骤均已通过。我有以下错误:

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)
Run Code Online (Sandbox Code Playgroud)

Nha*_*Cao 7

您需要准备结构源,因为库遵循命令。确保首先设置了 GOPATH。

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
Run Code Online (Sandbox Code Playgroud)


Ser*_*ich 5

“ Fabric”源代码应在您的GOPATH中本地可用。

cd $GOPATH/src/github.com
mkdir hyperledger
cd hyperledger
git clone http://gerrit.hyperledger.org/r/fabric
Run Code Online (Sandbox Code Playgroud)