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_contractsdirectory -
npm install -
truffle compile -
truffle migrate --reset --network ropsten -
Note the
addresswhere 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/matlabfolder 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
aggregatorContractABIandaggregatorContractinevadmm/evadmm_ethereum_bridge.jsaccording to the results from compilation & deployment - cd into
evadmmdirectory npm installnode evadmm_schedule.js
-
Update the variables
aggregatorContractABIandaggregatorContractinfrontend/index.jsaccording to the results from compilation & deployment -
cd into
frontenddirectory -
npm install http-server -
http-server -
You can access the DApp using any DApp browser (e.g. MetaMask) on
http://localhost:8080now -
Alternative: Deploy files on any webserver
- Put your Infura API Key at
<infura_api_key_here>inevaluation/wallets.js - Modify
evaluation/wallets.jswith test wallet mnemonics to your liking - Open a Node.js console, import the
wallets.jsmodule and fund your test wallets using thefundWalletsfunction
- Create a file
experiment.<experiment_name>.js inevaluation` - Import the
simulationmodule and override therunExperimentfunction with your designed experiment - For examples, take a look at
evaluation/experiment.eva_luation.js
- cd into
evaluation npm installnode 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