簡體   English   中英

Hyperledger-Fabric Node SDK-曲線屬性錯誤

[英]Hyperledger - Fabric Node SDK - Curve property error

將節點項目部署到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中使用最新版本的“ fabric-ca-client”和“ fabric-client”作為節點模塊(基本上,它應與您嘗試連接的Fabric版本匹配)。
  2. 使用示例應用程序(fabcar)隨附的最新版本的invoke.js / query.js(新版本中存在一些細微差異)。

注意:就我而言,出現此問題是因為我使用的是客戶端代碼的1.3版本,而我的超級賬本結構為1.4版本

這是由於fabric-client-kv- *文件夾中的證書無效/過期。

解:

  1. 刪除或備份fabric-client-kv- *文件夾的內容。
  2. 再次注冊管理員用戶。
  3. 立即注冊普通用戶。

如果找不到證書文件夾,請在程序中查找以下行,

var store_path = path.join(__dirname, 'hfc-key-store');

要么

  credentialStore:
    # [Optional]. Specific to FileKeyValueStore.js or similar implementations in other SDKs. Can be others
    # if using an alternative impl. For instance, CouchDBKeyValueStore.js would require an object
    # here for properties like url, db name, etc.
    path: "./fabric-client-kv-org1"

“ hfc-key-store”或“ fabric-client-kv-org1”是包含證書的文件夾。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM