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/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
orproduction.cfg
in thenimble_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
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=False
inmain.py
-
The app is deployed with uWSGI Server
-
Change the settings for the uWSGI Server in
app.ini
-
Adapt the
APP_CONFIG
variable in thedocker-compose
file toproduction.cfg
with all environment variables necessary in it. -
The
production.cfg
file MUST be in thenimble_iot_bc
directory. 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([email protected])
Faculty of Production Engineering, University Bremen. In collaboration with BIBA - Bremer Institut für Produktion und Logistik GmbH, Bremen, Germany