Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/installation/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hyperledger fabric 与订购方的Hyperledger结构对等连接错误_Hyperledger Fabric_Hyperledger_Grpc - Fatal编程技术网

Hyperledger fabric 与订购方的Hyperledger结构对等连接错误

Hyperledger fabric 与订购方的Hyperledger结构对等连接错误,hyperledger-fabric,hyperledger,grpc,Hyperledger Fabric,Hyperledger,Grpc,我正在尝试将对等方与本地计算机中的订购方连接。 以下是我迄今为止所做的工作 我在启动Fabric CA服务器后启动了Order export ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp export ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block export ORDERER_GENERAL_LOCALMSPID=Ordere

我正在尝试将对等方与本地计算机中的订购方连接。 以下是我迄今为止所做的工作

我在启动Fabric CA服务器后启动了Order

export ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
export ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
export ORDERER_GENERAL_LOCALMSPID=OrdererMSP
export ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
export ORDERER_GENERAL_LISTENADDRESS=192.168.2.103
export ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
export ORDERER_GENERAL_LOGLEVEL=debug
export ORDERER_GENERAL_GENESISMETHOD=file
export ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
export FABRIC_CFG_PATH=/etc/hyperledger/fabric
export ORDERER_GENERAL_TLS_ENABLED=true
orderer
然后,我尝试使用此命令启动结构对等机

 export CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
 export CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
 export CORE_PEER_GOSSIP_ORGLEADER=false
 export CORE_PEER_PROFILE_ENABLED=true
 export CORE_PEER_LOCALMSPID=Org1MSP
 export CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
 export CORE_PEER_TLS_ENABLED=true
 export CORE_PEER_ID=peer0.org1.example.com
 export CORE_LOGGING_LEVEL=DEBUG
 export CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
 export FABRIC_CFG_PATH=/etc/hyperledger/fabric
 export CORE_PEER_ADDRESS=peer0.org1.example.com:7051
 export CORE_PEER_GOSSIP_USELEADERELECTION=true
在运行命令
peer node start
这个命令给了我一个错误

2017-12-26 18:22:47.613 IST[deliveryClient]connect->DEBU 32e 已连接到2017-12-26 18:22:47.613 IST[deliveryClient]连接-> ERRO 32f获取连接失败:无法连接到任何 端点:[order.example.com:7050]2017-12-26 18:22:47.614 [deliveryClient]尝试->警告:出现错误:无法连接到任何 端点的[order.example.com:7050],尝试8次。重试 在2m8s内

在订购方方面,我得到了这个

2017-12-26 18:24:55.617 IST[grpc]Printf->DEBU 191 grpc:Server.Serve未能完成来自“192.168.2.103:56580”的安全握手:EOF

谁能告诉我我做错了什么


无论何时,只要我知道证书不正确,都要感谢。上次我花了半天的时间才发现我已经将peer1.org1证书复制到了订购者的peer1.org2文件夹中。(对我来说,org2是一个不同的CA服务器)。曾经,我在用于创建通道块的configtx.yaml中有1个错误的MSPDir路径

我认为您案例中的问题是,您试图使用为
结构示例
生成的配置事务,该事务将订购服务端点编码为
order.example.com:7050
,而在运行本地计算机时,无法访问此地址。因此,作为一个简单的解决方案,您可以扩展您的
/etc/hosts
文件,并使
order.example.com
域名指向您的本地主机。第二个选项是更改配置事务中的订购服务端点,例如
configtx.yaml

################################################################################
#
#   SECTION: Orderer
#
#   - This section defines the values to encode into a config transaction or
#   genesis block for orderer related parameters
#
################################################################################
Orderer: &OrdererDefaults

    # Orderer Type: The orderer implementation to start
    # Available types are "solo" and "kafka"
    OrdererType: solo

    Addresses:
        - localhost:7050

    # Batch Timeout: The amount of time to wait before creating a batch
    BatchTimeout: 2s

    # Batch Size: Controls the number of messages batched into a block
    BatchSize:

        # Max Message Count: The maximum number of messages to permit in a batch
        MaxMessageCount: 10

        # Absolute Max Bytes: The absolute maximum number of bytes allowed for
        # the serialized messages in a batch.
        AbsoluteMaxBytes: 98 MB

        # Preferred Max Bytes: The preferred maximum number of bytes allowed for
        # the serialized messages in a batch. A message larger than the preferred
        # max bytes will result in a batch larger than preferred max bytes.
        PreferredMaxBytes: 512 KB

    Kafka:
        # Brokers: A list of Kafka brokers to which the orderer connects
        # NOTE: Use IP:port notation
        Brokers:
            - 127.0.0.1:9092

    # Organizations is the list of orgs which are defined as participants on
    # the orderer side of the network
    Organizations:
基本上,您需要更改以下行:

    Addresses:
        - PUT_HERE_CORRECT_IP_ADDRESS:7050

接下来,您需要运行
configtxgen
工具以获取更新的配置事务块。

您是否正在运行您的env。在docker内部?没有。我正在本地机器上运行我非常感谢您的回答,但是我已经更新了/etc/hosts,现在我在更新congs
主体反序列化失败(提供的标识无效,Verify()返回了x509:由未知机构签名的证书)后收到此错误(可能是因为在尝试验证候选机构证书“ca.org1.example.com”时“x509:ECDSA验证失败”)身份
您可以看一下吗?在您的配置中,您错过了MSP文件夹和所有对等加密材料的设置,例如,您需要
CORE\u peer\u MSPCONFIGPATH
指向正确的位置。