Hardware Link for COO
Energyweb link is a hardware oriented project to integrate energy assets to the Origin DAPP.
It is currently deployed on x86_64
, arm64
and armv8
architecture devices using balena.io. The devices logs carbon emission and generated/consumed power data into certificate of origin smart-contracts.
- Read or Create
PERSISTENCE
path pointed atcore\helper.py
. - Open and parse the designated configuration file.
- Instantiate classes by reflecting the objects in the config file.
- In case of failure on steps above throws.
- Log configuration.
- Schedule measurements.
- Wake up and try to read from input modules.
- Log success or failure.
- Create and sign a transaction to the designates smart contract.
- Try to reach blockchain client and send the transaction.
- Log success of failure.
- Back to step 6.
For a decentralized network infrastructure, it is fundamental that every power generating site runs and maintains its energyweb client, providing all participants the ability to be independent and part of the consensus regarding the state of the smart contracts it runs.
To facilitate the deployment and updating of these devices we use a continuous integration and fleet management platform.
- Artik710 development kit board. Buy it on Mouser. Or Raspberrypi v3 with python 3 installed.
- Ask EWF Ramp-up team for OS images.
- Burn the image using
dd
oretcher
. - Follow the official guide to update the MMC and boot from it.
- Blockchain client. For EWF Tobalaba test chain try one of the flavors below:
- Energyweb client installed and running.
- Parity v1.10.8 or later with
parity --jsonrpc-apis all --reserved-peers /assets/tobalaba-peers --chain tobalaba
. - Docker version of Parity
docker run parity/parity:latest --chain tobalaba --jsonrpc-apis all
. - More stable Docker version of Parity, change directory to
ewf-client\
and rundocker run -v $(pwd):/data parity/parity:v1.9.3 --jsonrpc-apis all --reserved-peers /data/tobalaba-peers --chain /data/chain.json
.
- COO contract deployed on the designated blockchain.
- Check the transactions on the block explorer.
- create a new project in
resin.io
- select
artik710
, add a new device, download the image - follow the instruction on screen to flash your device,
- after your device is available on the dashboard, open your
terminal
fo some cli fun. - change to this repository folder and run
git remote add resin <USERNAME>@git.resin.io:<USERNAME>/<APPNAME>.git
with your resin.io credentials. - run
source ./sendToResin.sh
. You should now see the resin.io unicorn on your terminal. - your device should start updating with the code you deployed.
- on the dashboard open your device, then open the
Service Variables
tab. - create a variable for
origin-producer
namedproducer
with the configuration file written in one line. - create a variable for
origin-consumer
namedconsumer
with the configuration file written in one line.
production configuration example:
{
"production": [
{
"energy": {
"module": "core.input.fronius",
"class_name": "LoxoneTest",
"class_parameters": {
"ip": "http://0.0.0.0:123",
"source": "Produced",
"user": "123",
"password": "123"
}
},
"carbonemission": {
"module": "core.input.carbonemission",
"class_name": "Wattime",
"class_parameters": {
"usr": "energyweb",
"pwd": "en3rgy!web",
"ba": "FR",
"hours_from_now": 24
}
},
"origin": {
"module": "core.abstract.bond",
"class_name": "OriginCredentials",
"class_parameters": {
"asset_id": 2,
"contract_address": "0xc73728651f498682ab56a2a82ca700e06949b9b4",
"wallet_add": "0x00C4D3aaB56dC8Be0dFE3AD7B1d418210172C578",
"wallet_pwd": "ea793f1e52af6d9dc650ee91bb6f0b701bff5f60b021cb06b1cb78574954ae91"
}
},
"name": "TestProducer"
}
],
"client": {
"module": "core.output.energyweb",
"class_name": "RemoteClientOriginProducer",
"class_parameters": {
"url": "https://tobalaba.slock.it/rpc:8545"
}
}
}
one line version
{ "production": [ { "energy": { "module": "core.input.fronius", "class_name": "LoxoneTest", "class_parameters": { "ip": "http://0.0.0.0:123", "source": "Produced", "user": "123", "password": "123" } }, "carbonemission": { "module": "core.input.carbonemission", "class_name": "Wattime", "class_parameters": { "usr": "energyweb", "pwd": "en3rgy!web", "ba": "FR", "hours_from_now": 24 } }, "origin": { "module": "core.abstract.bond", "class_name": "OriginCredentials", "class_parameters": { "asset_id": 2, "contract_address": "0xc73728651f498682ab56a2a82ca700e06949b9b4", "wallet_add": "0x00C4D3aaB56dC8Be0dFE3AD7B1d418210172C578", "wallet_pwd": "ea793f1e52af6d9dc650ee91bb6f0b701bff5f60b021cb06b1cb78574954ae91" } }, "name": "TestProducer" } ], "client": { "module": "core.output.energyweb", "class_name": "RemoteClientOriginProducer", "class_parameters": { "url": "https://tobalaba.slock.it/rpc:8545" } } }
consumption configuration example:
{
"consumption": [
{
"energy": {
"module": "core.input.fronius",
"class_name": "LoxoneTest",
"class_parameters": {
"ip": "http://0.0.0.0:123",
"source": "Consumed",
"user": "123",
"password": "123"
}
},
"origin": {
"module": "core.abstract.bond",
"class_name": "OriginCredentials",
"class_parameters": {
"asset_id": 2,
"contract_address": "0xc68fb291a6ddf3d4d9e3a061de39563bf269d868",
"wallet_add": "0x0088fF114071cD11D910A3C4C999215DbbF320fF",
"wallet_pwd": "8cc3187a123770c8b6b89ccee765fbfafc36d64d80a6f33d7e4ffc4ff638097f"
}
},
"name": "TestConsumer"
}
],
"client": {
"module": "core.output.energyweb",
"class_name": "RemoteClientOriginConsumer",
"class_parameters": {
"url": "https://tobalaba.slock.it/rpc:8545"
}
}
}
one line version
{ "consumption": [ { "energy": { "module": "core.input.fronius", "class_name": "LoxoneTest", "class_parameters": { "ip": "http://0.0.0.0:123", "source": "Consumed", "user": "123", "password": "123" } }, "origin": { "module": "core.abstract.bond", "class_name": "OriginCredentials", "class_parameters": { "asset_id": 2, "contract_address": "0xc68fb291a6ddf3d4d9e3a061de39563bf269d868", "wallet_add": "0x0088fF114071cD11D910A3C4C999215DbbF320fF", "wallet_pwd": "8cc3187a123770c8b6b89ccee765fbfafc36d64d80a6f33d7e4ffc4ff638097f" } }, "name": "TestConsumer" } ], "client": { "module": "core.output.energyweb", "class_name": "RemoteClientOriginConsumer", "class_parameters": { "url": "https://tobalaba.slock.it/rpc:8545" } } }