Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not create new contract!" on local #81

Open
taynguyen opened this issue Jul 14, 2019 · 2 comments
Open

"Could not create new contract!" on local #81

taynguyen opened this issue Jul 14, 2019 · 2 comments

Comments

@taynguyen
Copy link

taynguyen commented Jul 14, 2019

I followed the installation for local set up.
I was able to start web but failed to "Order" when making an payment at bike shop.

The web log is:

> blockchain-for-insurance@2.1.1 serve /app
> cross-env NODE_ENV=production&&node ./bin/server

Wallet path: /app/www/blockchain/wallet
/app/app/static/js
Server running on port: 3000
Default channel not found, attempting creation...
Successfully created a new default channel.
Joining peers to the default channel.
Peer joined default channel
Peer joined default channel
Peer joined default channel
Peer joined default channel
Connecting and Registering Block Events
Chaincode is not installed, attempting installation...
Base container image present.
Successfully installed chaincode on the default channel.
Successfully instantiated chaincode on all peers.
args in shopPeer query: { shopType: 'B' }
func in shopPeer query: 'contract_type_ls'
invokeCC called, function: contract_type_ls and the args:
{ shopType: 'B' }
An identity for the user shopApp-admin does not exist in the wallet
Run the registerUser.js application before retrying
Failed to submit transaction: TypeError: Cannot set property 'error' of undefined
contract before ojbect.assign: [object Object]
contract after object.assign: [object Object]
args in shopPeer invoke: { contractTypeUuid: '1d640cf7-9808-4c78-b7f0-55aaad02e9e5',
  username: '',
  password: 'secret76',
  firstName: '',
  lastName: '',
  item:
   { id: 0,
     brand: 'Canyon',
     model: 'Spectral AL 6.0',
     price: 3420,
     serialNo: '9Z62X' },
  startDate: '1970-01-01T00:00:00.000Z',
  endDate: '1970-01-01T00:00:00.000Z',
  uuid: '6880b5e8-625b-4da8-9031-0d8440922607' }
func in shopPeer invoke: 'contract_create'
invokeCC called, function: contract_create and the args:
{ contractTypeUuid: '1d640cf7-9808-4c78-b7f0-55aaad02e9e5',
  username: '',
  password: 'secret76',
  firstName: '',
  lastName: '',
  item:
   { id: 0,
     brand: 'Canyon',
     model: 'Spectral AL 6.0',
     price: 3420,
     serialNo: '9Z62X' },
  startDate: '1970-01-01T00:00:00.000Z',
  endDate: '1970-01-01T00:00:00.000Z',
  uuid: '6880b5e8-625b-4da8-9031-0d8440922607' }
Failed to submit transaction: TypeError: Cannot set property 'error' of undefined
An identity for the user shopApp-admin does not exist in the wallet
Run the registerUser.js application before retrying
Error creating contract: Proposal rejected by some (all) of the peers: Error: User with this username does not exist.
{ Error: Error creating contract: Proposal rejected by some (all) of the peers: Error: User with this username does not exist.
    at wrapError (/app/www/blockchain/utils.js:444:15)
    at Object.<anonymous> (/app/www/blockchain/shopPeer.js:42:11)
    at Generator.throw (<anonymous>)
    at step (/app/bin/blockchain/shopPeer.js:180:191)
    at /app/bin/blockchain/shopPeer.js:180:402
    at <anonymous>
  inner: Error: Proposal rejected by some (all) of the peers: Error: User with this username does not exist.
    at /app/www/blockchain/utils.js:305:15
    at Generator.next (<anonymous>)
    at step (/app/bin/blockchain/utils.js:103:191)
    at /app/bin/blockchain/utils.js:103:361
    at <anonymous> }

Any one having the same issue with me. I tried clean then restart again. But it still failed.
I'm using MacOs.

@horeaporutiu
Copy link
Contributor

and did you do this step - https://github.com/IBM/build-blockchain-insurance-app#step-9-enroll-app-admin-identities - where you should have the shopApp-admin identity in your wallet directory?

@taynguyen
Copy link
Author

taynguyen commented Jul 25, 2019

@horeaporutiu : No I haven't execute step 9. It was not mention in guide for LOCAL environment: https://github.com/IBM/build-blockchain-insurance-app/blob/master/README-local.md? So that step was required?
I would make a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants