fabric二進制工具
我們在跑demo的時候瞬场,會用到fabric的二進制工具紊遵,比如:
- configtxgen
- configtxlator
- cryptogen
... 等等
這些二進制工具在官方教程或者網(wǎng)上一些前輩留下的資料存在被強的可能
如:
- 官方描述:
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
其實析恢,我們大可不必這么麻煩,在官方源碼中已經(jīng)告訴我們?nèi)绾紊蛇@些文件
首先從github上面獲取fabric源碼
git clone https://github.com/hyperledger/fabric.git
然后直接在該目錄下執(zhí)行:
make release
等運行完就可以在release目錄下就直接生成出來了,是不是異常簡單抄瑟,比墻外或者云上下載要簡單得多咧欣。
編譯完成之后浅缸,記得將該目錄加入到系統(tǒng)環(huán)境變量PATH中去,避免在腳本運行的時候找不到這些二進制工具魄咕。
那為什么我們執(zhí)行make release就可以生成了呢衩椒,那是因為在Makefile文件中,已經(jīng)給我們標注出來了哮兰,當參數(shù)是release時候毛萌,會生成自身平臺對應(yīng)的二進制工具。
release - builds release packages for the host platform
這里除了release還有很多參數(shù)可以傳入喝滞,如:
#- 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就可以解決二進制不用墻的問題就好了。
謝謝