简体   繁体   English

区块链Hyperledger Fabric开发环境设置

[英]Blockchain Hyperledger Fabric dev env setup

I am very close to set up dev environment for hyperledger fabric and following this link https://github.com/IBM-Blockchain/learn-chaincode/blob/master/docs/setup.md 我非常接近为超级账本结构设置开发环境,并单击此链接https://github.com/IBM-Blockchain/learn-chaincode/blob/master/docs/setup.md

When I run this command git clone -b v0.6 http://gerrit.hyperledger.org/r/fabric and run go build. 当我运行此命令时,git clone -b v0.6 http://gerrit.hyperledger.org/r/fabric并运行go build。 I get following error: 我收到以下错误:

can't load package: package github.com/hyperledger/fabric: no buildable Go source files in /Users/test/work/src/github.com/hyperledger/fabric 无法加载包:包github.com/hyperledger/fabric:/Users/test/work/src/github.com/hyperledger/fabric中没有可构建的Go源文件

However when I run step 4 from the link, the build success. 但是,当我从链接运行步骤4时,构建成功。 cd $GOPATH/src/github.com//learn-chaincode/start cd $ GOPATH / src / github.com // learn-chaincode / start

go build ./ 去建立./

Here build is not succeed only for http://gerrit.hyperledger.org/r/fabric . 在这里,仅http://gerrit.hyperledger.org/r/fabric的构建不是成功的。

Any thoughts? 有什么想法吗?

Please suggest! 请提出建议!

I think the manual is not precisely written here. 我认为手册在这里写得并不准确。 You are not supposed to run go build . 您不应该运行go build . on the cloned fabric repository. 在克隆的结构存储库上。 The manual just states here, that if you are getting build errors later , the clone into your go sources did not work. 手册仅在此处指出,如果以后出现构建错误,则克隆到go源码中不会起作用。 I is not asking you to build the fabric repository. 我不是要您建立结构存储库。 If your build command is executed in step 4, everything should be set up correctly. 如果在第4步中执行了build命令,则应正确设置所有内容。

Assuming you are setting up the dev environment you want to build things for that after cloning the repo. 假设您正在设置开发环境,则在克隆存储库后要为此构建东西。 This is done with make, thus eg make all to build and test all. 这是通过make完成的,因此例如make all构建并测试全部。

To build chaincode later on you use go build in the folder where you have the chaincode source file. 要在以后构建链码, go build在拥有链码源文件的文件夹中使用go build

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM