Hyperledger Fabric:从文档修改示例应用程序时出错

时间:2018-08-18 06:28:39

标签: hyperledger-fabric hyperledger

我的"Write your First Application"东西效果很好。

因此,我复制了文件并重命名了内容以支持其他chaincode应用程序。

当我运行startFabric.sh node(由于我的源代码是javascript)时,我最终得到:

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

docker-compose -f docker-compose.yml down
Removing network net_basic
WARNING: Network net_basic not found.

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 couchdb
Creating orderer.example.com
Creating ca.example.com
Creating peer0.org1.example.com

# 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
2018-08-18 06:23:14.962 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-08-18 06:23:14.983 UTC [cli/common] readBlock -> INFO 002 Got status: &{NOT_FOUND}
2018-08-18 06:23:14.984 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-08-18 06:23:15.187 UTC [cli/common] readBlock -> INFO 004 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
2018-08-18 06:23:15.407 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-08-18 06:23:15.481 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
Creating cli
2018-08-18 06:23:16.314 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-08-18 06:23:16.314 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-08-18 06:23:16.316 UTC [container] WriteFolderToTarPackage -> INFO 003 rootDirectory = /opt/gopath/src/github.com/permissioned-jpgs/node
2018-08-18 06:23:16.353 UTC [chaincodeCmd] install -> INFO 004 Installed remotely response:<status:200 payload:"OK" >
2018-08-18 06:23:16.590 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-08-18 06:23:16.590 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: endorsement failure during invoke. chaincode result: <nil>

通知背书失败。有任何想法吗?我已经检查了所有我能想到的东西,但我完全陷入了困境。谢谢!

1 个答案:

答案 0 :(得分:0)

我的Docker无知正在显示。

我只需要通过执行以下操作来查看与之交互的对等节点的日志:sudo docker logs -f dev-peer0.org1.example.com-fabcar-1.0

这些日志告诉我,这是我在自定义链码时编写的Javascript的问题,而不是我以前认为的Fabric网络配置问题。