Giter VIP home page Giter VIP logo

ibm / decentralized-energy-fabric-on-ibp20 Goto Github PK

View Code? Open in Web Editor NEW
41.0 13.0 33.0 190.74 MB

Set up a network on the IBM Blockchain Platform and deploy a decentralized energy smart contract on the network.

Home Page: https://developer.ibm.com/patterns/decentralized-energy-with-hyperledger-fabric-and-ibm-blockchain-saasv2-use-case-1/

License: Apache License 2.0

DIGITAL Command Language 0.55% JavaScript 45.69% TypeScript 38.18% CSS 1.32% HTML 14.26%
hyperledger-fabric blockchain decentralized energy node-js ibm-blockchain-platform kubernetes

decentralized-energy-fabric-on-ibp20's People

Contributors

dependabot[bot] avatar horeaporutiu avatar kkbankol-ibm avatar ljbennett62 avatar raheelzubairy avatar sandhya-nayak 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

Watchers

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

decentralized-energy-fabric-on-ibp20's Issues

Reopen a closed issue - Adding a resident...error persisted with new commit...

can you please comment on your last fix? I believe smart contract has problems when submitting a transaction. My IBM free Blockchain test network will expire in 5 days...thanks!

Submit "AddResident" transaction.
2019-05-29T00:38:58.747Z - warn: [DiscoveryEndorsementHandler]: _build_endorse_group_member >> G0:0 - endorsement failed - Error: transaction returned with failure: SyntaxError: Unexpected token � in JSON at position 0
Failed to submit transaction: Error: Endorsement has failed

Authentication Feature [WIP]

Hey @ljbennett62 , I am working on adding authentication to the smart contracts to ensure the residents can only send coins that belong to them (as a start). This is in line with the Extending the Code Pattern as described in the ReadMe.md file.

Should have smart contracts and maybe a new .js. file to register multiple users with their wallets by end of week, wanted to know if I should do the PR (when I manage to) to the dev branch, or ask for a new one.

Wanted to run the concept by you

  • Admin enrolls new users with id R1, R2 and assigns certificates (instead of user1)

  • Transaction to add new resident will be submitted using wallet of R1 at which point the ID is added to the resident's schema (The Resident over here is the equivalent of a participant as used in composer)

let cid = new ClientIdentity(ctx.stub);
var resident = { id: cid.getID() }
await ctx.stub.putState('residents', Buffer.from(JSON.stringify(residents))); 
  • At this point we can verify if the id match, else throw an error

  • There are a couple of points I want to touch upon, that I will address once I open a complete PR

Do let me know if this is fine by you.

I get this error when adding a resident, any help welcome!

Submit "AddResident" transaction.
2019-05-29T00:38:58.747Z - warn: [DiscoveryEndorsementHandler]: _build_endorse_group_member >> G0:0 - endorsement failed - Error: transaction returned with failure: SyntaxError: Unexpected token � in JSON at position 0
Failed to submit transaction: Error: Endorsement has failed

No "Connect to SDK" option in overflow menu after Instantiating a Smart Contract

Hi team,
I've followed the steps carefully and diligently, and have gotten it to work perfectly fine until couple weeks back. Now today, when I try to redo everything again (helping out a friend right now), and I instantiate the Smart Contract (.cds file generated from VSCode plugin), I do not get the "Connect to SDK" option in the Blockchain console. I am guessing it has something to do with the recent update to the platform, and there's no backward compatibility.
But if you could help me understand why that would be happening, it'll be really helpful and I would finally stop pulling my hair.
Cheers!

chaincode fabric SDK version

Recently, I had meet problem as error log below from chaincode container after deployed to IBP 2.0.

(node:15) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
2019-05-07T08:35:00.918Z ERROR [contracts-spi/chaincodefromcontract.js]
{"message":"Unexpected token \u0004 in JSON at position 0","stack":"SyntaxError: Unexpected token \u0004 in JSON at position 0\n at JSON.parse ()\n at new ClientIdentity (/usr/local/src/node_modules/fabric-shim/lib/chaincode.js:253:38)\n at ChaincodeFromContract.invokeFunctionality (/usr/local/src/node_modules/fabric-shim/lib/contract-spi/chaincodefromcontract.js:290:35)\n at ChaincodeFromContract.Init (/usr/local/src/node_modules/fabric-shim/lib/contract-spi/chaincodefromcontract.js:250:25)\n at handleMessage (/usr/local/src/node_modules/fabric-shim/lib/handler.js:611:47)\n at ChaincodeSupportClient.handleInit (/usr/local/src/node_modules/fabric-shim/lib/handler.js:352:9)\n at ClientDuplexStream. (/usr/local/src/node_modules/fabric-shim/lib/handler.js:293:30)\n at emitOne (events.js:116:13)\n at ClientDuplexStream.emit (events.js:211:7)\n at addChunk (_stream_readable.js:263:12)"}

It would fixed via updated fabric sdk from 1.4.0-beta2 to 1.4.0

Before (won't work)
"fabric-contract-api": "1.4.0-beta2",
"fabric-shim": "1.4.0-beta2"

After (works)
"fabric-contract-api": "1.4.0",
"fabric-shim": "1.4.0"

Could some one take a look at?

An error occurred during instantiation.

Hello!

Throughout the instantiation of the smart contract, I have faced the following error:

grpc payload is empty: transaction returned with failure: SyntaxError: Unexpected token � in JSON at position 0

Do you have any suggestions where I am wrong?
Cheers!

Failed to run addResident.js

This are two similar issues: #20, #22

Steps to Reproduce

Following the steps in README:

  1. Create a Hyperledger network on IBM cloud
  2. Instantiate the sample chaincode
  3. Run the application

Logs

╭─debug@bafu-mba4g256 ~/codes/decentralized-energy-fabric-on-IBP20/application/add-participants  ‹master*› 
╰─$ node addResident.js 
Wallet path: /home/debug/codes/decentralized-energy-fabric-on-IBP20/application/_idwallet

Submit "AddResident" transaction.
2020-03-17T09:07:22.540Z - warn: [DiscoveryEndorsementHandler]: _build_endorse_group_member >> G0:0 - endorsement failed - Error: transaction returned with failure: SyntaxError: Unexpected end of JSON input
Failed to submit transaction: Error: Endorsement has failed

Environment

decentralized-energy-fabric-on-IBP20: commit cdd7411

Error when join a peer to channel

I followed the lab without any issue until the join a peer to channel when clicking "join channel" I'm getting an "the peer could not join the channel" error without any other information.

Is this a known bug? Am I missing something?

Error when creating peer

I followed the lab without any issue until the Create a peer section but once there, when clicking "Submit" I'm getting an "Unable to create peer" error without any other information.

Is this a known bug? Am I missing something?

Cannot instantiate the smart contract

error in simulation: could not launch chaincode decentralizedenergy:0.0.1: error building chaincode: error building image: external builder failed: external builder failed to build: external builder 'ibp-builder' failed: exit status 3

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.