nikita6187 / NEC

Our blockchain practical for the NEC challenge
2 stars 0 forks source link

NEC

Our blockchain practical repository for the NEC challenge

Prerequisites

To run the network please make sure the following have been installed:

Automatic Network Setup

Steps to run:

bash setup_network.sh
bash start_network.sh
bash stop_network.sh

More details: To setup the network please run bash setup_network.sh. The script will:

How to Run Demo

The full demo is here: https://www.youtube.com/watch?v=lyzwGfcaPJI

A more raw demo can be seen here: https://www.youtube.com/watch?v=10BqdfQ9dQU

Note, for the aggregator to perform the aggregation you need to make a HTTP POST to http://127.0.0.1:11900/putAggDataOnBlockchain/, with a JSON data load containing for example: {"query_id": "q2"} All other operations are done via the UIs.

Manual Network Setup

Run the commands in start_network.sh up until step 7 from the /fabric folder. Then go to the /clients folder, and start in 9 new terminals. For each terminal, start the respective Python clients or React acts (see start_network.sh for their locations). To start the apps you do not need any parameters other than python3/npm start. Note: first start the Python clients (Managing organization first), then the react apps. See the /clients folder for some examples.

To look into various blockchain aspects, look into the /fabric folder.

Project structure

All network code is located in /fabric/. See readme there for additional info. All client code is located in /clients. See readme there for additional info. Various documentation is located in docs_fabric_api that was used previously for smart contract testing.

Smart Contracts

API to HF network

Logs and Errors

The logs of the python clients can be found in the nohup.out files located next to the python files. For node apps, all logs can be viewed via pm2 logs, e.g. pm2 logs API. To view the logs of the HF containers, first find using docker ps -a the interesting container, and then use docker logs <id>.