Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
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. :)
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.
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:
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()
FAQs
Energy utility data interface for blockchain smart contracts
We found that energyweb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.