Coder Social home page Coder Social logo

itpc's Introduction

ITPC

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Please make sure you've already installed ganache-cli and Truffle

Installing

A step by step series of commands that will help you set a development env running

Clone this repository:

git clone https://github.com/Pris17/ITPC.git

Change directory to ITPC folder and install all requisite npm packages (as listed in package.json):

cd ITPC
npm install

Launch Ganache:

ganache-cli

In a separate terminal window, again change directory to ITPC folder and compile smart contracts:

truffle compile

This will create the smart contract artifacts in folder build\contracts.

Migrate smart contracts to the locally running blockchain, ganache-cli:

truffle migrate

Test smart contracts:

truffle test

All 4 tests should pass.

In a separate terminal window, again change directory to ITPC folder and start the services:

npm start

Services will start on port 8082

Once the services are started, request you to first register Manufacturer, Dealer and Customer using below API endpoint. All are POST method with an option to pass the ethereum address account to be registered as one of the entity. For simplicity, I have passed accounts from ganache. So you don't need to pass any account for testing.

http://localhost:8082/autosc/registerManufacturer
http://localhost:8082/autosc/registerDealer
http://localhost:8082/autosc/registerCustomer

Once the accounts are registered to specific role, you can proceed interacting with other APIs for creating a car by manufacturer or selling a car by dealer.

Note: In order to finish the test on time, I haven't considered intermediary steps of automotive supply chain. There are only 3 states of car here.

Authors

Priya Shah

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.