Coder Social home page Coder Social logo

ibm / customer-loyalty-program-hyperledger-fabric-vscode Goto Github PK

View Code? Open in Web Editor NEW
96.0 13.0 66.0 111.43 MB

Customer loyalty program

Home Page: https://developer.ibm.com/patterns/customer-loyalty-program-with-iks-saas-v2-fabric/

License: Apache License 2.0

JavaScript 65.74% HTML 31.89% CSS 2.37%

customer-loyalty-program-hyperledger-fabric-vscode's People

Contributors

ash7594 avatar dependabot[bot] avatar ljbennett62 avatar lucianoacsilva avatar praveenhonavar avatar raheelzubairy avatar rgeraldporter avatar sandhya-nayak avatar stevemart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

customer-loyalty-program-hyperledger-fabric-vscode's Issues

Unexpected token o in JSON at position 1

Hi, when I tried to create a new member and using it to sign in, however the browser throws this error:

Screenshot from 2019-07-26 00-39-26

And the Node console gives:

app running on port: 8000
memberData using param -  accountNumber: 111111 cardId: test
Wallet path: /home/lee/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/wallet

Get member state 
2019-07-25T16:39:14.079Z - info: [TransactionEventHandler]: _strategySuccess: strategy success for transaction "bbf5b13f637a82ca8ad61cf6dc45bebe426a1a7e5e3792ec4ce7e5b345a345fb"
SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at Object.memberData (/home/lee/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/network/network.js:371:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Wallet path: /home/lee/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/wallet

Get use points transactions state for member 111111
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.usePointsTransactionsInfo (/home/lee/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/network/network.js:539:36)
    at <anonymous>
(node:32527) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Can't set headers after they are sent.
(node:32527) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I'm using nodejs version 8.9.4 if that helps.

Error while Member Registration

I am getting the following error

Using param - firstname: aaa lastname: bb email: [email protected] phonenumber: 1234567890 accountNumber: 100001 cardId: ac1
Valid Entries
Wallet path: /Users/abc/Desktop/BlockChain/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/wallet
Error: fabric-ca request register failed with errors [[{"code":19,"message":"CA 'ca.org1.example.com' does not exist"}]]
at IncomingMessage.response.on (/Users/avnirai/Desktop/BlockChain/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/fabric-client/node_modules/fabric-ca-client/lib/FabricCAClient.js:327:22)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1129:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

vscode prereq should be 1.36

The pre req for the version of vscode to use should now be 1.36 to work with the latest version of the extension

Application has references to Composer

The application has a few references to Composer remaining:

  • about.html - it does not use the Composer API, but the fabric network API
  • index.html - same as above

Could be confusing to new users.

Getting Error while adding new Member during registration

Hi Ashutosh,

I followed same steps as followed by you but i am stuck at step of adding new member registration and partner registration. While creating new member for the first time i am getting below error :

fabric-ca request register failed with errors [[{"code":19,"message":"CA 'ca.example.com' does not exist"}]]
fabric-ca request register failed with errors [[{"code":19,"message":"CA 'ca.example.com' does not exist"}]]

Please find attached snapshot for the same.

Thanks

Screenshot from 2019-05-16 11-01-53

Refer below for terminal logs

app running on port: 8000
Using param - firstname: raj lastname: singh email: [email protected] phonenumber: 5555555555 accountNumber: 100000 cardId: ac1
Valid Entries
Wallet path: /home/raaz/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/wallet
Error: fabric-ca request register failed with errors [[{"code":19,"message":"CA 'ca.example.com' does not exist"}]]
at IncomingMessage.response.on (/home/raaz/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/fabric-ca-client/lib/FabricCAClient.js:327:22)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
Using param - name: [email protected] partnerId: part1 cardId: ac1
Company name must be letters only
Using param - name: ibm partnerId: part1 cardId: ac1
Valid Entries
Wallet path: /home/raaz/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/wallet
Error: fabric-ca request register failed with errors [[{"code":19,"message":"CA 'ca.example.com' does not exist"}]]
at IncomingMessage.response.on (/home/raaz/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/fabric-ca-client/lib/FabricCAClient.js:327:22)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)

timestamp undefined

I implemented the fabric locally and I did not see any errors.

My member made purchases and redeemed points but the transaction data is incorrect.
For example:

Points Earned Transactions

timeStamp: undefined
partner: Villanova01
member: 123456
points: 30
transactionName: undefined
transactionID: undefined


timeStamp: undefined
partner: Villanova01
member: 123456
points: 80
transactionName: undefined
transactionID: undefined

and

Points Redeemed Transactions

timeStamp: undefined
partner: Villanova01
member: 123456
points: 50
transactionName: undefined
transactionID: undefined

Appreciate suggestions on how to fix.

Unable to see options for install and instantiate for smart contract

VS Code version:- Version: 1.60.2
IBM Blockchain Platform version:- 2.0.4

There is no option for install and instantiate for smart contract at IBM Blockchain platform after packaging. Please see the attached screenshot. Instead of install and instantiate option there is a Deploy smart contract option is there. But deployment failed with error :-

Failed to install on peer Org1 Peer with reason: Error: Could not install smart contact received error: failed with status:500 ::failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: external builder failed: external builder failed to build: external builder 'node' failed: exit status 1 [10/1/2021 12:43:58 PM] [ERROR] Failed to deploy smart contract, Error: Package was not installed. No packageId was returned

Screenshot 2021-10-01 at 12 48 13 PM

I failed to find what's wrong with this, any help?

Unable to package the Loyalty Contract

When I attempt to package the Loyalty contract into a package I get the following error message "Failed to determine workspace language type, supported languages are JavaScript, etc."

I have the contracts folder open in the file explorer, when I press F1 and select IBM Blockchain Platform: Package Open Project" command.

Appreciate any guidance you can provide.

Toby

Error while running enrollAdmin.js

I am getting this error when running enrollAdmin.js. Is there an alternative way to enroll??

2020-02-17T07:00:35.557Z - error: [FabricCAClientService.js]: Failed to enroll admin, error:%o message=Enrollment failed with errors [undefined], stack=Error: Enrollment failed with errors [undefined]
at IncomingMessage.response.on (/Users/a667911/Developer/Loyalty/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/fabric-ca-client/lib/FabricCAClient.js:470:22)
at emitNone (events.js:110:20)
at IncomingMessage.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1059:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
error Error: Enrollment failed with errors [undefined]
Failed to enroll admin user admin: ${error}

Unable to Sign In.

Wallet path: /Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/wallet

Get use points transactions state for member 456789
{ Error: transaction returned with failure: SyntaxError: Unexpected end of JSON input
at self._endorserClient.processProposal (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/fabric-client/lib/Peer.js:140:36)
at Object.onReceiveStatus (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/grpc/src/client_interceptors.js:1191:9)
at InterceptingListener._callNext (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/grpc/src/client_interceptors.js:564:42)
at InterceptingListener.onReceiveStatus (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/grpc/src/client_interceptors.js:614:8)
at callback (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/grpc/src/client_interceptors.js:841:24)
status: 500,
payload: ,
peer:
{ url: 'grpc://localhost:17051',
name: 'peer0.org1.example.com',
options:
{ name: 'peer0.org1.example.com',
'request-timeout': 300000,
'grpc.max_receive_message_length': -1,
'grpc.max_send_message_length': -1 } },
isProposalResponse: true }
Wallet path: /Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/wallet

Get earn points transactions state for member 456789
{ Error: transaction returned with failure: SyntaxError: Unexpected end of JSON input
at self._endorserClient.processProposal (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/fabric-client/lib/Peer.js:140:36)
at Object.onReceiveStatus (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/grpc/src/client_interceptors.js:1191:9)
at InterceptingListener._callNext (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/grpc/src/client_interceptors.js:564:42)
at InterceptingListener.onReceiveStatus (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/grpc/src/client_interceptors.js:614:8)
at callback (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/grpc/src/client_interceptors.js:841:24)
status: 500,
payload: ,
peer:
{ url: 'grpc://localhost:17051',
name: 'peer0.org1.example.com',
options:
{ name: 'peer0.org1.example.com',
'request-timeout': 300000,
'grpc.max_receive_message_length': -1,
'grpc.max_send_message_length': -1 } },
isProposalResponse: true }
(node:53834) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:470:11)
at ServerResponse.header (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/express/lib/response.js:767:10)
at ServerResponse.send (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/express/lib/response.js:170:12)
at ServerResponse.json (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/node_modules/express/lib/response.js:267:15)
at network.earnPointsTransactionsInfo.then (/Users/syed/Downloads/hyperledger/customer-loyalty-program-hyperledger-fabric-VSCode/web-app/app.js:279:21)
(node:53834) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 10)

Getting error while Submit EarnPoints transaction

Hi @ALL,

i got the following error message when i want to "Earn Points through purchases":

Submit EarnPoints transaction.
2023-02-22T16:22:05.943Z - error: [Transaction]: Error: No valid responses from any peers. Errors:
    peer=peer0.org1.example.com:7051, status=500, message=Cannot read properties of undefined (reading 'low')
    peer=peer0.org2.example.com:9051, status=500, message=Cannot read properties of undefined (reading 'low')
at newEndorsementError ([..]/customer-loyalty-program-hyperledger-fabric/web-app/node_modules/fabric-network/lib/transaction.js:74:12)
    at getResponsePayload ([..]/customer-loyalty-program-hyperledger-fabric/web-app/node_modules/fabric-network/lib/transaction.js:41:23)
    at Transaction.submit ([..]/customer-loyalty-program-hyperledger-fabric/web-app/node_modules/fabric-network/lib/transaction.js:255:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.earnPointsTransaction ([..]/customer-loyalty-program-hyperledger-fabric/web-app/network/network.js:304:40) {
  responses: [
    {
      version: 0,
      timestamp: null,
      response: [Object],
      payload: <Buffer 0a 20 26 c9 ae 9b 52 c5 7d 7b 91 09 a6 97 80 c0 ab 2f f9 cc f8 b6 a8 8d fc df 1e d0 53 3b 53 a6 1e a1 12 ae 01 0a 61 12 39 0a 0a 5f 6c 69 66 65 63 79 ... 161 more bytes>,
      endorsement: null,
      connection: [Object],
      peer: 'peer0.org1.example.com:7051'
    },
    {
      version: 0,
      timestamp: null,
      response: [Object],
      payload: <Buffer 0a 20 26 c9 ae 9b 52 c5 7d 7b 91 09 a6 97 80 c0 ab 2f f9 cc f8 b6 a8 8d fc df 1e d0 53 3b 53 a6 1e a1 12 ae 01 0a 61 12 39 0a 0a 5f 6c 69 66 65 63 79 ... 161 more bytes>,
      endorsement: null,
      connection: [Object],
      peer: 'peer0.org2.example.com:9051'
    }
  ],
  errors: []

Last error comes from this line in the network.js network.js:304:40

const earnPointsResponse = await contract.submitTransaction('EarnPoints', JSON.stringify(earnPoints));

Anybody a hint what the problem can be or how i can fix this?

Readme specifies wrong version of VSCode

The current readme specifies VSCode version 1.26 or greater, but there is an actual requirement of VS Code version 1.35.1 or greater for the IBM Blockchain Platform extension.

If someone picks up an older version of VSCode, they won't be able to install the 1.0.x release of IBM Blockchain Platform

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.