https://github.com/jollen/iot-blockchain-workshop
BTOSS: Blockchain Technology & Open Source Solutions
https://github.com/jollen/iot-blockchain-workshop
blockchain iot
Last synced: 3 months ago
JSON representation
BTOSS: Blockchain Technology & Open Source Solutions
- Host: GitHub
- URL: https://github.com/jollen/iot-blockchain-workshop
- Owner: jollen
- Created: 2017-03-03T05:40:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-04T12:18:43.000Z (over 9 years ago)
- Last Synced: 2025-03-12T12:29:47.266Z (about 1 year ago)
- Topics: blockchain, iot
- Homepage: http://btoss.kktix.cc/events/e68299ed-da105a
- Size: 13.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flowchain on MediaTek Linkt It Smart 7688
* Flowchain 是物聯網專用區塊鏈(IoT Blockchain)
* 在這次的體驗課程裡,將使用 MediaTek Linkt It Smart 7688 物聯網開發板,來驗體 IoT Blockchain 的幾個玩法
## 準備工作
* 請自備 Notebook 並安裝 Node.js v4.5 以上環境
* 能看懂基本的 JavaScript 語法 (optional)
## 安裝步驟
下載 Flowchain 系統:
```
$ git clone https://github.com/jollen/flowchain-core.git
$ npm install
$ export HOST=10.186.110.91
$ export PORT=8000
$ export DEBUGSERVER=10.186.110.91
```
修改 node.js 主程式:
```
// Start the server
server.start({
onstart: onstart,
onmessage: onmessage,
onquery: onquery,
ondata: ondata,
join: {
address: '10.186.110.91',
port: '8000'
}
});
```
執行程式:
```
$ node node.js
```
教室現場會準備 2 個 peer-to-peer 的 node,請修改 ```join``` 參數,加入任一個 peer node 即可。
## 挖礦
Flowchain 具備一個專為 IoT device 重新設計的挖嚝系統,這個系統採用 Mining-based Proof-of-Stake 機制;在資料的交易過程中,可以撰寫一份 Smart contract 來改變挖礦難度。
### Smart Contracts
Flowchain 底層有一個 Lua VM;可以使用 Lua 來撰寫 Smart contract。根據 Flowchain 的技術白皮書,來調整 Probability density 的值。撰寫一份 Smart contract 來 override 機率分佈函數:
```
function distributions.norm.pdf(x, mu, sigma)
return cephes.exp(-.5 * (x-mu)*(x-mu)/(sigma*sigma)) / math.sqrt(2.0*math.pi*sigma*sigma)
end
```
## Resources
* Flowchain, https://flowchain.io
* Top 10 Blockchain Companies to Watch in 2017, http://www.disruptordaily.com/top-10-blockchain-companies-to-watch-in-2017/