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.
These RESTful APIs communicate with:
- EPCIS Repository (MongoDB Instance)
- Sensor Repository (InfluxDB)
- NIMBLE's HyperLedger Fabric API
-
Written using
python3.x -
Enable a Virtual Environment
python -m venv venv -
Activate the Environment
Linux
source venv/bin/activateWindows
venv/Scripts/activate.ps1 -
Install Dependencies
pip install -r requirements.txtor
python setup.py develop -
Set
APP_CONFIGto the configuration file variables e.g.testing.cfgorproduction.cfgin thenimble_iot_bcdirectory:Linux
export APP_CONFIG=testing.cfgWindows (PowerShell)
$env:APP_CONFIG = "testing.cfg" -
enable debugging in the
main.py:entrypoint.run(debug=True) -
Run the app using
python main.py
docker build -t nimble-iot-blockchain-api .
(see Deployment section for setting up environment file)
- Current Swagger Documentation available on http://localhost:5000/api/doc/
-
Disable debug mode in production using
debug=Falseinmain.py -
The app is deployed with uWSGI Server
-
Change the settings for the uWSGI Server in
app.ini -
Adapt the
APP_CONFIGvariable in thedocker-composefile toproduction.cfgwith all environment variables necessary in it. -
The
production.cfgfile MUST be in thenimble_iot_bcdirectory. Else, adapt the compose file with the path to the configuration accordingly (seevolumes). -
build using:
docker-compose up --build
docker --name=iot-tnt-bc-microservice -e APP_CONFIG=production.cfg -p 5000:5000 shantanoodesai/nimble-iot-blockchain-api:latest
MIT License
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