Giter VIP home page Giter VIP logo

iitj_ai_mtech_blockchain_project's Introduction

File to run - n_1.py
Port - 5001

For multiple nodes - same file can be copied and run on different ports like 5002, 5003 and so on.
Required installations - MySQL on port 3306, DB - test, user - root, password - 1234

API curls -

->Horizontal node connection API - 

curl --location --request POST '127.0.0.1:5001/connect_node' \
--header 'Content-Type: application/json' \
--data-raw '{
    "nodes":["http://127.0.0.1:5002"]
}'

Vertical functional APIs -

->User creation -

curl --location --request GET '127.0.0.1:5001/add_user/control_centre' \
--data-raw ''

->Getting chain -

curl --location --request GET '127.0.0.1:5001/get_chain' \
--data-raw ''

->Adding transactions -

curl --location --request POST '127.0.0.1:5001/add_transaction' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sender":"756e44a8a66a5e23d66ee74d3ae2da3ed03d2a8667566d54ed694cc4a604765b",
    "receiver": "22d63195b78ba153318745f2ea7ae8dbc5c59d7ddfaca90d8aba3ca8a546539b",
    "data": "Medical Equipment 1 Registered at Control Centre",
    "amount": 100
}'

->Mining block -

curl --location --request GET '127.0.0.1:5001/mine_block/756e44a8a66a5e23d66ee74d3ae2da3ed03d2a8667566d54ed694cc4a604765b' \
--data-raw ''

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.