排序者客户端无法连接到本地主机:10050:无法创建新连接:连接
我正在学习 Hyperledger Fabric。我已将一个组织添加到我的申请渠道中。我已成功加入频道,并且正在尝试调用链代码。 我收到错误: 无法连接到 localhost:10050: 无法创建新连接:连接错误:desc =“传输:拨号时出错:拨打 tcp 127.0.0.1:10050:连接:连接被拒绝”
错误:获取广播客户端时出错:订购者客户端 运行chaincodeInvoke函数:
函数内容为:
# Create Car
peer chaincode invoke -o localhost:10050 \
--ordererTLSHostnameOverride orderer4.example.com \
--tls $CORE_PEER_TLS_ENABLED \
--cafile $ORDERER_CA \
-C $CHANNEL_NAME -n ${CC_NAME} \
--peerAddresses localhost:7051 \
--tlsRootCertFiles $PEER0_ORG1_CA \
--peerAddresses localhost:9051 --tlsRootCertFiles $PEER0_ORG2_CA \
-c '{"function": "createCar","Args":["Car-1111", "Audi", "R8", "Red", "Pavan"]}'
谢谢您的帮助
I am learning Hyperledger Fabric. I have added an org to my application channel. I successfully joined the channel and I am trying to invoke the chaincode.
I am receiving the error:
Error: error getting broadcast client: orderer client failed to connect to localhost:10050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:10050: connect: connection refused"
when I run chaincodeInvoke function:
The content of the function is:
# Create Car
peer chaincode invoke -o localhost:10050 \
--ordererTLSHostnameOverride orderer4.example.com \
--tls $CORE_PEER_TLS_ENABLED \
--cafile $ORDERER_CA \
-C $CHANNEL_NAME -n ${CC_NAME} \
--peerAddresses localhost:7051 \
--tlsRootCertFiles $PEER0_ORG1_CA \
--peerAddresses localhost:9051 --tlsRootCertFiles $PEER0_ORG2_CA \
-c '{"function": "createCar","Args":["Car-1111", "Audi", "R8", "Red", "Pavan"]}'
Thank you for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您的排序程序确实在端口 10050 上运行。执行 docker ps 来检查容器的端口号。如果您按照教程进行操作,我认为您正在运行 docker。
我还将假设您运行了这些命令来安装合约代码。
如果安装了合约代码,则 docker ps 命令中应该列出其他容器以表明它们存在。
根据我的经验,这种错误是由于配置错误造成的,即使用了 YAML 文件中定义的不正确的端口号。
Be sure that your orderer is really running on port 10050. Do a docker ps to check the port number for the container. I presume that you are running docker if you are following the tutorials.
I will also presume that you ran these commands to install the contract code
If the contract code was installed, there should be other containers listed in your docker ps command to show that they exist.
In my experience, this kind of error has been due to misconfiguration i.e. using an incorrect port number to that defined in the YAML file.