Coder Social home page Coder Social logo

iot-blockchain-workshop's Introduction

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

iot-blockchain-workshop's People

Contributors

jollen avatar

Stargazers

 avatar

Watchers

James Cloos avatar Pei-Ya Chiu avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.