[英]when i carry out official document ‘test-network’,Cannot run peer because error when setting up MSP of type bccsp from directory
my fabric version is v2.2.1 and my docker images are我的面料版本是 v2.2.1,我的 docker 图片是
ev-peer0.org2.example.com-basic_1.0-4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad-6c0d5b0755cb92ed5555bd2e8a8765a6f425d1ed5ed9a90e625e01939e2113be latest a123e0b8baaf 21 minutes ago 22.4MB
dev-peer0.org1.example.com-basic_1.0-4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad-42f57faac8360472e47cbbbf3940e81bba83439702d085878d148089a1b213ca latest b7b0157c45ec 21 minutes ago 22.4MB
hyperledger/fabric-ca 1.4 dbbc768aec79 3 weeks ago 158MB
hyperledger/fabric-ca 1.4.9 dbbc768aec79 3 weeks ago 158MB
hyperledger/fabric-ca latest dbbc768aec79 3 weeks ago 158MB
hyperledger/fabric-tools 2.2 e9b802fadb41 3 weeks ago 519MB
hyperledger/fabric-tools 2.2.1 e9b802fadb41 3 weeks ago 519MB
hyperledger/fabric-tools latest e9b802fadb41 3 weeks ago 519MB
hyperledger/fabric-peer 2.2 ece149884124 3 weeks ago 55MB
hyperledger/fabric-peer 2.2.1 ece149884124 3 weeks ago 55MB
hyperledger/fabric-peer latest ece149884124 3 weeks ago 55MB
hyperledger/fabric-orderer 2.2 78a16ddd2cf4 3 weeks ago 38.4MB
hyperledger/fabric-orderer 2.2.1 78a16ddd2cf4 3 weeks ago 38.4MB
hyperledger/fabric-orderer latest 78a16ddd2cf4 3 weeks ago 38.4MB
hyperledger/fabric-ccenv 2.2 8e554c280cac 3 weeks ago 586MB
hyperledger/fabric-ccenv 2.2.1 8e554c280cac 3 weeks ago 586MB
hyperledger/fabric-ccenv latest 8e554c280cac 3 weeks ago 586MB
hyperledger/fabric-baseos 2.2 0b99d26b26ad 3 weeks ago 6.85MB
hyperledger/fabric-baseos 2.2.1 0b99d26b26ad 3 weeks ago 6.85MB
hyperledger/fabric-baseos latest 0b99d26b26ad 3 weeks ago 6.85MB
couchdb 3.1 6cc07e2c5651 5 weeks ago 190MB
busybox latest 6858809bf669 6 weeks ago 1.23MB
hyperledger/fabric-nodeenv 2.2 ab88fe4d29dd 3 months ago 293MB
I follow the official documentation steps我按照官方文档步骤
./network up createChannel
./network deployCC
and configure the corresponding path however, when I perform a peer operation并配置相应的路径,但是,当我执行对等操作时
peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"function":"InitLedger","Args":[]}'
the following error occurred发生以下错误
Cannot run peer because error when setting up MSP of type bccsp from directory /home/peng/go/src/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp: KeyMaterial not found in SigningIdentityInfo
what can I do for it?我能为它做些什么? help me please thanks very much
请帮助我,非常感谢
It seems that the crypto material have not been created well, because you haven't executed correctly the network.sh script
.似乎加密材料没有创建好,因为你没有正确执行
network.sh script
。 As it is mentioned at the official documentation test tutorial, you have to execute the following steps:正如官方文档测试教程中提到的,您必须执行以下步骤:
..network.sh up
..network.sh up
..network.sh createChannel
..network.sh createChannel
..network.sh deployCC
..network.sh deployCC
However, you indicate that you execute the following command: ..network up createChannel
The script only accepts a parameter, so, it would be executed wrongly.但是,您表示执行以下命令:
..network up createChannel
该脚本只接受一个参数,因此会执行错误。 Before trying it again, you should remove you docker containers and docker volumes.在再次尝试之前,您应该删除 docker 个容器和 docker 个卷。
--Edited to add more info --编辑以添加更多信息
It should be because you have generated many times the crypto material and, you have many private keys.应该是因为你生成了很多次密码材料,而且你有很多私钥。 The public keys have been replaced but, new private keys were added.
公钥已被替换,但添加了新的私钥。 So, probably the Blockchain is using the incorrect private key.
因此,区块链可能使用了不正确的私钥。 Could you remove the organizations generated with the cryptogen and generate again the crypto material?
你能删除用密码原生成的组织并重新生成密码材料吗?
I encountered a similar problem.我遇到了类似的问题。 As you can see
..network up createChannel
and ..network deployCC
These scripts ran successfully, although they still used your peer certificates.如您所见,
..network up createChannel
和..network deployCC
这些脚本成功运行,尽管它们仍然使用您的对等证书。 What I found was, that there must be a mismatch in the certificates that were generated by cryptogen
tool vs 'fabric-ca'.我发现,
cryptogen
工具生成的证书与“fabric-ca”生成的证书一定不匹配。
Since you are using Fabric v2.2.x, first bring the.network down by running: 'sudo..network.sh down' in your directory由于您使用的是 Fabric v2.2.x,因此首先通过在您的目录中运行以下命令来关闭 .network:'sudo..network.sh down'
After that run: sudo..network.sh up -ca
.之后运行:
sudo..network.sh up -ca
。 Here -ca
will setup the.network with 'fabric-ca' client.这里
-ca
将使用“fabric-ca”客户端设置 the.network。
Now deploy the chaincode: sudo..network.sh deployCC -ccn basic -ccp../asset-transfer-basic/chaincode-javascript -ccl javascript
现在部署链代码:
sudo..network.sh deployCC -ccn basic -ccp../asset-transfer-basic/chaincode-javascript -ccl javascript
After deploying the chain-code you have invoke it.部署链代码后,您可以调用它。 For invocation, we need access the msp certificates.
对于调用,我们需要访问 msp 证书。 The
fabric-ca
will not allow you to access /organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
. fabric-ca
不允许您访问/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
。 So you have to use your CLI as super mode: Run: sudo -s
所以你必须使用你的 CLI 作为超级模式:运行:
sudo -s
Now let us set the environmental variables: export PATH=${PWD}/../bin:$PATH
export FABRIC_CFG_PATH=$PWD/../config/
Environment variables for Org1现在让我们设置环境变量:
export PATH=${PWD}/../bin:$PATH
export FABRIC_CFG_PATH=$PWD/../config/
Org1 的环境变量
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_ADDRESS=localhost:7051
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_ADDRESS=localhost:7051
Now run this command: peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"InitLedger","Args":[]}'
现在运行此命令:
peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"InitLedger","Args":[]}'
If successful, you should see similar output: -> INFO 001 Chaincode invoke successful. result: status:200
如果成功,您应该看到类似 output:
-> INFO 001 Chaincode invoke successful. result: status:200
-> INFO 001 Chaincode invoke successful. result: status:200
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.