JacobEberhardt / decentralized-energy-trading

Proof-of-Concept implementation of Privacy-Preserving Netting in Local Energy Grids
MIT License
9 stars 5 forks source link

noteId: "1e61fc70226911ea85c0fd637b375b0e" tags: []


Privacy-Preserving Netting in Local Energy Grids

Requirements

Get started

1.) Install dependencies

yarn install
yarn --cwd household-ui/ install

2.) Setup ZoKrates contract

yarn setup-zokrates
yarn update-contract-bytecodes

3.) Start the ethereum parity chain:

cd parity-authority
docker-compose up -d --build

ethstats is available at: http://localhost:3001

4.) Configure the contracts using truffle migrations:

yarn migrate-contracts-authority

5.) Start the Netting Entity:

yarn run-netting-entity -i 60000

6.) Create two databases for both household servers:

# Assumes project root directory
docker-compose -f mongo/docker-compose.yml up -d

7.) Start two household servers:

# Household 1
yarn run-server \
  -a 0x00aa39d30f0d20ff03a22ccfc30b7efbfca597c2 \
  -P node1 -n authority_1 \
  -d mongodb://127.0.0.1:27011
# Household 2
yarn run-server -p 3003 \
  -a 0x002e28950558fbede1a9675cb113f0bd20912019 \
  -P node2 -n authority_2 \
  -d mongodb://127.0.0.1:27012

Note: Depending on your network settings an extra flag -h 127.0.0.1 could be needed for both households.

8.) Start a mocked sensor for each household:

# Household 1 with positive energy balance
yarn run-sensor -p 3002 -e +
# Household 2 with negative energy balance
yarn run-sensor -p 3003 -e -

9.) Start two household-ui applications:

# Household 1
yarn --cwd household-ui/ start
# Household 2
REACT_APP_HSS_PORT=3003 \
 PORT=3010 \
 yarn --cwd household-ui/ start

Tests

Benchmarks

Development

Smart contract and ZoKrates program generation: