我在localhost:3000上有一个以前运行的简单网络,为了达到这个目的,我使用了不同的链接来完成先决条件和安装步骤,而不是http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html,因为我从来没有使用fabric-samples文件夹。 在启动网络的同时,我收到了我的网站 [第一个错误] [1]
因此,我打开了/home/himani/fabric-samples/first-network/docker-compose-cli.yaml并通过更改peer0.org1.example.com
和orderer.example.com
的容器名称进行了编辑<{1}}和peer000.org001.example.com
。
进行编辑后,在运行命令orderer000.example.com
时,它可以执行而不会出现任何错误。
在纠正了我在安装npm时遇到的一些错误后,我使用命令./byfn.sh up
关闭了该网络,并再次下载了fabric-samples文件夹。现在,在运行./byfn.sh down
时,我没有收到任何错误。但是在尝试运行此命令时遇到错误:
./byfn.sh up
错误:(奇怪的是, ./byfn.sh up -l node
和orderer000.example.com
也在运行,尽管关闭该网络并删除了该文件夹)
orderer000.example.com
更新2:
在 himani@himani-HP-Notebook:~/fabric-samples/first-network$ ./byfn.sh up -l node
Starting with channel 'mychannel' and CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
2018-06-05 12:01:27.340 UTC [main] main -> INFO 001 Exiting.....
LOCAL_VERSION=1.1.0
DOCKER_IMAGE_VERSION=1.1.0
peer0.org2.example.com is up-to-date
peer1.org2.example.com is up-to-date
orderer000.example.com is up-to-date
peer1.org1.example.com is up-to-date
peer000.org001.example.com is up-to-date
cli is up-to-date
____ _____ _ ____ _____
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Build your first network (BYFN) end-to-end test
Channel name : mychannel
Creating channel...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=1
+ set +x
2018-06-05 12:01:30.704 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating ReadSet: readset expected key [Group] /Channel/Application at version 0, but got version 1
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
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
[1]: https://i.stack.imgur.com/afsMk.png
**UPDATE:**
Now, I get an error running `./byfn.sh up` also, but now `orderer000.example.com` and `peer000.org001.example.com` are not mentioned, but their correct version, `orderer.example.com` and `peer.org1.example.com` are.
I also referred to the solution of a similar question https://stackoverflow.com/questions/49648529/hyperledger-fabric-simples-issue-run-byfn-sh-m-up-failed by modifying first-network/base/peer-base.yaml to include this first line under `environment` section : `- GODEBUG=netdns=go` , but to no avail. I received the following error:
himani@himani-HP-Notebook:~/fabric-samples/first-network$ ./byfn.sh up
Starting with channel 'mychannel' and CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
2018-06-06 05:07:24.242 UTC [main] main -> INFO 001 Exiting.....
LOCAL_VERSION=1.1.0
DOCKER_IMAGE_VERSION=1.1.0
peer0.org2.example.com is up-to-date
orderer.example.com is up-to-date
peer0.org1.example.com is up-to-date
peer1.org1.example.com is up-to-date
peer1.org2.example.com is up-to-date
cli is up-to-date
____ _____ _ ____ _____
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Build your first network (BYFN) end-to-end test
Channel name : mychannel
Creating channel...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
CORE_PEER_PROFILE_ENABLED=true
CORE_PEER_GOSSIP_ORGLEADER=false
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=net_byfn
CORE_LOGGING_LEVEL=INFO
CORE_PEER_GOSSIP_USELEADERELECTION=true
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=1
+ set +x
Error: failed to create deliver client: failed to load config for OrdererClient: unable to load orderer.tls.rootcert.file: open /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem: no such file or directory
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
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
再次运行网络后,down-ing
运行良好。但./byfn.sh up
再次抛出错误。
./byfn.sh up -l node
答案 0 :(得分:2)
我建议停止所有容器并删除所有容器,然后将yaml文件返回原始名称。然后尝试重新启动它。
停止和删除容器的命令是:
docker stop $(docker ps -q)
和
docker rm $(docker ps -aq)
docker site有很好的docker命令文档。
答案 1 :(得分:1)
./byfn.sh up
和,.byfn.sh -l node
。作为一个黄金法则,每当遇到问题时,关闭网络然后重新启动一直工作到现在为止
答案 2 :(得分:0)
该示例用于存储库的FirstNetwork示例:
这对我有用:清理环境:
docker ps -aq
^这将为您提供容器ID的列表。一张一张地删除它们:
docker rm -rf containerIds
执行向下命令:
./byfn.sh -m down
然后执行向上命令:
./byfn.sh -m up