- Notifications
You must be signed in to change notification settings - Fork5
A Vue-based DApp to manage Digital Twin data on the Ethereum blockchain and Swarm DHT, including fine-grained access control.
License
sigma67/ethertwin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository is part of a research project on blockchain-based Digital Twins:https://doi.org/10.1016/j.ipm.2020.102425
TheEtherTwin prototype originates from a research approach to share Digital Twin data over its lifecycle.To allow the participation of the multiple lifecycle parties without relying on trusted third parties (TTPs),EtherTwin relies on a distributed approach by integrating theEthereum blockchain and the distributed hash table (DHT)Swarm.On the basis ofAutomationML (AML) files that specify assets, a Digital Twin can be created and shared with the twin's lifecycle parties.TheEtherTwin prototype allows to:
- create Digital Twins
- share each twin
- upload documents
- update twin specification and documents (versioning)
- create sensor data feeds
- control access of users by lifecycle roles and asset attributes
- list asset components (specification parsing)
An exemplary use case is given in the followingvideo. The video is based on a slightly outdated version of EtherTwin, but it illustrates the core functionality well.
Live demo: For a live demonstration of the prototype using a private Ethereum blockchain, visithttp://ethertwin.ur.de/.An Ethereum account will be automatically created for you with the private key stored in your browser's local storage. Before you can issue transactions, you'll need to request some Ether on our test blockchain athttp://ethertwin.ur.de:3333/0x0 (replace 0x0 with your Ethereum account).
npm install
DownloadParity to set up your Ethereum blockchain. Create a foldernetwork
, add theparity.exe
andpassword.txt
.Then run the following console command in thenetwork
folder to start your blockchain:
parity --config dev --unlock "0x00a329c0648769a73afac7f9381e08fb43dbea72" --password .\password.txt --unsafe-expose --jsonrpc-cors=all
DownloadSwarm to set up the DHT.Then run the following console command:
swarm --bzzaccount <accountAddress> --config ./config.toml --datadir . --httpaddr=0.0.0.0 --corsdomain '*' --password password.txt```
InstallTruffle to initialize the Smart Contracts:
npm -i truffletruffle migrate --network parity
Addconfig.json
with the corresponding values (IP) for the Swarm DHT etc.Note that the values for theregistry
andauthorization
are optional:
{ "swarm": "http://<IP>:5000", "ethereum": { "rpc": "ws://<IP>:8546", "registry": "<RegistryContractAddress>", "authorization": "<AuthorizationContractAddress>" } "agent_key": "<ethereum private key for device agent>"}
You also need to add an appropriate log file in themisc
folder, for example by renaminglogs.xml.example
tologs.xml
.
Run the device agent
npm run agent
Run the main web app for development with hot reloads
npm run serve
Build static files for deployment
npm run build
An exemplary specification for the twin creation can be found atmisc/CandyFactory.aml
, which originates from theCPS Twinning prototype.Various screenshots showing theEtherTwin prototype functionality can be found atmisc/Screenshots
. The following screenshot illustrates the Home site of ourEtherTwin prototype - showing all twins of the user.
Please consider citing our publication if you are using ourEtherTwin prototype for your research:https://doi.org/10.1016/j.ipm.2020.102425
B. Putz, M. Dietz, P. Empl, and G. Pernul, "EtherTwin: Blockchain-based Secure Digital Twin Information Management", Information Processing & Management, vol. 58, no. 1, 2021.