0

试用HyperLedger 教程中的入门指南。这是非常基本的。启动网络是第一步。即使是第一步也行不通。

查看脚本“startFabric.sh”。一切顺利,直到“链码实例化”。

2019-02-15 00:09:29.629 UTC [chaincodeCmd] checkChaincodeCmdParams -> 
INFO 001 Using default escc
2019-02-15 00:09:29.629 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg timeout expired while starting chaincode fabcar:1.0 for transaction

本教程对任何人有用吗?

脚本运行的完整日志。

$./startFabric.sh javascript

# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1

docker-compose -f docker-compose.yml down
Stopping cli                    ... done
Stopping peer0.org1.example.com ... done
Stopping orderer.example.com    ... done
Stopping couchdb                ... done
Stopping ca.example.com         ... done
Removing cli                    ... done
Removing peer0.org1.example.com ... done
Removing orderer.example.com    ... done
Removing couchdb                ... done
Removing ca.example.com         ... done
Removing network net_basic

docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb
Creating network "net_basic" with the default driver
Creating ca.example.com         ... done
Creating orderer.example.com ... done
Creating couchdb             ... done
Creating peer0.org1.example.com ... done

# wait for Hyperledger Fabric to start
# incase of errors when running later commands, issue export FABRIC_START_TIMEOUT=<larger number>
export FABRIC_START_TIMEOUT=10
#echo ${FABRIC_START_TIMEOUT}
sleep ${FABRIC_START_TIMEOUT}

# Create the channel
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
2019-02-15 00:09:27.149 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-02-15 00:09:27.186 UTC [cli/common] readBlock -> INFO 002 Received block: 0
# Join peer0.org1.example.com to the channel.
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel join -b mychannel.block
2019-02-15 00:09:27.455 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-02-15 00:09:27.606 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
Creating cli ... done
chaincode install
2019-02-15 00:09:29.307 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-02-15 00:09:29.307 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-02-15 00:09:29.354 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >
chaincode instantiation
2019-02-15 00:09:29.629 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-02-15 00:09:29.629 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg timeout expired while starting chaincode fabcar:1.0 for transaction

来自订购者的日志,

2019-02-15 23:33:44.195 UTC [orderer/common/broadcast] Handle -> WARN 010 Error reading from 172.30.0.6:59028: rpc error: code = Canceled desc = context canceled
2019-02-15 23:35:31.556 UTC [orderer/common/broadcast] Handle -> WARN 011 Error reading from 172.30.0.6:59034: rpc error: code = Canceled desc = context canceled
4

2 回答 2

2

你也可以显示容器的日志吗?我想你可以尝试设置FABRIC_START_TIMEOUT=50inside basic-network/start.sh。如果这不起作用,我们需要检查容器的日志。

于 2019-02-15T03:26:53.913 回答
1

停止网络,删除所有容器并重新启动网络。当我在 ubuntu 18.04 上遇到问题时,它对我有用。

$ docker stop $(docker ps -a -q)
$ docker ps -qa|xargs docker rm
$ ./startFabric.sh

它也适用于 Windows参考

于 2019-12-16T19:41:51.273 回答