[英]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 errorhyperledger-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.