This microservice was necessary for me to graduate in the Master's Degree in Cybersecurity. If interested, check MSC Daniel Andrade to know more!
The Renewable Energy Community Platform consists in a microservices API to enable and enhance Peer-to-Peer energy Transactions between Prosumers and consumers of a community.
This Repo is responsible for issuing transactions on Hedera Hashgraph, as well as creating new accounts and verifying newly created payments.
Why building a REC Platform using microservices:
- The project was developed together with other devs
- Changes in one particular module forced to shutdown/reboot the whole API.
- This is part of a research program, therefore multiple experimental ideas, frameworks, and scripts were used.
To make the API work, these are the core features of the Gateway:
The Transactions microservice requires Gateway to be operational as well as the REC market microservice to convert its objects and issue transactions.
Note: The gRPC protos import is missing, therefore it will not work!
To get it started:
- npm
npm install npm@latest -g
There is a secure communication between this microservice and the Market one, therefore ensure that a '.pem' certificate is stored as a secret (MarketCrt)! For more info check docker compose on REC Platform - Gateway
- Clone the repo
git clone https://github.com/AnBapDan/REC-Platform-Transactions.git
- Install NPM packages
npm install
- Enter the Profobuf repo in
package.json
on the dependencies tab"grpc-protos": "git+REPOSITORY",
The all microservices structure is supposed to be deployed using Docker Swarm. Below are the steps to achieve it correctly.
-
Create a network that hosts all the stack
docker network create --driver=overlay --attachable RECNetwork
-
Run every Dockerfile to create its image
docker build -t <img_name>:<version>
-
Deploy the whole Docker stack
docker stack deploy -c docker-compose.yml RECNetwork
docker ps -f "label=com.docker.swarm.service.name=RECNetwork_gateway" --format "{{.ID}}"
docker stack services RECNetwork
docker service logs <service_name>
docker exec -it <HASH_name> command
Daniel Andrade - dani.andrade@ua.pt
Project Link: https://github.com/AnBapDan/REC-Platform-Transactions.git