gpt4 book ai didi

hyperledger-fabric - 订购者的 Hyperledger Fabric 对等连接错误

转载 作者:行者123 更新时间:2023-12-03 23:41:18 25 4
gpt4 key购买 nike

我正在尝试将对等点与本地计算机中的订购者连接起来。这是我到目前为止所做的。

我在启动 Fabric CA Server 后启动了 Orderer

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

然后我尝试使用此命令启动 fabric peer。

 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 Connected to 2017-12-26 18:22:47.613 IST [deliveryClient] connect -> ERRO 32f Failed obtaining connection: Could not connect to any of the endpoints: [orderer.example.com:7050] 2017-12-26 18:22:47.614 IST [deliveryClient] try -> WARN 330 Got error: Could not connect to any of the endpoints: [orderer.example.com:7050] ,at 8 attempt. Retrying in 2m8s

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

2017-12-26 18:24:55.617 IST [grpc] Printf -> DEBU 191 grpc: Server.Serve failed to complete security handshake from "192.168.2.103:56580": EOF

谁能告诉我这里做错了什么?

谢谢

最佳答案

我认为您遇到的问题是您正在尝试使用为 fabric-sample 生成的配置事务,它将订购服务端点编码为 orderer.example.com:7050 在运行本地计算机时无法访问此地址。因此,作为一个简单的解决方案,您可以扩展您的 /etc/hosts 文件并使 orderer.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工具来获取更新的配置事务 block 。

关于hyperledger-fabric - 订购者的 Hyperledger Fabric 对等连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47978986/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com