Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Files

Latest commit

 

History

History
94 lines (53 loc) · 2.33 KB

README.md

File metadata and controls

94 lines (53 loc) · 2.33 KB

Tracking-IoT-Blockchain Service

This is a Repository to provide RESTful APIs for EPCIS and IoT Information for NIMBLE-Platform. These APIs can provide data related to NIMBLE's Track&Trace services along with IoT Sensor Data Information as well as the platform's Blockchain Network.

Functionalities

These RESTful APIs communicate with:

  • EPCIS Repository (MongoDB Instance)
  • Sensor Repository (InfluxDB)
  • NIMBLE's HyperLedger Fabric API

Development

  • Written using python3.x

  • Enable a Virtual Environment

      python -m venv venv
    
  • Activate the Environment

    Linux

      source venv/bin/activate
    

    Windows

      venv/Scripts/activate.ps1
    
  • Install Dependencies

      pip install -r requirements.txt
    

    or

      python setup.py develop
    
  • Set APP_CONFIG to the configuration file variables e.g. testing.cfg or production.cfg in the nimble_iot_bc directory:

    Linux

      export APP_CONFIG=testing.cfg
    

    Windows (PowerShell)

      $env:APP_CONFIG = "testing.cfg"
    
  • enable debugging in the main.py:

      entrypoint.run(debug=True)
    
  • Run the app using

      python main.py
    

Development with Docker

    docker build -t nimble-iot-blockchain-api .

(see Deployment section for setting up environment file)

Documentation

Deployment

  • Disable debug mode in production using debug=False in main.py

  • The app is deployed with uWSGI Server

  • Change the settings for the uWSGI Server in app.ini

  • Adapt the APP_CONFIG variable in the docker-compose file to production.cfg with all environment variables necessary in it.

  • The production.cfg file MUST be in the nimble_iot_bc directory. Else, adapt the compose file with the path to the configuration accordingly (see volumes).

  • build using:

      docker-compose up --build
    

Docker

    docker --name=iot-tnt-bc-microservice -e APP_CONFIG=production.cfg  -p 5000:5000 shantanoodesai/nimble-iot-blockchain-api:latest

License

MIT License

Developed and Maintained by

Shantanoo Desai(des@biba.uni-bremen.de)

Faculty of Production Engineering, University Bremen. In collaboration with BIBA - Bremer Institut für Produktion und Logistik GmbH, Bremen, Germany