我在 CentOS 7 上,安装了所有先决条件,克隆了 fabric-samples git 存储库。

我指的是教程“构建您的第一个网络”,可在此处找到。 至此我已经成功运行了命令

./byfn.sh generate

现在我想执行 Java 链码,所以我运行

./byfn.sh up -l java

在 START 标志之后,我看到以下输出:

Build your first network (BYFN) end-to-end test

+ 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
Channel name : mychannel
Creating channel...
+ res=0
+ set +x
2020-02-21 09:14:36.439 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:36.463 UTC [cli.common] readBlock -> INFO 002 Expect block, but got status: &{NOT_FOUND}
2020-02-21 09:14:36.466 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-02-21 09:14:36.667 UTC [cli.common] readBlock -> INFO 004 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:36.670 UTC [channelCmd] InitCmdFactory -> INFO 005 Endorser and orderer connections initialized
2020-02-21 09:14:36.871 UTC [cli.common] readBlock -> INFO 006 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:36.876 UTC [channelCmd] InitCmdFactory -> INFO 007 Endorser and orderer connections initialized
2020-02-21 09:14:37.077 UTC [cli.common] readBlock -> INFO 008 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.081 UTC [channelCmd] InitCmdFactory -> INFO 009 Endorser and orderer connections initialized
2020-02-21 09:14:37.281 UTC [cli.common] readBlock -> INFO 00a Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.284 UTC [channelCmd] InitCmdFactory -> INFO 00b Endorser and orderer connections initialized
2020-02-21 09:14:37.486 UTC [cli.common] readBlock -> INFO 00c Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.489 UTC [channelCmd] InitCmdFactory -> INFO 00d Endorser and orderer connections initialized
2020-02-21 09:14:37.692 UTC [cli.common] readBlock -> INFO 00e Received block: 0
===================== Channel 'mychannel' created =====================

但是在链码安装部分之前,测试仍然没有问题。

===================== Chaincode is packaged on peer0.org1 =====================

Installing chaincode on peer0.org1...
+ peer lifecycle chaincode install mycc.tar.gz
+ res=1
+ set +x
Error: failed to endorse chaincode install: rpc error: code = Unavailable desc = transport is closing
!!!!!!!!!!!!!!! Chaincode installation on peer0.org1 has failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

在以该错误消息结束之前,测试在“ Installing chaincode on peer0.org1...行中停滞了很长一段时间。


以下是完整输出:

Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] Y
proceeding ...
LOCAL_VERSION=2.0.0
DOCKER_IMAGE_VERSION=2.0.0
/root/hyperledger/fabric/bin/cryptogen

##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
+ cryptogen generate --config=./crypto-config.yaml
org1.example.com
org2.example.com
+ res=0
+ set +x

Generate CCP files for Org1 and Org2
/root/hyperledger/fabric/bin/configtxgen
##########################################################
#########  Generating Orderer Genesis block ##############
##########################################################
2020-02-21 17:14:15.274 +08 [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-02-21 17:14:15.309 +08 [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: etcdraft
2020-02-21 17:14:15.310 +08 [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216
2020-02-21 17:14:15.310 +08 [common.tools.configtxgen.localconfig] Load -> INFO 004 Loaded configuration: /root/hyperledger/fabric/fabric-samples/first-network/configtx.yaml
2020-02-21 17:14:15.312 +08 [common.tools.configtxgen] doOutputBlock -> INFO 005 Generating genesis block
2020-02-21 17:14:15.312 +08 [common.tools.configtxgen] doOutputBlock -> INFO 006 Writing genesis block

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
2020-02-21 17:14:15.347 +08 [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-02-21 17:14:15.390 +08 [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /root/hyperledger/fabric/fabric-samples/first-network/configtx.yaml
2020-02-21 17:14:15.391 +08 [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 003 Generating new channel configtx
2020-02-21 17:14:15.393 +08 [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 004 Writing new channel tx
+ res=0
+ set +x

#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
2020-02-21 17:14:15.434 +08 [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-02-21 17:14:15.477 +08 [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /root/hyperledger/fabric/fabric-samples/first-network/configtx.yaml
2020-02-21 17:14:15.477 +08 [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
2020-02-21 17:14:15.479 +08 [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
+ res=0
+ set +x

#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP
2020-02-21 17:14:15.525 +08 [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-02-21 17:14:15.576 +08 [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /root/hyperledger/fabric/fabric-samples/first-network/configtx.yaml
2020-02-21 17:14:15.576 +08 [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
2020-02-21 17:14:15.578 +08 [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
+ res=0
+ set +x

Creating network "net_byfn" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_peer1.org1.example.com" with default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating volume "net_peer1.org2.example.com" with default driver
Creating volume "net_orderer2.example.com" with default driver
Creating volume "net_orderer3.example.com" with default driver
Creating volume "net_orderer4.example.com" with default driver
Creating orderer.example.com ... done
Creating cli ... done
Creating orderer4.example.com ...
Creating peer1.org2.example.com ...
Creating orderer3.example.com ...
Creating orderer5.example.com ...
Creating peer0.org2.example.com ...
Creating peer0.org1.example.com ...
Creating orderer.example.com ...
Creating orderer2.example.com ...
Creating cli ...
CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS                      PORTS                                NAMES
a25f3414f14e        hyperledger/fabric-tools:latest     "/bin/bash"              1 second ago        Up Less than a second                                            cli
85e4e7490b95        hyperledger/fabric-orderer:latest   "orderer"                4 seconds ago       Up Less than a second       7050/tcp, 0.0.0.0:8050->8050/tcp     orderer2.example.com
6f393ad561dc        hyperledger/fabric-peer:latest      "peer node start"        4 seconds ago       Up Less than a second       0.0.0.0:7051->7051/tcp               peer0.org1.example.com
6cfd44256f6d        hyperledger/fabric-orderer:latest   "orderer"                4 seconds ago       Up Less than a second       0.0.0.0:7050->7050/tcp               orderer.example.com
691f224ac19a        hyperledger/fabric-orderer:latest   "orderer"                5 seconds ago       Up 1 second                 7050/tcp, 0.0.0.0:11050->11050/tcp   orderer5.example.com
930177cb2965        hyperledger/fabric-peer:latest      "peer node start"        5 seconds ago       Up 1 second                 7051/tcp, 0.0.0.0:9051->9051/tcp     peer0.org2.example.com
cc4fc902a8f0        hyperledger/fabric-peer:latest      "peer node start"        5 seconds ago       Up 1 second                 7051/tcp, 0.0.0.0:10051->10051/tcp   peer1.org2.example.com
b192db94069c        hyperledger/fabric-orderer:latest   "orderer"                5 seconds ago       Up 1 second                 7050/tcp, 0.0.0.0:10050->10050/tcp   orderer4.example.com
6db78ac784c8        hyperledger/fabric-orderer:latest   "orderer"                5 seconds ago       Up 2 seconds                7050/tcp, 0.0.0.0:9050->9050/tcp     orderer3.example.com
1bea7b96c621        hyperledger/fabric-peer:latest      "peer node start"        5 seconds ago       Up 1 second                 7051/tcp, 0.0.0.0:8051->8051/tcp     peer1.org1.example.com
d23e83c3cde5        hyperledger/fabric-javaenv:2.0      "/bin/sh -c ./build.…"   17 minutes ago      Exited (0) 15 minutes ago                                        goofy_goldstine
Sleeping 15s to allow Raft cluster to complete booting
Vendoring Go dependencies ...
~/hyperledger/fabric/fabric-samples/chaincode/abstore/go ~/hyperledger/fabric/fabric-samples/first-network
./byfn.sh: line 180: go: command not found
~/hyperledger/fabric/fabric-samples/first-network
Finished vendoring Go dependencies

 ____    _____      _      ____    _____
/ ___|  |_   _|    / \    |  _ \  |_   _|
\___ \    | |     / _ \   | |_) |   | |
 ___) |   | |    / ___ \  |  _ <    | |
|____/    |_|   /_/   \_\ |_| \_\   |_|

Build your first network (BYFN) end-to-end test

+ 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
Channel name : mychannel
Creating channel...
+ res=0
+ set +x
2020-02-21 09:14:36.439 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:36.463 UTC [cli.common] readBlock -> INFO 002 Expect block, but got status: &{NOT_FOUND}
2020-02-21 09:14:36.466 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-02-21 09:14:36.667 UTC [cli.common] readBlock -> INFO 004 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:36.670 UTC [channelCmd] InitCmdFactory -> INFO 005 Endorser and orderer connections initialized
2020-02-21 09:14:36.871 UTC [cli.common] readBlock -> INFO 006 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:36.876 UTC [channelCmd] InitCmdFactory -> INFO 007 Endorser and orderer connections initialized
2020-02-21 09:14:37.077 UTC [cli.common] readBlock -> INFO 008 Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.081 UTC [channelCmd] InitCmdFactory -> INFO 009 Endorser and orderer connections initialized
2020-02-21 09:14:37.281 UTC [cli.common] readBlock -> INFO 00a Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.284 UTC [channelCmd] InitCmdFactory -> INFO 00b Endorser and orderer connections initialized
2020-02-21 09:14:37.486 UTC [cli.common] readBlock -> INFO 00c Expect block, but got status: &{SERVICE_UNAVAILABLE}
2020-02-21 09:14:37.489 UTC [channelCmd] InitCmdFactory -> INFO 00d Endorser and orderer connections initialized
2020-02-21 09:14:37.692 UTC [cli.common] readBlock -> INFO 00e Received block: 0
===================== Channel 'mychannel' created =====================

Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2020-02-21 09:14:37.763 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:37.783 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org1 joined channel 'mychannel' =====================

+ peer channel join -b mychannel.block
+ res=0
+ set +x
2020-02-21 09:14:40.850 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:40.869 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org1 joined channel 'mychannel' =====================

+ peer channel join -b mychannel.block
+ res=0
+ set +x
2020-02-21 09:14:43.934 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:43.954 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org2 joined channel 'mychannel' =====================

+ peer channel join -b mychannel.block
+ res=0
+ set +x
2020-02-21 09:14:47.020 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:47.040 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org2 joined channel 'mychannel' =====================

Updating anchor peers for org1...
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org1MSPanchors.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=0
+ set +x
2020-02-21 09:14:50.102 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:50.119 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org1MSP' on channel 'mychannel' =====================

Updating anchor peers for org2...
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org2MSPanchors.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=0
+ set +x
2020-02-21 09:14:53.190 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-02-21 09:14:53.207 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org2MSP' on channel 'mychannel' =====================

+ peer lifecycle chaincode package mycc.tar.gz --path /opt/gopath/src/github.com/hyperledger/fabric-samples/chaincode/abstore/java/ --lang java --label mycc_1
+ res=0
+ set +x
===================== Chaincode is packaged on peer0.org1 =====================

Installing chaincode on peer0.org1...
+ peer lifecycle chaincode install mycc.tar.gz
+ res=1
+ set +x
Error: failed to endorse chaincode install: rpc error: code = Unavailable desc = transport is closing
!!!!!!!!!!!!!!! Chaincode installation on peer0.org1 has failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

ERROR !!!! Test failed

编辑 24/02/2020:我删除了脚本,杀死了所有活动的容器并修剪了它们,然后重新运行了脚本。

CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                                NAMES
6182b99f3483        hyperledger/fabric-javaenv:2.0      "/bin/sh -c ./build.…"   4 minutes ago       Up 4 minutes                                             suspicious_galileo
158e8bbd501b        hyperledger/fabric-tools:latest     "/bin/bash"              5 minutes ago       Up 5 minutes                                             cli
1d4f0e232e58        hyperledger/fabric-peer:latest      "peer node start"        5 minutes ago       Up 5 minutes        0.0.0.0:7051->7051/tcp               peer0.org1.example.com
90ba9fb67fae        hyperledger/fabric-orderer:latest   "orderer"                5 minutes ago       Up 5 minutes        7050/tcp, 0.0.0.0:11050->11050/tcp   orderer5.example.com
e4f730446f05        hyperledger/fabric-orderer:latest   "orderer"                5 minutes ago       Up 5 minutes        0.0.0.0:7050->7050/tcp               orderer.example.com
a9c126e1e280        hyperledger/fabric-orderer:latest   "orderer"                5 minutes ago       Up 5 minutes        7050/tcp, 0.0.0.0:8050->8050/tcp     orderer2.example.com
c53240f4d9fe        hyperledger/fabric-peer:latest      "peer node start"        5 minutes ago       Up 5 minutes        7051/tcp, 0.0.0.0:9051->9051/tcp     peer0.org2.example.com
7c96596eda01        hyperledger/fabric-peer:latest      "peer node start"        5 minutes ago       Up 5 minutes        7051/tcp, 0.0.0.0:10051->10051/tcp   peer1.org2.example.com
4fabd60e9af4        hyperledger/fabric-peer:latest      "peer node start"        5 minutes ago       Up 5 minutes        7051/tcp, 0.0.0.0:8051->8051/tcp     peer1.org1.example.com
c5ffe6032bdd        hyperledger/fabric-orderer:latest   "orderer"                5 minutes ago       Up 5 minutes        7050/tcp, 0.0.0.0:10050->10050/tcp   orderer4.example.com
04ec9beedce6        hyperledger/fabric-orderer:latest   "orderer"                5 minutes ago       Up 5 minutes        7050/tcp, 0.0.0.0:9050->9050/tcp     orderer3.example.com

Java 容器运行正常,但错误仍然存​​在。

  ask by user10931326 translate from so

本文未有回复,本站智能推荐:

1回复

运行 byfn 时出错:由于 gradle 问题,链码安装失败?

这是我在此处找到的问题的延续。 错误的性质似乎发生了变化,因此我提出了一个新问题。 一个好心人指出我之前运行的Java版本不匹配,所以我运行了docker container ls -a : 为了开始清理,这就是我所做的: ./byfn.sh down docker containe
1回复

无法调用链码

我在调用过程中遇到了问题。 1.) 我运行以下命令: peer lifecycle chaincode querycommitted \ --channelID mychannel \ --name basic \ --cafile ${PWD}/organization
2回复

在通道上实例化节点链码时出错

我正在尝试在通道上实例化已安装的节点链代码,但失败并显示错误: failed to invoke chaincode name:"lscc" , error: container exited with 0 到目前为止我做了什么: 使用./byfn up -c some-channel -s
1回复

在 Hyperledger Fabric 网络中的多个组织中安装链代码时出错。 找不到配置文件

我一直在向我的超级账本结构网络添加几个组织。 我正在使用具有以下 CLI 配置的结构 1.4.1: 所有的 Orgs peers、orderes 和 couchDBs 都已经启动,但是当我想在 cli-org1 中安装链码时: 我收到以下错误: ERRO 001 Fatal error w
1回复

Hyperledger Fabric 2.1 链码安装

我正在尝试使用最新的链码生命周期在我的同级中安装节点链码。 但是当我尝试安装链码时出现以下错误 错误:
1回复

实例化fabric-samples的java链码时出错

我在结构 1.4.3 上实例化 java 链码时遇到问题,我没有更改任何内容,甚至没有更改组织或频道的名称。 以下是我遵循的步骤: 使用命令curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts
2回复

调用链码时出错:签名集不符合策略

我在Hyperledger Fabric 1.4中建立了一点网络,这与示例中的基本网络非常相似。 它具有: 一个订购者组织和一个订购者同行一个医院组织和两个同行。 医院同伴所在的单一渠道。 我试图编写一个非常简单的演示智能合约/链码并调用它。 (智能合约称为bananascc)
1回复

链码在运行时的行为

目前正在学习使用 GO 进行链码开发(最近与以太坊合作)。 我有以下代码: 在 init 函数期间,我将链码的初始化传递给一个人。 我的问题是:在另一个针对链码的调用中。 p 实例是否仍会从 init 函数中保留,以便我可以读取在 init 期间给出的 p.name? 链码如何管理这个?