title: Error trying to invoke chaincode using Node.js SDK
body: <p>I am trying to implement Node.js SDK for my Hyperledger Fabric business network. My network has one organisation, four peers, one channel, solo ordered and one CA.</p>
  
  <p>I have successful managed to issue the JWT identity for user Jim and org1 organization.</p>
  
  <p>When I try to invoke the the chaincode using:</p>
  
  <pre><code>curl -s -X POST \
    http://localhost:4000/channels/c1/chaincodes/txman \
    -H "authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1MTAwODIyNzMsInVzZXJuYW1lIjoiSmltIiwib3JnTmFtZSI6Im9yZzEiLCJpYXQiOjE1MTAwNDYyNzN9.NTDYky6jj_y1COP163Z_HA6q4v7S1_jN6BxL00Bo-Xo" \
    -H "content-type: application/json" \
    -d '{
      "fcn":"queryTx",
      "args":["TX0"]
  }'
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>2017-11-07 11:18:34.286] [DEBUG] SampleWebApp - Decoded from JWT token: username - Jim, orgname - org1
  [2017-11-07 11:18:34.287] [DEBUG] SampleWebApp - ==================== INVOKE ON CHAINCODE ==================
  [2017-11-07 11:18:34.287] [DEBUG] SampleWebApp - USERNAME: Jim
  [2017-11-07 11:18:34.287] [DEBUG] SampleWebApp - ORGNAME: org1
  [2017-11-07 11:18:34.287] [DEBUG] SampleWebApp - channelName  : c1
  [2017-11-07 11:18:34.288] [DEBUG] SampleWebApp - chaincodeName : txman
  [2017-11-07 11:18:34.288] [DEBUG] SampleWebApp - fcn  : queryTx
  [2017-11-07 11:18:34.288] [DEBUG] SampleWebApp - args  : TX0
  [2017-11-07 11:18:34.292] [DEBUG] invoke-chaincode - 
  ============ invoke transaction on organization org1 ============
  
  [2017-11-07 11:18:34.292] [DEBUG] Helper - [FileKeyValueStore.js]: FileKeyValueStore.js - constructor
  [2017-11-07 11:18:34.293] [DEBUG] Helper - [FileKeyValueStore.js]: FileKeyValueStore -- getValue
  [2017-11-07 11:18:34.298] [DEBUG] Helper - [crypto_ecdsa_aes]: importKey - start
  [2017-11-07 11:18:34.298] [DEBUG] Helper - [crypto_ecdsa_aes]: importKey - have the key [Circular]
  [2017-11-07 11:18:34.300] [DEBUG] Helper - [utils.CryptoKeyStore]: _getKeyStore resolving store
  [2017-11-07 11:18:34.300] [DEBUG] Helper - [ecdsa/key.js]: ECDSA curve param X: c3cd1a318e957b0200852e4ed6c9601eadc8225eb9f79acc11b1c65df142446a
  [2017-11-07 11:18:34.300] [DEBUG] Helper - [ecdsa/key.js]: ECDSA curve param Y: f7bbe9fd43eaae1a0a1d2eb3024ecd79bd63c39a8d1b3b978bc8b4a652d0ef63
  [2017-11-07 11:18:34.301] [DEBUG] Helper - [FileKeyValueStore.js]: FileKeyValueStore -- setValue
  [2017-11-07 11:18:34.303] [DEBUG] Helper - [utils.CryptoKeyStore]: _getKeyStore resolving store
  [2017-11-07 11:18:34.303] [DEBUG] Helper - [FileKeyValueStore.js]: FileKeyValueStore -- getValue
  [2017-11-07 11:18:34.304] [DEBUG] Helper - [ecdsa/key.js]: ECDSA curve param X: c3cd1a318e957b0200852e4ed6c9601eadc8225eb9f79acc11b1c65df142446a
  [2017-11-07 11:18:34.304] [DEBUG] Helper - [ecdsa/key.js]: ECDSA curve param Y: f7bbe9fd43eaae1a0a1d2eb3024ecd79bd63c39a8d1b3b978bc8b4a652d0ef63
  [2017-11-07 11:18:34.305] [DEBUG] Helper - [ecdsa/key.js]: ECDSA curve param X: c3cd1a318e957b0200852e4ed6c9601eadc8225eb9f79acc11b1c65df142446a
  [2017-11-07 11:18:34.306] [DEBUG] Helper - [ecdsa/key.js]: ECDSA curve param Y: f7bbe9fd43eaae1a0a1d2eb3024ecd79bd63c39a8d1b3b978bc8b4a652d0ef63
  [2017-11-07 11:18:34.308] [DEBUG] Helper - [ecdsa/key.js]: ECDSA curve param X: c3cd1a318e957b0200852e4ed6c9601eadc8225eb9f79acc11b1c65df142446a
  [2017-11-07 11:18:34.308] [DEBUG] Helper - [ecdsa/key.js]: ECDSA curve param Y: f7bbe9fd43eaae1a0a1d2eb3024ecd79bd63c39a8d1b3b978bc8b4a652d0ef63
  [2017-11-07 11:18:34.309] [DEBUG] Helper - [FileKeyValueStore.js]: FileKeyValueStore -- setValue
  [2017-11-07 11:18:34.309] [INFO] Helper - Successfully loaded member from persistence
  [2017-11-07 11:18:34.313] [DEBUG] invoke-chaincode - Sending transaction "{"_nonce":{"type":"Buffer","data":[218,130,209,154,87,123,73,36,118,155,194,91,27,250,14,216,117,202,164,5,16,237,96,208]},"_transaction_id":"dba107be47745c51eb75b6a927d68f0afd58b325c5e36326b40a729f9d858f43"}"
  [2017-11-07 11:18:34.341] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature:  Signature {
    r: &lt;BN: cf5e0aaef0fd10d9abf468e025c6f6c1e8991d0dcddf5f5aa6b285ebdcd920ad&gt;,
    s: &lt;BN: 8de356dcfda3ba3fb0d6decfc0e43995b3297bc7037fd3997bfba561e6d626d&gt;,
    recoveryParam: 0 }
  error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")
      at /home/brankoterzic/Desktop/devGC/txman/node_modules/grpc/src/client.js:554:15
  error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")
      at /home/brankoterzic/Desktop/devGC/txman/node_modules/grpc/src/client.js:554:15
  error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")
      at /home/brankoterzic/Desktop/devGC/txman/node_modules/grpc/src/client.js:554:15
  error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")
      at /home/brankoterzic/Desktop/devGC/txman/node_modules/grpc/src/client.js:554:15
  error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")
      at /home/brankoterzic/Desktop/devGC/txman/node_modules/grpc/src/client.js:554:15
  [2017-11-07 11:18:34.400] [ERROR] invoke-chaincode - transaction proposal was bad
  [2017-11-07 11:18:34.401] [ERROR] invoke-chaincode - transaction proposal was bad
  [2017-11-07 11:18:34.401] [ERROR] invoke-chaincode - transaction proposal was bad
  [2017-11-07 11:18:34.401] [ERROR] invoke-chaincode - transaction proposal was bad
  [2017-11-07 11:18:34.401] [ERROR] invoke-chaincode - transaction proposal was bad
  [2017-11-07 11:18:34.401] [ERROR] invoke-chaincode - Failed to send Proposal or receive valid response. Response null or status is not 200. exiting...
  [2017-11-07 11:18:34.401] [ERROR] invoke-chaincode - Failed to order the transaction. Error code: undefined
  </code></pre>
  
  <p>I was following the balance-transfer Node.js example: <a href="https://github.com/hyperledger/fabric-samples/tree/release/balance-transfer" rel="nofollow noreferrer">https://github.com/hyperledger/fabric-samples/tree/release/balance-transfer</a></p>
  
  <p>Thank you for your answers!</p>