我尝试使用 hyperledger composer/fabric (v0.19.0) 创建自己的网络
网络构建似乎不错,但是当我执行composer network install ...
我收到这个错误:
Composer Install....
⠹ Installing business network. This may take a minute...E0405 10:16:40.355332702 7660 ssl_transport_security.cc:599] Could not load any root certificate.
E0405 10:16:40.355402056 7660 ssl_transport_security.cc:1400] Cannot load server root certificates.
E0405 10:16:40.355430951 7660 security_connector.cc:1025] Handshaker factory creation failed with TSI_INVALID_ARGUMENT.
E0405 10:16:40.355453680 7660 secure_channel_create.cc:111] Failed to create secure subchannel for secure name '172.31.136.4:7051'
E0405 10:16:40.355471629 7660 secure_channel_create.cc:142] Failed to create subchannel arguments during subchannel creation.
谁能帮我 ?
PS:如果需要,我可以提供代码。
好吧,我想我可以回答我自己的问题。
事实是在多组织超级账本教程 https://hyperledger.github.io/composer/latest/tutorials/deploy-to-fabric-multi-org他们使用此cmd来替换connection.json中的证书:
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
我尝试将此 cmd 注入我的sed
cmd 但它失败了,因为 sed 似乎用真正的新行替换了 '\n' ,导致 json 损坏。
为了替换 json 文件中的证书,我使用了以下 cmd :
export ORG1_CA_CERT=$(awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt)
perl -p -i -e 's@INSERT_ORG1_CA_CERT@$ENV{ORG1_CA_CERT}@g' connection.json
它之所以有效,是因为 perl 正确打印了字符并且不解释它们。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)