All Projects → ialberquilla → hlf1.4-supply-chain

ialberquilla / hlf1.4-supply-chain

Licence: other
Supply chain proof of concept in Hyperledger Fabric. Network with four companies and a specific chaincode exposed as rest API

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to hlf1.4-supply-chain

main
Mocks Server monorepo
Stars: ✭ 109 (+263.33%)
Mutual labels:  expressjs, api-rest
hackerAPI
🐓 API for registration, live-site
Stars: ✭ 20 (-33.33%)
Mutual labels:  expressjs, api-rest
dhiwise-nodejs
DhiWise Node.js API generator allows you to instantly generate secure REST APIs. Just supply your database schema to DhiWise, and a fully documented CRUD APIs will be ready for consumption in a few simple clicks. The generated code is clean, scalable, and customizable.
Stars: ✭ 224 (+646.67%)
Mutual labels:  expressjs, api-rest
node-crudapi-ts
CRUD boilerplate for create Node Restful API's with Express Framework and Sequelize ORM written in Typescript.
Stars: ✭ 41 (+36.67%)
Mutual labels:  expressjs, api-rest
fabex
Block explorer for Hyperledger Fabric
Stars: ✭ 26 (-13.33%)
Mutual labels:  hyperledger-fabric
KinectUtil
This project solves the problem of mismatching between rgb camera and depth camera of Kinect camera. And we can get higher quality point cloud model than Kinect itself. We solve the problem by first using both DLT and Zhangzhengyou‘s checkerboard to calibrate the camera, and then applying the calibrated parameters to project and re-project from…
Stars: ✭ 28 (-6.67%)
Mutual labels:  dlt
PollBuddy
Poll Buddy is an interactive questionnaire platform that aims to be an enjoyable and easy to use way to collect answers and insights from a group of people.
Stars: ✭ 20 (-33.33%)
Mutual labels:  expressjs
gatsby-reactstrap
Adding Bootstrap 4 to an Gatsby React App and serve generated the static site with Express.js
Stars: ✭ 25 (-16.67%)
Mutual labels:  expressjs
ExpressQL
A Ready-to-Go API Skeleton using Node.js + Express.js + GraphQL + MongoDB + JWT Authentication
Stars: ✭ 12 (-60%)
Mutual labels:  expressjs
nestjs-rest-sample
NestJS RESTful APIs Sample
Stars: ✭ 204 (+580%)
Mutual labels:  expressjs
next-express
Next.js custom webservers with Express.js made easy
Stars: ✭ 64 (+113.33%)
Mutual labels:  expressjs
chappe
🧑‍💻 Developer Docs builder. Write guides in Markdown and references in API Blueprint. Comes with a built-in search engine.
Stars: ✭ 132 (+340%)
Mutual labels:  api-rest
API
API documentation for the Forecast platform
Stars: ✭ 24 (-20%)
Mutual labels:  api-rest
truthy
Open source headless CMS API written using NestJS, that has pre built modules like User Management, Role Management, Permission Management, Email Module, Account Settings, OTP, Throttling, RBAC support, Localization, and many more.
Stars: ✭ 200 (+566.67%)
Mutual labels:  api-rest
order-service
一个基于vuejs,reactjs,nodejs,socket.io的服务系统
Stars: ✭ 22 (-26.67%)
Mutual labels:  expressjs
Library-Management-System
An online library management system built with MongodDB, Express.js and Node.js
Stars: ✭ 39 (+30%)
Mutual labels:  expressjs
Express-MongoDB-Authentication
A simple authentication app using Express & MongoDB
Stars: ✭ 15 (-50%)
Mutual labels:  expressjs
obyte-hub
Hub for Obyte network
Stars: ✭ 17 (-43.33%)
Mutual labels:  dlt
AmigoChat-Realtime-Chat-Application
AmigoChat is a responsive real-time chat application built on MERN Stack and Socket io.
Stars: ✭ 22 (-26.67%)
Mutual labels:  expressjs
spiced-final-project
Career explorer platform developed in React.js in 6 days.
Stars: ✭ 14 (-53.33%)
Mutual labels:  expressjs

hlf1.4-supply-chain

Supply chain proof of concept in Hyperledger Fabric. Network with four companies and a specific chaincode exposed as rest API

More info in Medium tutorials

Installation instructions

  1. Install Hyperledger fabric dependencies: https://hyperledger-fabric.readthedocs.io/en/release-1.4/prereqs.html

  2. Donwload fabric binaries and samples: curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.3

  3. Go to fabric samples: cd fabric-samples

  4. Download the template: git clone https://github.com/ialberquilla/hlf1.4-supply-chain

  5. Go to hlf1.4-supply-chain

  6. Install node-js dependencies ./network.sh install

Start the network

  1. Generate the crypto material and start the network ./network.sh start This will create the crypto material for all the orgs, start the network and register it's admins and users. Then will start the API at localhost:3000

Re-start the API server

npm start

Stop the network

./network.sh stop

API Doc

AddTuna

Add new Tuna to the blockchain network

  • URL

    /api/addTuna

  • Method:

    POST

  • Data Params

  "id":integer,
  "latitude":string,
  "longitude":string,
  "length":integer,
  "weight":integer
  • Success Response:
{	
  "status":"OK - Transaction has been submitted",
  "txid":"7f485a8c3a3c7f982aed76e3b20a0ad0fb4cbf174fbeabc792969a30a3383499"
} 
  • Sample Call:
curl --request POST \
 --url http://localhost:3000/api/addTuna \
 --header 'content-type: application/json' \
 --data '{
   		"id":10001,
   		"latitude":"43.3623",
   		"longitude":"8.4115",
   		"length":34,
   		"weight":50
   	   }' 

getTuna

Get Tuna from the blockchain with the actual status

  • URL

    /api/getTuna/:id

  • Method:

    GET

  • URL Params "id":integer

  • Success Response:

{
   "result": {
       "id": integer
       "latitude": string
       "longitude": string
       "length": integer
       "weight": integer
   } 
}
  • Sample Call:
curl --request GET \
  --url 'http://localhost:3000/api/getTuna/<TunaId>' \
  --header 'content-type: application/json' \ 

setPosition

Sets the position (latitude and longitud) for the specified id, could be sushiId or TunaId

  • URL

    /api/getTuna/setPosition

  • Method:

    POST

  • Data Params

"id":10001,
"latitude":"43.3623",
"longitude":"8.4115"
  • Success Response:
{	
   status":"OK - Transaction has been submitted",
   "txid":"7f485a8c3a3c7f982aed76e3b20a0ad0fb4cbf174fbeabc792969a30a3383499"
}
  • Sample Call:
curl --request POST \
  --url http://localhost:3000/api/setPosition \
  --header 'content-type: application/json' \
  --data '{
            "id":10001,
            "latitude":"43.3623",
            "longitude":"8.4115"
			}'

addSushi

Add new Sushi to the blockchain network with the related TunaId

  • URL

    /api/getTuna/addSushi

  • Method:

    POST

  • Data Params

"id":integer,
"latitude":string,
"longitude":string,
"type":string,
"tunaId":integer
  • Success Response:
{	
   status":"OK - Transaction has been submitted",
   "txid":"7f485a8c3a3c7f982aed76e3b20a0ad0fb4cbf174fbeabc792969a30a3383499"
}
  • Sample Call:
curl --request POST \
  --url http://localhost:3000/api/addSushi \
  --header 'content-type: application/json' \
  --data '{
			"id":200001,
            "latitude":"42.5987",
            "longitude":"5.5671",
            "type":"sashimi",
            "tunaId":10001
			}'

getSushi

Get sushi from the blockchain with the actual status

  • URL

    /api/getSushi/:id

  • Method:

    GET

  • URL Params "id":integer

  • Success Response:

 {
   "result": {
           "id":"200001",
           "latitude":"42.5987",
           "longitude":"5.5671",
           "type":"sashimi",
           "tunaId":10001
   		}'
}
  • Sample Call:
curl --request GET \
  --url 'http://localhost:3000/api/getSushi/<SushiId>' \
  --header 'content-type: application/json' \

getSushiHistory

Get sushi history, from the TunaId that started the supply-chain, getting all the history positions, until the sushi is delivered, with the sushi history too

  • URL

    /api/getHistorySushi/:id

  • Method:

    GET

  • URL Params "id":integer

  • Success Response:

{
   "historySushi": [
       {
           "id": "200001",
           "latitude":"42.5987",
           "longitude":"5.5671",
           "type": "sashimi",
           "tunaId": 10004
       },
       {
           "id": "200001",
           "latitude":"43.3623",
           "longitude":"8.4115",
           "type": "sashimi",
           "tunaId": 10004
       }
   ],
   "historyTuna": [
       {
           "id": "10004",
           "latitude":"43.3623",
           "longitude":"8.4115",
           "length": 34,
           "weight": 50
       }
   ]
}
  • Sample Call:
curl --request GET \
 --url 'http://localhost:3000/api/getHistorySushi/<SushiId>' \
 --header 'content-type: application/json' \
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].