A prototypic implementation of EVA as part of my Master's Thesis.
Please find the publication here: EVA: Fair and Auditable Electric Vehicle Charging Service using Blockchain
To build and run the prototype, you need Node.js, Matlab (with Optimization Toolbox) and an Infura API Key (https://infura.io)
-
Put your Infura API Key at
<infura_api_key_here>
insmart_contracts/truffle.js
-
cd into
smart_contracts
directory -
npm install
-
truffle compile
-
truffle migrate --reset --network ropsten
-
Note the
address
where truffle deployed the contract and the ABI (insmart_contracts/build/contracts/Aggregator.json
) for later
- Start Matlab
- Add MatlabWebSocket to Java Classpath
- Execute command
edit(fullfile(prefdir,'javaclasspath.txt'))
- Add a new line with the path to
evadmm/matlab/matlabwebsocket/matlab-websocket-1.4.jar
- Save and restart Matlab
- Execute command
- In Matlab, add the
evadmm/matlab
folder including all subfolders to the current Matlab path - Run
StartEvAdmmServer.m
- Put your Infura API Key at
<infura_api_key_here>
inevadmm/evadmm_ethereum_bridge.js
- Update the variables
aggregatorContractABI
andaggregatorContract
inevadmm/evadmm_ethereum_bridge.js
according to the results from compilation & deployment - cd into
evadmm
directory npm install
node evadmm_schedule.js
-
Update the variables
aggregatorContractABI
andaggregatorContract
infrontend/index.js
according to the results from compilation & deployment -
cd into
frontend
directory -
npm install http-server
-
http-server
-
You can access the DApp using any DApp browser (e.g. MetaMask) on
http://localhost:8080
now -
Alternative: Deploy files on any webserver
- Put your Infura API Key at
<infura_api_key_here>
inevaluation/wallets.js
- Modify
evaluation/wallets.js
with test wallet mnemonics to your liking - Open a Node.js console, import the
wallets.js
module and fund your test wallets using thefundWallets
function
- Create a file
experiment.<experiment_name>.js in
evaluation` - Import the
simulation
module and override therunExperiment
function with your designed experiment - For examples, take a look at
evaluation/experiment.eva_luation.js
- cd into
evaluation
npm install
node experiment.<experiment_name>.js -s <Number of Simulations -r <Number of Rounds per Simulation
- The results will be collected in
experiment.<experiment_name>.<timestamp>.csv