d-VAULT / raspberry-pi-client

Raspberry Pi Client for D-Vault
2 stars 2 forks source link

Raspberry Pi client BCH compliance

Backend

Performs a push sum algorithm via smart meters connected with the IOTA Tangle to determine the aggregate energy usage in a group belonging to an energy supplier.

Communications between the meters is encrypted so that the energy supplier cannot see individual usage. Weight in the push sum is homomorphically encrypted with the public key of the energy supplier so that only the energy supplier can see the total sum.

Next up:

Installation

Install the Python.

Install dependencies on Raspberry Pi:


# brew install libmpc mpfr gmp

sudo apt-get install python3-pandas

pip install -r requirements.txt
pip install pyota[ccurl]

Set time zone to Europe/Amsterdam:

sudo dpkg-reconfigure tzdata

Environment variables:

Generate a seed

cat /dev/urandom | LC_ALL=C tr -dc 'A-Z9' | fold -w 81 | head -n 1

add environment variables SEED and FLASK_APP:

export SEED=<yourseed>
export FLASK_APP=app.py

Install dependencies on Windows:

Get your wheel files here https://www.lfd.uci.edu/~gohlke/pythonlibs/

pip install gmpy2-2.0.8-cp36-cp36m-win_amd64.whl
pip install netifaces‑0.10.6‑cp36‑cp36m‑win_amd64.whl

add environment variables SEED and FLASK_APP

setx SEED <yourseed>
setx FLASH_APP app.y

Tests

Install dependencies:

pip install pytest

Run tests with:

pytest

Frontend

Serves the frontend on the display of the Pi. Talks with the backend.