GithubHelp home page GithubHelp logo

imranmehdi5511 / trade-contracts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperledgerhandson/trade-contracts

0.0 0.0 0.0 158 KB

Hyperledger Hands-On second edition - Smart Contracts of the Trade Network

License: Apache License 2.0

Shell 0.15% Java 70.13% TypeScript 27.40% Makefile 2.33%

trade-contracts's Introduction

Build Status

Trade-contracts

This repository contains the various smart contracts of the Trade Network.

There are two versions represented by the folders:

  • v1 - Used from chapter 4 through 8
  • v2 - Used to represent the addition of a new organization, part of chapter 9.

Under the respective version folder you will find the four smart contracts:

  • Trade -- folder /trade
  • Shipment -- folder /shipment
  • Letter of Credit -- folder /letterOfCredit
  • Export License -- folder /exportLicense

To ensure that VSCode properly identify each projects as a distinct smart contract, we recommend that you import each one separately into the workspace.

Pre requisites

Code has been tested on macOS Catalina and Ubuntu 18.04.
While it should run on other platform like Windows, it does not include the convenience scripts.

Component Version
git latest
jq latest
docker 19.03-ce or greater is required
docker-compose 1.25.0 or greater installed
node 12.13.1+
npm 6.12 and above
Java JDK 11
Gradle 6.4+
make latest
g++ 11.0.0

Note: When running the full network and smart contracts, Docker on Windows or Mac requires 8GB allocated to it. You can change this from the Docker config panel (Preferences -> Advanced)

Building the Smart Contracts

A convenience shell script is provided in the root of this repository: ./makeAll.sh

This script will invoke make all within each sub-repository. This will build, run the tests and package the smart contracts.

Manual build of the Java chaincode(exportLicense/letterOfCredit):

  1. Change directory (cd) into the chaincode you want to build.
  2. Run gradle build
  3. To test the chaincode run gradle test

Manual build of the JavaScript chaincode(shipment/trade):

  1. Change directory (cd) into the REST server you want to build.
  2. Run npm install
  3. To test the REST server run npm test

Deploying smart contracts

The smart contracts (aka chaincode) is deployed via the trade-network project.

trade-contracts's People

Contributors

ldesrosi avatar vramakrishna 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.