Skip to main content

Energyweb

Summary

Energyweb if an Application framework designed to empower energy prosumers and utilities to leverage Blockchain and other cutting edge-cryptographic solutions. Just install it as a dependency with pip3 install energyweb. Create a python script and create your own App and Tasks importing classes from energyweb.dispatcher module.

Further development and contribution is much welcome, please contribute with issues and pull requests. :)

Features

  • Raw transactions signing
  • Extension and reusability through OOP
  • Event-loop logic with asynchronous I/O thread pool control
  • General application abstraction
  • General Ethereum VM based network client abstraction
  • EWF's Origin release A smart-contract support for energy consumption and production registry for REC generation

Suported Energy Data Sources

Roadmap

  • General EVM Smart-Contracts Event listener task trigger
  • Remote logging in cloud platform. Check a list here.
  • Message Queue for off-line resilience
  • Merkle-tree proofs for collected data. Check precise proofs and typescript implementation.
    • Field-level validation
    • Document integrity validation
    • Document structure enforcement
  • IPFS storage
    • UUID pre-calculation and validation for smart-contract integration
  • Enforce TLS/SSL over http
  • ARM TEE support:
    • Offloaded cryptography to hardware accelerators
    • Storage and access of the configuration file in secure enclave
    • Private key generation and signature in CryptoCell

Energy Assets Roadmap

Smart-Contracts Roadmap

  • EWF's Origin release B
  • Universal Sharing Network
  • EWF's User and Assets Registry
  • Your project here - We are open for suggestions!

Framework Architecture

The application consists of dynamically loading modules from the configuration file. After loading the modules, the main thread will spawn task threads when a trigger event occurs. In case the main thread dies or become a zombie, it must be restarted from an external command. It is the system administrator task to maintain services health, therefore no mitigation technique is applied.

A task can be of any nature, although it is a best practice that it's execution is finite and it's resource usage is predictable. This will avoid concurrence between tasks and possible deadlocks.

Modules

A list of short explanations about the modules and libraries that compose the framework.

EDS Energy Data Sources library has modules for supported smart-meter APIs including energyweb's specification written in Swagger, with this any utility or solar/wind farm could bundle many smart-meters and provide a simple Restful API using community provided code in many programming languages. Or even abstract legacy protocols instead of being forced to write a python module.

Energyweb module contains all abstract classes and interfaces to be inherited and implemented by concrete classes. It is the framework skeleton.

Smart_Contract library bundles all integration modules and assets to persist and query data on EVM based Blockchains. Most common assets are json files describing smart-contract ABI s.

Base58 module is a helper for parsing Bitcoin addresses IPFS file hashes.

Config module has json and yaml formatted application configuration files parsers. App configuration files add better deployment, management, credentials safety and extension capabilities. This module also performs dynamic python module loading, allowing any registered class to be instantiated and parametrized by demand. This feature combined with OOP allows for the same device to be able to change smart-meters and smart-contracts seamlessly.

Log writes a stream of characters to stdout and to files.

Storage supports EWF's Origin release A log storage, designed to record a sequence of off-chain files by updating the previous file contents SHA hash with the next. It is particularly useful to enforce data integrity, by comparing the sequence of raw smart-meter readings with the sequence registered on-chain.

Dispatcher module is helper for handling asynchronous non I/O blocking threads of event triggered tasks. Also know as or event loop it is the framework's main loop skeleton.

Event loop abstraction:

Event Loop

Example App

import energyweb
import datetime

class MyTask(energyweb.Task):
    """
    Example Task
    """

    def coroutine(self):
        print('Task {}: {}\n'.format(self.interval, datetime.datetime.now()))


class MyApp(energyweb.App):
    """
    Example Application
    """

    def prepare(self):
        print('{} Prepared'.format(self.__class__.__name__))

    def configure(self):
        t1 = MyTask(interval=energyweb.LifeCycle.FIVE_SECONDS)
        t2 = MyTask(interval=energyweb.LifeCycle.ONE_MINUTE, is_eager=False)
        [self.add_task(t) for t in [t2, t1]]

    def finish(self):
        print('{} Finished'.format(self.__class__.__name__))


app = MyApp()

"""
Test loop
"""
if __name__ == '__main__':
    app.run()

Release files for energyweb 0.4.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for energyweb 0.4.5
File Size Uploaded
energyweb-0.4.5.tar.gz 33.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for energyweb 0.4.5
File Interpreter ABI Platform
energyweb-0.4.5-py3-none-any.whl Python 3 none any Details

Total release size: 78.1 kB

Release files / energyweb-0.4.5.tar.gz

Download URL energyweb-0.4.5.tar.gz
Size 33.9 kB
Tags Source
SHA-256 checksum
How to use checksums
37e7371d2b9eed901b80ba6dc798dd89e7d690e9fc42c00b04ea3ad22896f2d5
BLAKE2b-256 checksum
How to use checksums
46acf9fabaf2e0ba9bf83cd9202b209ca373ed8a9fee1b0b2295d5a8ad5e91b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / energyweb-0.4.5-py3-none-any.whl

Download URL energyweb-0.4.5-py3-none-any.whl
Size 44.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c07513a60f05f5eb50472639edce09abfe470dfc44dba6dba384b8ddffe5d7aa
BLAKE2b-256 checksum
How to use checksums
53e368ef9103f832b187586f9cae8328a2ec0f7a6e11065771f75c40549c219c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

1 release file

0.3.9

1 release file

0.3.7

1 release file

0.3.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page