我一直在跟踪
http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html#troubleshoot
创建我的第一个网络。
为了简单起见,我做了一个单独的文件夹,
锰
里面
第一网络
一开始只是
加密配置.yaml
,
隐孢子虫
,
配置.yaml
,
配置文件
,
docker-compose-cli.yaml文件
和
基础
文件夹在
锰
文件夹,观察什么时候创建,也可以消除bin路径的混乱。
我已按相同顺序执行了以下命令:
./cryptogen generate --config=./crypto-config.yaml
./configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
./configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID testhimani
./configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID testhimani -asOrg Org1MSP
./configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID testhimani -asOrg Org2MSP
docker exec -it cli bash
执行完最后一个命令后,我不得不打开一个新的终端窗口,
as I couldn't get the command input "$"
.
在新终端上,在执行通道创建和连接命令时,我收到一个错误,即找不到“peer”命令。
himani@himani-HP-Notebook:~/fabric-samples/first-network/mn$ peer channel create -o orderer.example.com:7050 -c testhimani -f ./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
No command 'peer' found, did you mean:
Command 'pee' from package 'moreutils' (universe)
Command 'pear' from package 'php-pear' (main)
Command 'peet' from package 'pipexec' (universe)
Command 'beer' from package 'gerstensaft' (universe)
peer: command not found
更新
在之后的同一终端而不是在新终端上执行命令后,错误如下:
himani@himani-HP-Notebook:~/fabric-samples/first-network/pg$ docker exec -it cli bash
root@0404332355e0:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel create -o orderer.example.com:7050 -c testhimani -f ./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded
Usage:
peer channel create [flags]
Flags:
-c, --channelID string In case of a newChain command, the channel ID to create.
-f, --file string Configuration transaction file generated by a tool such as configtxgen for submitting to orderer
-t, --timeout int Channel creation timeout (default 5)
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
--logging-level string Default logging level and overrides, see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer.
--tls Use TLS when communicating with the orderer endpoint
-v, --version Display current version of fabric peer server
更新2:
我觉得我的文件夹里少了订购员。我该怎么处理?
himani@himani-HP-Notebook:~/fabric-samples/first-network/pg$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0404332355e0 hyperledger/fabric-tools:latest "/bin/bash" 2 days ago Up 2 days cli
68075835c9f9 hyperledger/fabric-peer:latest "peer node start" 2 days ago Up 2 days 0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp peer1.org2.example.com
8a76208f8411 hyperledger/fabric-peer:latest "peer node start" 2 days ago Up 2 days 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer1.org1.example.com
87a73761dfc7 hyperledger/fabric-peer:latest "peer node start" 2 days ago Up 2 days 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
9ab8cbc25f99 hyperledger/fabric-peer:latest "peer node start" 2 days ago Up 2 days 0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp peer0.org2.example.com