fabric hello world by mac
https://www.linuxidc.com/Linux/2016-10/136578.htmmkdir -p $GOPATH/src/github.com/HelloWorld/cd $GOPATH/src/github.com/HelloWorld/
·
0、参考
https://www.ibm.com/developerworks/cn/cloud/library/cl-ibm-blockchain-chaincode-development
-using-golang/index.html
1、先写一个hello.go
文件位于cd $GOPATH/src
即 /Users/frank/go/src/hello.go
fabric资源在$GOPATH/src/github.com/hyperledger
import "fmt"
import "github.com/hyperledger/fabric/core/chaincode/shim"
func main() {
fmt.Println("hello world . 你好 世界!")
}
这里遇到import shime文件报错
go build github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11: invalid flag in #cgo LDFLAGS:
-I/usr/local/share/libtool
解决办法:
https://stackoverflow.com/questions/49062730/invalid-flag-cgo-ldflags-break-build-with-go-lang
remove '/usr/local/share/libtool' from github.com/miekg/pkcs11 HEAD and then build successfully.
找到pkcs11.go文件,打开后搜索'/usr/local/share/libtool',发现有两行注释中包含,删除后可以编辑通过!
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献2条内容
所有评论(0)