请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

./byfn.sh -m generate -c下提示没有cryptogen

我反复看了教程好几遍,也自己重新打了好几遍,都是如下问题。以下是我的操作流程,万分感谢!!

[root@localhost ~]# cd $GOPATH/src/github.com/hyperledger
[root@localhost hyperledger]# ll
总用量 4
drwxr-xr-x. 28 root root 4096 4月 26 15:53 fabric
drwxr-xr-x. 11 root root 257 4月 26 16:10 fabric-samples
[root@localhost hyperledger]# go version
go version go1.12.4 linux/amd64
[root@localhost hyperledger]# cd fabric
[root@localhost fabric]# ll
总用量 412
drwxr-xr-x. 8 root root 231 4月 26 15:53 bccsp
drwxr-xr-x. 11 root root 4096 4月 26 15:53 bddtests
-rw-r–r--. 1 root root 332781 4月 26 15:53 CHANGELOG.md
-rw-r–r--. 1 root root 13 4月 26 15:53 ci.properties
-rw-r–r--. 1 root root 597 4月 22 14:54 CODE_OF_CONDUCT.md
drwxr-xr-x. 17 root root 228 4月 26 15:53 common
-rw-r–r--. 1 root root 664 4月 26 15:53 CONTRIBUTING.md
drwxr-xr-x. 17 root root 4096 4月 26 15:53 core
drwxr-xr-x. 4 root root 233 4月 26 15:53 devenv
-rw-r–r--. 1 root root 3251 4月 26 15:53 docker-env.mk
drwxr-xr-x. 4 root root 115 4月 26 15:53 docs
drwxr-xr-x. 4 root root 38 4月 26 15:53 events
drwxr-xr-x. 8 root root 106 4月 26 15:53 examples
drwxr-xr-x. 14 root root 179 4月 26 15:53 gossip
drwxr-xr-x. 2 root root 22 4月 26 15:53 gotools
drwxr-xr-x. 12 root root 150 4月 26 15:53 images
-rw-r–r--. 1 root root 11358 4月 22 14:54 LICENSE
-rwxr-xr-x. 1 root root 17111 4月 26 15:53 Makefile
-rw-r–r--. 1 root root 3201 4月 26 15:53 mkdocs.yml
drwxr-xr-x. 4 root root 4096 4月 26 15:53 msp
drwxr-xr-x. 12 root root 4096 4月 26 15:53 orderer
drwxr-xr-x. 9 root root 126 4月 26 15:53 peer
drwxr-xr-x. 3 root root 16 4月 26 15:53 proposals
drwxr-xr-x. 10 root root 134 4月 26 15:53 protos
-rw-r–r--. 1 root root 3987 4月 26 15:53 README.md
drwxr-xr-x. 3 root root 23 4月 26 15:53 release
drwxr-xr-x. 2 root root 158 4月 26 15:53 release_notes
drwxr-xr-x. 3 root root 75 4月 26 15:53 sampleconfig
drwxr-xr-x. 2 root root 4096 4月 26 15:53 scripts
-rw-r–r--. 1 root root 316 4月 26 15:53 settings.gradle
drwxr-xr-x. 7 root root 112 4月 26 15:53 test
-rw-r–r--. 1 root root 301 4月 26 15:53 tox.ini
drwxr-xr-x. 2 root root 46 4月 26 15:53 unit-test
drwxr-xr-x. 7 root root 116 4月 26 15:53 vendor
[root@localhost fabric]# git checkout release-1.0
已经位于 ‘release-1.0’
[root@localhost fabric]# cd common/
[root@localhost common]# cd configtx
[root@localhost configtx]# cd tool
[root@localhost tool]# cd configtxgen
[root@localhost configtxgen]# ll
总用量 24
-rw-r–r--. 1 root root 14341 4月 26 15:53 main.go
-rw-r–r--. 1 root root 4531 4月 26 15:53 main_test.go
drwxr-xr-x. 2 root root 49 4月 26 15:53 metadata
[root@localhost configtxgen]# go install --tags=nopkcs11
[root@localhost configtxgen]# cd …
[root@localhost tool]# cd…
bash: cd…: 未找到命令…
[root@localhost tool]# cd …
[root@localhost configtx]# cd …
[root@localhost common]# cd tools/cryptogen
[root@localhost cryptogen]# 11
bash: 11: 未找到命令…
[root@localhost cryptogen]# ll
总用量 16
drwxr-xr-x. 2 root root 44 4月 26 15:53 ca
drwxr-xr-x. 2 root root 39 4月 26 15:53 csp
-rw-r–r--. 1 root root 16247 4月 26 15:53 main.go
drwxr-xr-x. 2 root root 49 4月 26 15:53 metadata
drwxr-xr-x. 2 root root 45 4月 26 15:53 msp
[root@localhost cryptogen]# go install --tags=nopkcs11
[root@localhost cryptogen]# cd $GOPATH/bin
[root@localhost bin]# ll
总用量 37640
-rwxr-xr-x. 1 root root 16501868 4月 26 18:19 configtxgen
-rwxr-xr-x. 1 root root 8588927 4月 26 18:21 cryptogen
-rwxr-xr-x. 1 root root 13448025 4月 22 18:21 govendor
[root@localhost bin]# cd $GOPATH/src/github.com/hyperledger/fabric-samples
[root@localhost fabric-samples]# ll
总用量 20
drwxr-xr-x. 4 root root 157 4月 26 16:10 balance-transfer
drwxr-xr-x. 4 root root 227 4月 26 16:10 basic-network
drwxr-xr-x. 6 root root 76 4月 26 16:10 chaincode
drwxr-xr-x. 3 root root 121 4月 26 16:10 chaincode-docker-devmode
drwxr-xr-x. 2 root root 126 4月 26 16:10 fabcar
drwxr-xr-x. 5 root root 253 4月 26 16:10 first-network
drwxr-xr-x. 4 root root 55 4月 26 16:10 high-throughput
-rw-r–r--. 1 root root 11358 4月 26 16:08 LICENSE
-rw-r–r--. 1 root root 470 4月 26 16:08 MAINTAINERS.md
-rw-r–r--. 1 root root 522 4月 26 16:10 README.md
drwxr-xr-x. 2 root root 48 4月 26 16:10 scripts
[root@localhost fabric-samples]# git checkout release-1.0
已经位于 ‘release-1.0’
[root@localhost fabric-samples]# cd first-network
[root@localhost first-network]# ./byfn.sh -h
Usage:
byfn.sh -m up|down|restart|generate [-c ] [-t ] [-d ] [-f ] [-s ] [-i ]
byfn.sh -h|–help (print this message)
-m - one of ‘up’, ‘down’, ‘restart’ or ‘generate’
- ‘up’ - bring up the network with docker-compose up
- ‘down’ - clear the network with docker-compose down
- ‘restart’ - restart the network
- ‘generate’ - generate required certificates and genesis block
-c - channel name to use (defaults to “mychannel”)
-t - CLI timeout duration in microseconds (defaults to 10000)
-d - delay duration in seconds (defaults to 3)
-f - specify which docker-compose file use (defaults to docker-compose-cli.yaml)
-s - the database backend to use: goleveldb (default) or couchdb
-i - pass the image tag to launch the network using the tag: 1.0.1, 1.0.2, 1.0.3, 1.0.4 (defaults to latest)

Typically, one would first generate the required certificates and
genesis block, then bring up the network. e.g.:

byfn.sh -m generate -c mychannel
byfn.sh -m up -c mychannel -s couchdb
byfn.sh -m up -c mychannel -s couchdb -i 1.0.6
byfn.sh -m down -c mychannel

Taking all defaults:
byfn.sh -m generate
byfn.sh -m up
byfn.sh -m down
[root@localhost first-network]# byfn.sh -m generate -c mychannel
bash: byfn.sh: 未找到命令…
[root@localhost first-network]# ./byfn.sh -m generate -c channel-test
Generating certs and genesis block for with channel ‘channel-test’ and CLI timeout of '10’
Continue (y/n)? y
proceeding …
which: no cryptogen in (/usr/local/src/go/src/github.com/hyperledger/fabric-samples/first-network/…/bin:/usr/local/src/go/src/github.com/hyperledger/fabric-samples/first-network:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/root/bin)
cryptogen tool not found. exiting
[root@localhost first-network]#

正在回答 回答被采纳积分+3

1回答

自游蜗牛 2019-04-26 20:57:48

亲,你好。检查下gopath/ bin在你的path下没有。祝你学习愉快!

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信