问题
I'm doing the Chaincode Tutorial and I have problems to compile the given chaincode ("Building Chaincode").
If I try to compile the sacc.go with
go get -u --tags nopkcs11 github.com/hyperledger/fabric/core/chaincode/shim
I get
package plugin: unrecognized import path "plugin" (import path does not begin with hostname)
package context: unrecognized import path "context" (import path does not begin with hostname)
I was thinking about $GOPATH and $GOROOT as problems, so go env gives me
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/name/go"
GORACE=""
GOROOT="/usr/lib/go-1.6"
GOTOOLDIR="/usr/lib/go-1.6/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
Any ideas how to solve the problem?
回答1:
Looks like you are using Hyperledger Fabric v1.1.0. This requires Go 1.9 or higher. Looks like you are using Go 1.6
来源:https://stackoverflow.com/questions/49451138/chaincode-for-developers-hyperledger-fabric-tutorial