Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Latest commit

 

History

History
65 lines (32 loc) · 4.71 KB

architecture.md

File metadata and controls

65 lines (32 loc) · 4.71 KB

Architectural Overview

This document outlines the overall architecture of the implemented prototype platform.

Archictechtural overview

At the core of the platform is the blockchain. It is intended to be the single source of truth where end-users, third-parties, etc. can verify GGOs. In this prototype, it is currently implemented using Hyperledger Sawtooth, but a replacement is already under way.

The blockchain implementation is detailed in this document .

Furthermore, a Python library has been developed to enable easy integration with the project's blockchain.

This service is responsible for bridging the danish DataHub with the rest of the platform. DataHub exposes metering points and measurements from the danish consumers via an API, and DataHubService uses this to fetch data for the platform's users. It imports measurements from DataHub and publishes them to the blockchain while at the same time issues GGOs to the blockchain for production meters.

DataHubService also exposes a few API endpoints to fetch metering points, measurements, and GGOs, and to create publicly available disclosed datasets.

To enable importing of data, users must onboard to DataHub via DataHubService. This process submits an authorization which allows DataHubService to import data for a consumer thus make it available to the rest of the platform.

DataHubService is open-source and can be found on GitHub.

Swagger API documentation

This service was intended as a way to abstract away the complexity of dealing directly with the blockchain, wallet, and keys to a more friendly account-oriented API. It keeps balance of GGOs and their state, while also exposing a number of endpoints to transfer GGOs to other accounts, and retire GGOs to measurements. Effectively AccountService has a copy of the GGOs on the blockchain to be able to index them for querying and other practical use-cases.

The complexity of dealing with asynchronous transactions on a blockchain is dealt with in AccountService, thus enabling much more pragmatic approaches to integrating with the platform's APIs.

AccountService also exposes endpoints to generate an environment declaration with detailed emission data and source technologies based on the account's actual consumption and GGOs.

AccountService is open-source and can be found on GitHub.

Swagger API documentation

The example application was created to illustrate the use of the APIs exposed by DataHubService and AccountService, while at the same time enabling the participants of the prototype to interact with the system without implementing their own clients.

Its interface allows users to set up GGO transfer agreements with other users, set up retiring of GGOs to their metering points, while also providing a visual overview of the user's current account balance of GGOs. Furthermore the user can easily generate and download an environment declaration in PDF format based on up-to-date/live data.

Transfer agreements are proposed by one user, then later accepted or declined by the counterpart user. They lasts for a specific period of time, and during this period up to a agreed-upon number of GGOs (energy measured in Watt-Hours) are transferred between the users. The receiving user is able to retire the inbound GGOs to their metering points, or transfer them further to other users, thus acting as a middle-man.

The example application is open-source and both the backend and the frontend can be found on GitHub.

TODO

OAuth2 is used for authorization, this enables the users to be able to delegate access to their data to third party clients.

TODO