Giter Club home page Giter Club logo

foodsupplychaindemo's Introduction

FoodSupplyChainDemo

Simple demonstration for a food supply chain with the help of Hyperledger Fabric composer including GHG emission parameters for the whole chain

Assets:

  • LiveAsset
  • Vegetables
  • Animals
  • Cow
  • Steak

Production and supply chain states:

  • Production
  • Processing o At processing the Cow changes to Steak :)
  • Distribution
  • Retail
  • Restaurant

UI:

  • Angular JS web user interface
  • on Hyperledger fabric composer
  • With generated rest API

Deployment:

  • Hyperledger Fabric Composer

Integration:

foodsupplychaindemo's People

Contributors

daniel-szego avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

foodsupplychaindemo's Issues

composer-rest-server,Bus error

zcy@ubuntu:~/myApplication/FoodSupplyChainDemo$ composer-rest-server
? Enter the name of the business network card to use: admin@foodsupplychain
? Specify if you want namespaces in the generated REST API: never use namespaces
? Specify if you want to use an API key to secure the REST API: No
? Specify if you want to enable authentication for the REST API using Passport: No
? Specify if you want to enable the explorer test interface: Yes
? Specify a key if you want to enable dynamic logging: 123
? Specify if you want to enable event publication over WebSockets: Yes
? Specify if you want to enable TLS security for the REST API: No

To restart the REST server using the same options, issue the following command:
   composer-rest-server -c admin@foodsupplychain -n never -u true -d 123 -w true

Discovering types from business network definition ...
Bus error
``

atProduction{} relationship ?

what is at production relationship in produce transaction ? what value should i pass to it while testing the application whatever value i pass it says 400 bad request error ?
(any help is greatly appreciated) thanks

Possible error in consume func

The consume function should make changes to asset registry of steak and should update (AssetToConsume) not resturant
`

  • @param {org.supplychain.food.model.Consume} param - model instance

  • @transaction
    */
    async function ConsumeFunction(param) {
    let assetToConsume = param.liveAsset;
    let restaurant = param.atRestaurant;
    let factory = await getFactory();

    assetToConsume.assetStatus = "CONSUMED";

    const restaurantReg = await getAssetRegistry(namespace + '.LiveAsset');
    await restaurantReg.update(restaurant);

    // emitting Sold event

    let consumedEvent = factory.newEvent('org.supplychain.green.model', 'AssetConsumed');
    consumedEvent.liveAsset = assetToConsume;
    consumedEvent.endGHG = assetToConsume.aggregatedGHG;
    await emit(consumedEvent);
    }
    `

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.