简体   繁体   English

如何修复[ERROR] Helper - 无法获得注册用户:Jim有错误:TypeError:client.loadFromConfig不是函数

[英]How to fix the [ERROR] Helper - Failed to get registered user: Jim with error: TypeError: client.loadFromConfig is not a function

to solve the bug when i running hyperledger fabrics , balance 当我运行hyperledger fabric时,解决bug,平衡
transfer by using the command in the bash script using the commands 使用命令在bash脚本中使用命令进行传输
./runApp.sh ./tesAPIs.sh ------------------------------------------------------------------------------ then getting the error: [2019-04-04 16:20:42.432] [ERROR] Helper - Failed to get registered user: Jim with error: TypeError: client.loadFromConfig is not a function [2019-04-04 16:20:42.432] [ERROR] Helper - Failed to get registered user: Jim with error: TypeError: client.loadFromConfig is not a function ---------------------------------------------------------------------------- tried with the hyperledger-fabric version 1.2.0 and ./runApp.sh ./tesAPIs.sh ---------------------------------------- --------------------------------------然后得到错误:[2019-04-04 16 :20:42.432] [错误]助手 - 无法获得注册用户:Jim有错误:TypeError:client.loadFromConfig不是函数[2019-04-04 16:20:42.432] [ERROR] Helper - 无法注册user:Jim有错误:TypeError:client.loadFromConfig不是函数----------------------------------- -----------------------------------------尝试使用hyperledger-fabric 1.2版。 0和
hyperledger-fabric version 1.4.0 , both times getting the same error hyperledger-fabric版本1.4.0,两次都得到相同的错误
when i am running ./runApp.sh ./tesAPIs.sh when i am running from hyperledger fabric from balance transfer. 我正在运行./runApp.sh ./tesAPIs.sh当我从超级转发结构运行平衡转移时。 [ERROR] Helper - Failed to get registered user: Jim with error: TypeError: client.loadFromConfig is not a function this error should be removed. [错误]帮助程序 - 无法获得注册用户:Jim有错误:TypeError:client.loadFromConfig不是一个函数,应该删除此错误。

I've managed to fix this bug. 我设法修复了这个bug。 The thing is that in file helper.js in app folder, on the line 44 await is missing. 问题是在app文件夹中的文件helper.js中,在第44行await缺失。

You can look at this line 你可以看看这一行

let client = hfc.loadFromConfig(hfc.getConfigSetting('network'+config));

And when you log client you will see that there is a promise. 当您登录client您将看到有一个承诺。 So you need just to add await before hfc.loadFromConfig and client will be a valid object with loadFromConfig function. 所以你只需要在hfc.loadFromConfig之前添加await ,client就是一个带有loadFromConfig函数的有效对象。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决“私钥存储失败?” Error01问题? - How can I fix “Failed Storing private key?” Error01 problem? 注册用户时无法获得从属关系的错误 - Error regarding Failed to get Affiliation when registering the user Hyperledger结构:无法将所有对等体加入通道。 cause:TypeError:client.getEventHubsForOrg不是函数 - Hyperledger fabric :Failed to join all peers to channel. cause:TypeError: client.getEventHubsForOrg is not a function Hyperledger:尝试登录并获取用户上下文时出错。 错误:尝试注册用户或加载频道配置时出错。 错误:注册失败 - Hyperledger: Error trying login and get user Context. Error: Error trying to enroll user or load channel configuration. Error: Enrollment failed 我该如何解决这个错误? DiscoveryService:基本错误:为链码构造描述符失败: - How can i fix this error? DiscoveryService: basic error: failed constructing descriptor for chaincodes:<name:"basic" 如何解决此错误? 错误:无法创建交付客户端:无法创建新连接:超出上下文截止时间 - How do I resolve this error? ERROR: failed to create deliver client: failed to create new connection: context deadline exceeded 错误:无法创建交付客户端:订购者客户端无法连接到订购者:无法创建新连接:超出上下文截止时间 - Error: failed to create deliver client: orderer client failed to connect to orderer: failed to create new connection: context deadline exceeded 背书客户端连接失败:连接被拒绝错误 - Endorser client failed to connect : connection refused Error 错误:背书客户端未能在教程中连接 - error: endorser client failed to connect in tutorial 如何使用Hyperledger Fabric区块链应用程序修复“错误:14无法使用:TCP写入失败” - How to fix “Error: 14 UNAVAILABLE: TCP Write failed” with hyperledger Fabric blockchain application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM