node.js - Error Running custom blockchain(hyperledger) application with security enabled -
i'm running blockchain application on local network setup using vagrant.
network (ca , vp ) running inside vagrant vm while application resides outside vagrant. when ran application security disabled, works fine. when tried security enabled, i'm getting following error:
himanshus-mbp:bcapplication himanshutyagi$ node app.js loading hardcoded peers loading hardcoded users [ibc-js] peer: vp0-dev_vp0...:5000 [ibc-js] no membership users found after filtering, assuming network w/o membership [ibc-js] found chaincode in local file system [ibc-js] scanning files [ '.ds_store', 'chaincode_finished.go', 'finished' ] [ibc-js] parsing file shim version [ibc-js] found shim version: github.com/hyperledger/fabric/core/chaincode/shim [ibc-js] parsing file invoke functions - chaincode_finished.go [ibc-js] found cc invoke function: init [ibc-js] found cc invoke function: delete_product [ibc-js] found cc invoke function: delete_offering [ibc-js] found cc invoke function: delete_contract [ibc-js] found cc invoke function: delete_client [ibc-js] found cc invoke function: write [ibc-js] found cc invoke function: init_product [ibc-js] found cc invoke function: init_offering [ibc-js] found cc invoke function: init_contract [ibc-js] found cc invoke function: init_client [ibc-js] found cc invoke function: set_user_type [ibc-js] parsing file query functions - chaincode_finished.go [ibc-js] found cc query function: read [ibc-js] found cc query function: read_product_index [ibc-js] found cc query function: read_offering_index [ibc-js] found cc query function: read_contract_index [ibc-js] found cc query function: read_client_index [ibc-js] load_chaincode() finished chaincode summary file indicates chaincode has been deployed ------------------------------------------ chain , running ------------------------------------------ getting offering list: [ibc-js] read - success: { jsonrpc: '2.0', error: { code: -32602, message: 'invalid params', data: 'must supply username chaincode when security enabled.' }, id: 1469460324754 } read _offeringindex: null { name: 'query() resp error', code: 400, details: { code: -32602, message: 'invalid params', data: 'must supply username chaincode when security enabled.' } } /users/himanshutyagi/desktop/workspace/node_modules/async/lib/async.js:106 if (!arr.length) { ^ typeerror: cannot read property 'length' of null @ object.async.each (/users/himanshutyagi/desktop/workspace/node_modules/async/lib/async.js:106:17) @ /users/himanshutyagi/desktop/workspace/bcapplication/bcapplication/app.js:379:10 @ object.options.success (/users/himanshutyagi/desktop/workspace/bcapplication/bcapplication/node_modules/ibm-blockchain-js/index.js:1020:22) @ success (/users/himanshutyagi/desktop/workspace/bcapplication/bcapplication/node_modules/ibm-blockchain-js/lib/rest.js:109:30) @ incomingmessage.<anonymous> (/users/himanshutyagi/desktop/workspace/bcapplication/bcapplication/node_modules/ibm-blockchain-js/lib/rest.js:192:7) @ emitnone (events.js:72:20) @ incomingmessage.emit (events.js:166:7) @ endreadablent (_stream_readable.js:921:12) @ nexttickcallbackwith2args (node.js:442:9) @ process._tickcallback (node.js:356:17)
what weird in logs, says no membership users found after filtering
re deployed chaincode same enrollid , enrollpw
i've mentioned in app.js
blockchain js configuration. following details:
var options = { network:{ /* peers: peers, users: users, options: {quiet: true, tls:false, maxretry: 1}*/ 'peers': [ { 'discovery_host': 'localhost', 'discovery_port': 30303, 'api_host': 'localhost', 'api_port_tls': 443, 'api_port': 5000, 'type': 'peer', 'network_id': 'dev', 'id': 'dev_vp0', 'api_url': 'http://localhost:5000' } ], "users": [ { "username": "tyagi_user_type1", "secret": "1ccf8703ac", "enrollid": "tyagi_type1", "enrollsecret": "1ccf8703ac" } ], options: {quiet: true, tls:false, maxretry: 1} }, ... };
what "must supply username chaincode" mean. has faced similar issue while running security enabled on local network ?
update: so, changed enrillid user_type1_xxx
, "no membership users found.." message doesn't come anymore. i'm getting connection refused error when user trying register.
himanshus-mbp:bcapplication himanshutyagi$ node app.js loading hardcoded peers loading hardcoded users [ibc-js] peer: vp0-dev_vp0...:443 [ibc-js] registering vp0-dev_vp0...:443 w/enrollid - user_type1_tyagi [ibc-js] register - failure x1 : user_type1_tyagi 500 [ibc-js] going try register again in 30 secs query product table executed query offering table executed query contract table executed query product table executed [ibc-js] registering vp0-dev_vp0...:443 w/enrollid - user_type1_tyagi [ibc-js] register - failure x2 : user_type1_tyagi 500 [ibc-js] going try register again in 30 secs query product table executed query offering table executed query contract table executed query product table executed [ibc-js] registering vp0-dev_vp0...:443 w/enrollid - user_type1_tyagi [ibc-js] register - failure x3 : user_type1_tyagi 500 [ibc-js] going try register again in 30 secs query product table executed query offering table executed query contract table executed query product table executed query product table executed query offering table executed query contract table executed query product table executed [ibc-js] registering vp0-dev_vp0...:443 w/enrollid - user_type1_tyagi [ibc-js] register - failure x4 : user_type1_tyagi 500 ! looks error loading chaincode or network, app fail { name: 'register() error', code: 500, details: { [error: connect econnrefused 127.0.0.1:443] code: 'econnrefused', errno: 'econnrefused', syscall: 'connect', address: '127.0.0.1', port: 443 } }
Comments
Post a Comment