Coder Social home page Coder Social logo

ibhzhazem / convector-example-coffee-traceability Goto Github PK

View Code? Open in Web Editor NEW

This project forked from worldsibu/convector-example-coffee-traceability

0.0 1.0 0.0 309 KB

Coffee traceability example made with convector with unit-tests and end-to-end tests

TypeScript 96.28% JavaScript 3.72%

convector-example-coffee-traceability's Introduction

Coffee Traceability

Developed with Convector by Covalent

This project covers the creation of multiple participants creating a coffee batch in conjuntion, then selle it to a coffee roaster participant. In the roast process you usually combine different grain batches, so the code takes that into consideration to be able to provide which percentage of the final result belongs to the original producers.

Here's a diagram explaining the overall process

Coffee Diagram


This awesome project was created automatically with Convector CLI. By default new Convector projects locally include Hurley to manage your development environment seamlessly, so you don't have to worry about setting up the network and hard ways to install and upgrade your chaincodes.

Start

# Install dependencies - From the root of your project
npm i

# Create a new development blockchain network  - From the root of your project
npm run env:restart

# Install your smart contract
npm run cc:start -- coffee

# Run the end-to-end tests invoking the ledger
npm run test:e2e

About Hurley

You may as well install Hurley globally for easier and more flexible management.

npm i -g @worldsibu/hurley

Since with Hurley globally you have control over everything, some things that you can do, for example, is installing a Convector Smart Contract with a different name than the one you used for your project.

# Use the same package
# Install a new chaincode with the same source code but the name 'anothernameforyourcc'
hurl install anothernameforyourcc node

Other complex tasks you may need is installing to a different channel.

# Use the same package
# Be sure you started your environment with more than one channel running 'hurl new --channels 2'. Otherwise this will throw an error.
hurl install anothernameforyourcc node --channel ch2

If you don't want to, don't worries! This project works right away.

Start - if you have Hurley globally

Bring your project to life

# Install dependencies - From the root of your project
npm i
# Create a new development blockchain network  - From the root of your project
hurl new

Install and upgrade chaincodes

# Package your smart contract's code  - From the root of your project
npm run cc:package -- coffee org1
# Install to your blockchain - From the root of your project
hurl install coffee node -P ./chaincode-coffee
# Install in debug mode, this will run the chaincode server locally so you can debug
hurl install coffee node -P ./chaincode-coffee --debug

# Upgrade your existing chaincode - From the root of your project
hurl upgrade coffee node 1.2 -P ./chaincode-coffee

Start - if you don't have Hurley globally

Bring your project to life

# Install dependencies - From the root of your project
npm i
# Create a new development blockchain network  - From the root of your project
npm run env:restart

Install and upgrade chaincodes

# Install to your blockchain - From the root of your project
npm run cc:start -- coffee

# Upgrade your existing chaincode - From the root of your project
npm run cc:upgrade -- coffee 1.2

Tests

npm run test
npm run test:e2e

Check all the information to work with Convector in the DOCS site.

Collaborate to the Convector Suite projects

convector-example-coffee-traceability's People

Contributors

diestrin avatar

Watchers

 avatar

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.