fabric二进制工具tips

fabric二进制工具

我们在跑demo的时候,会用到fabric的二进制工具,比如:

  • configtxgen
  • configtxlator
  • cryptogen
    ... 等等

这些二进制工具在官方教程或者网上一些前辈留下的资料存在被强的可能

如:

  • 官方描述:
curl -sSL http://bit.ly/2ysbOFE | bash -s 1.2.0
  • 百度出来的前辈资料:
curl -sSL https://goo.gl/eYdRbX | bash

后来有前辈修传到了公有云上:

curl -sSL http://oui195df4.bkt.clouddn.com/download-bin.sh | bash

其实,我们大可不必这么麻烦,在官方源码中已经告诉我们如何生成这些文件

首先从github上面获取fabric源码

git clone https://github.com/hyperledger/fabric.git

然后直接在该目录下执行:

make release

等运行完就可以在release目录下就直接生成出来了,是不是异常简单,比墙外或者云上下载要简单得多。
编译完成之后,记得将该目录加入到系统环境变量PATH中去,避免在脚本运行的时候找不到这些二进制工具。

那为什么我们执行make release就可以生成了呢,那是因为在Makefile文件中,已经给我们标注出来了,当参数是release时候,会生成自身平台对应的二进制工具。

release - builds release packages for the host platform

这里除了release还有很多参数可以传入,如:

#- all (default) - builds all targets and runs all non-integration tests/checks
#- checks - runs all non-integration tests/checks
#- desk-check - runs linters and verify to test changed packages
#- configtxgen - builds a native configtxgen binary
#- configtxlator - builds a native configtxlator binary
#- cryptogen  -  builds a native cryptogen binary
#- idemixgen  -  builds a native idemixgen binary
#- peer - builds a native fabric peer binary
#- orderer - builds a native fabric orderer binary
#- release - builds release packages for the host platform
#- release-all - builds release packages for all target platforms
#- unit-test - runs the go-test based unit tests
#- verify - runs unit tests for only the changed package tree
#- profile - runs unit tests for all packages in coverprofile mode (slow)
#- test-cmd - generates a "go test" string suitable for manual customization
#- gotools - installs go tools like golint
#- linter - runs all code checks
#- check-deps - check for vendored dependencies that are no longer used
#- license - checks go source files for Apache license header
#- native - ensures all native binaries are available
#- docker[-clean] - ensures all docker images are available[/cleaned]
#- docker-list - generates a list of docker images that 'make docker' produces
#- peer-docker[-clean] - ensures the peer container is available[/cleaned]
#- orderer-docker[-clean] - ensures the orderer container is available[/cleaned]
#- tools-docker[-clean] - ensures the tools container is available[/cleaned]
#- protos - generate all protobuf artifacts based on .proto files
#- clean - cleans the build area
#- clean-all - superset of 'clean' that also removes persistent state
#- dist-clean - clean release packages for all target platforms
#- unit-test-clean - cleans unit test state (particularly from docker)
#- basic-checks - performs basic checks like license, spelling and linter
#- enable_ci_only_tests - triggers unit-tests in downstream jobs. Applicable only for CI not to use in the local machine.
#- docker-thirdparty - pulls thirdparty images (kafka,zookeeper,couchdb)
#- docker-tag-latest - re-tags the images made by 'make docker' with the :latest tag
#- help-docs - generate the command reference docs

熟悉make的小伙伴肯定对这些不会陌生了,对于不熟悉的只需要记住make release就可以解决二进制不用墙的问题就好了。

谢谢

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 简介 此项目是一个模拟公民身份信息链的区块链项目 github 地址: https://github.com/ak...
    CrazyWolf_46a9阅读 12,819评论 0 0
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,378评论 25 709
  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 14,472评论 2 59
  • 1、通过CocoaPods安装项目名称项目信息 AFNetworking网络请求组件 FMDB本地数据库组件 SD...
    阳明AI阅读 16,040评论 3 119
  • 敬爱的李老师,智慧的马教授,亲爱的家人们:大家好,我是华夏炜烨机械有限公司的张文亮,今天是我日精进第5天,跟大家分...
    亮_4094阅读 910评论 0 0