Here we use a simple wifi-sensing task as an instance to show how our framework works.
Detailed introduction at: https://ohyoukillkenny.github.io/blog/2018/04/10/LearnSolidity5/
- Configure MetaMask in google chrome.
- Install web3.js, detailed at official documents.
Then, in order to achieve the interaction between web3.js and smart contract, we need to build a virtualized server for local webpages. Here, we use lite-server to achieve this goal, which can be installed by:
- Input text in Command Line under the folder of web.js:
>> npm install lite-server --save-dev
Notes: If web.js is installed globally in the prior operation, the user needs to text innpm init
first.
- open package.json, add text below in
scripts
:
"scripts": {
"dev": "lite-server"
},
- If you want to play the role as the requester, you need to rename index-requester.html as index.html first; So as the worker, you need to rename index-worker.html as index.html first.
- After we get the index.html under current directory, text code below in the Command Line:
>> npm run dev
Important: You can find more detailed configuration at Youtube Video.