javascript - Hyperledger - Fabric Node SDK - 曲线属性错误

标签 javascript node.js heroku hyperledger

我在将 Node 项目部署到 Heroku 时遇到问题。

收到来自 fabri-client 的依赖项的常量错误包裹。

错误是:"Cannot read property 'curve' of undefined" .我不清楚为什么。

所有生成的文件都已经过验证(证书文件、pem 和所有配置文件)。它在生产和本地完全相等。

似乎是关于无法读取某些文件或属性的错误。我已经看了很多,但一无所获。

2018-10-08T13:13:24.139587+00:00 app[web.1]: [31merror[39m: [Client.js]: Failed to load user "admin" from local key value store. Error: TypeError: Cannot read property 'curve' of undefined 2018-10-08T13:13:24.139597+00:00 app[web.1]: at Object.KEYUTIL.getKey (/app/node_modules/fabric-client/node_modules/jsrsasign/lib/jsrsasign.js:247:10378) 2018-10-08T13:13:24.139599+00:00 app[web.1]: at CryptoSuite_ECDSA_AES.getKey (/app/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:204:27) 2018-10-08T13:13:24.139602+00:00 app[web.1]: at <anonymous> 2018-10-08T13:13:24.139737+00:00 app[web.1]: [31merror[39m: [Client.js]: Failed to load an instance of requested user "admin" from the state store on this Client instance. Error: TypeError: Cannot read property 'curve' of undefined 2018-10-08T13:13:24.139740+00:00 app[web.1]: at Object.KEYUTIL.getKey (/app/node_modules/fabric-client/node_modules/jsrsasign/lib/jsrsasign.js:247:10378) 2018-10-08T13:13:24.139742+00:00 app[web.1]: at CryptoSuite_ECDSA_AES.getKey (/app/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:204:27) 2018-10-08T13:13:24.139743+00:00 app[web.1]: at <anonymous> 2018-10-08T13:13:24.140035+00:00 app[web.1]: ERRO: TypeError: Cannot read property 'curve' of undefined 2018-10-08T13:13:24.140037+00:00 app[web.1]: at Object.KEYUTIL.getKey (/app/node_modules/fabric-client/node_modules/jsrsasign/lib/jsrsasign.js:247:10378) 2018-10-08T13:13:24.140039+00:00 app[web.1]: at CryptoSuite_ECDSA_AES.getKey (/app/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:204:27) 2018-10-08T13:13:24.140041+00:00 app[web.1]: at <anonymous> 2018-10-08T13:13:30.471688+00:00 heroku[router]: at=info method=POST path="/add_id" host=damp-lowlands-60646.herokuapp.com request_id=a13c1b5d-31f0-4e24-aabb-8733b102cf18 fwd="201.48.168.28" dyno=web.1 connect=1ms service=53ms status=500 bytes=322 protocol=https 2018-10-08T13:13:30.463089+00:00 app[web.1]: [31merror[39m: [Client.js]: Failed to load user "admin" from local key value store. Error: TypeError: Cannot read property 'curve' of undefined 2018-10-08T13:13:30.463101+00:00 app[web.1]: at Object.KEYUTIL.getKey (/app/node_modules/fabric-client/node_modules/jsrsasign/lib/jsrsasign.js:247:10378) 2018-10-08T13:13:30.463103+00:00 app[web.1]: at CryptoSuite_ECDSA_AES.getKey (/app/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:204:27) 2018-10-08T13:13:30.463105+00:00 app[web.1]: at <anonymous> 2018-10-08T13:13:30.466974+00:00 app[web.1]: [31merror[39m: [Client.js]: Failed to load an instance of requested user "admin" from the state store on this Client instance. Error: TypeError: Cannot read property 'curve' of undefined 2018-10-08T13:13:30.466978+00:00 app[web.1]: at Object.KEYUTIL.getKey (/app/node_modules/fabric-client/node_modules/jsrsasign/lib/jsrsasign.js:247:10378) 2018-10-08T13:13:30.466980+00:00 app[web.1]: at CryptoSuite_ECDSA_AES.getKey (/app/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:204:27) 2018-10-08T13:13:30.466982+00:00 app[web.1]: at <anonymous> 2018-10-08T13:13:30.468452+00:00 app[web.1]: Failed to invoke successfully :: TypeError: Cannot read property 'curve' of undefined

谢谢!

最佳答案

我有同样的问题,对我有用的是以下内容

  1. 确保您在 package.json 中为 Node 模块使用最新版本的“fabric-ca-client”和“fabric-client”(基本上它应该与您尝试连接的结构版本相匹配) .
  2. 使用与示例应用程序 (fabcar) 一起提供的最新版本的 invoke.js/query.js(较新版本中存在一些细微差异)。

注意:在我的例子中,问题出现是因为我使用的是 1.3 版本的客户端代码,而我的 hyperledger fabric 是 1.4 版本

关于javascript - Hyperledger - Fabric Node SDK - 曲线属性错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52703269/

相关文章:

javascript - 有没有一种在 JQuery 中切换选项卡的方法?

node.js - 如何使用 Node.js 完成/终止 Mocha/Istanbul 测试周期

javascript - 如何将包含特定字符串的url添加到数组中?

node.js - 推送到 Heroku 错误 : contextify@0. 1.14 安装

ruby-on-rails - Rails 乘客 Glyphicon CORS Cloudfront NGINX 问题

javascript - 为数组中的每个对象调用内部方法

javascript - 在用户时间线上发布操作时出现问题

javascript - 隐藏滚动条并使用 CSS 向左向右滑动

node.js - 如何使用 Node js 更改文件中的特定行?

node.js - 解析错误: Expected another key-value pair