GitSummarize

πŸ“‘πŸ”— iot-trace-chain

Hybrid architecture combining IoT, blockchain, and big data for secure traceability of waste data.

---

🧠 Overview

This project is part of a Master's Thesis and proposes a scalable architecture to ensure the traceability, integrity, and availability of data generated by IoT devices in waste management scenarios.

The solution combines:

β€’

πŸ”§ IoT devices connected via MQTT

β€’

πŸ“¦ Massive storage in Parquet format on a Data Lake (MinIO + Delta Lake)

β€’

πŸ” Integrity verification using Merkle trees and blockchain (Ethereum/Hardhat)

β€’

πŸ“Š Optional visualization and analysis with DuckDB, Dremio, or other tools

---

🧱 Architecture

plaintext
1[IoT Device] --> MQTT --> Persistence Worker --> 2 [Delta Lake (MinIO)] + [Blockchain (Merkle Root)]

---

πŸš€ Main Services (Docker Compose)

| Service | Description |

|----------------------|----------------------------------------------------|

| persistence-worker | Processes, validates, and stores IoT data |

| minio | S3-compatible storage backend for the Data Lake |

| hardhat-node | Local blockchain node (Ethereum) |

| mosquitto | MQTT broker receiving sensor messages |

| duckdb | Optional tools for data exploration and querying |

---

πŸ“¦ Project Structure

text
1. 2β”œβ”€β”€ persistence-worker/ # Main worker code (Python, Spark) 3β”œβ”€β”€ blockchain/ # Smart contracts and Hardhat scripts 4β”œβ”€β”€ mosquitto/ # MQTT broker configuration 5β”œβ”€β”€ minio-mirror/ # Local copy for DuckDB querying 6β”œβ”€β”€ docker-compose.yaml # Service orchestration 7└── README.md # This file -> Project documentation

---

πŸ›  Technologies

β€’

Python 3.12

β€’

Apache Spark + PySpark

β€’

Delta Lake

β€’

MQTT (Eclipse Mosquitto)

β€’

Ethereum + Hardhat

β€’

MinIO (S3-compatible)

β€’

DuckDB / Dremio (optional)

β€’

Docker Compose

---

βš™οΈ Quick Start

πŸ”§ Start environment:

bash
1docker compose up --build

πŸ“¦ Run a manual service (e.g., MQTT Explorer):

bash
1docker compose --profile manual up mqtt-explorer

🐍 Run the worker manually:

bash
1cd persistence-worker 2poetry install 3poetry run poe start-local

If you want to run the worker with time of function execution, you can use the following command:

bash
1poetry run poe start-local-profiling

Additionally, if you want to send a test MQTT message, you can do so with the following command:

bash
1poetry run poe publish-message

---

πŸ“š Documentation

TODO

πŸ“„ License

This project is licensed under the MIT License and developed as part of the Master's in Business Intelligence and Big Data in Secure Environments (UBu, ULe, UVa) in Spain.

---

πŸ‘¨β€πŸŽ“ Author

Javier Alonso-NΓΊΓ±ez

LinkedIn β€’ GitHub β€’ ORCID