Code Monkey home page Code Monkey logo

crypto-night's Introduction

Flowchain-app is an ultra light-weight runtime for flow-based IoT programming.

Flowchain

You can write IoT server, serverless server or localhost server with Flowchain in flow-based programming.

In the flowchain-app, IoT applications are described by a Graph in the JSON format. Flowchain-app can execute the graph as a service process (server) on various hardware, e.g., resource-constrained devices, single-board computers and desktops.

Usage

A easy way to start using flowchain-app is trying console.json.

$ git clone https://github.com/flowchain/flowchain.git
$ cd flowchain
$ npm install
$ export HOST=192.168.0.100
$ ./bin/init.js start graphs/console.json 
[devify] Starting coapBroker server...
WoT/CoAP server is listening at coap://192.168.0.100:8000

Flowchain-app is now listening at the host assigned by HOST environment variable. You can also export the PORT variable to specify the listening port.

Programing IoT device

It is out of scope of flowchain-app. However, there is an example showing a sample in which send sensor data to flowchain-app over CoAP. The following example uses a NodeMCU (aka ESP8266) device with Lua programming language.

-- Configure the ESP as a station (client)
wifi.setmode(wifi.STATION)  
wifi.sta.config("<SSID>", "<PASSWORD>")  
wifi.sta.autoconnect(1)

-- Create a CoAP client
cc = coap.Client()

-- Make a POST request
uri="coap://192.168.0.100:8000/object/12345678/send"

-- Setup a timer to send ADC data
tmr.alarm(0, 1000, 1, function() 
    buf = 
          "{" ..
          "\"quality\":" ..
          adc.read(0) ..
          "}"
    
    cc:post(uri, buf)
    print(buf)
end)

Programming Paradigm

Graph

Flowchain-app will execute the console.json file. The console.json is a sample graph described in JSON format.

{
    "author": "jollen",
    "type": "coapBroker",
    "connections": [
        {
            "upproc": "io.flowchain.console",
            "upport": "out",
            "downproc": "io.flowchain.fs",
            "downport": "in"
        }
    ]
}

The visual graph diagram is also shown as following.

Component

Flowchain-app components could be published as npm modules. One existing component is io.flowchain.console and accessible at io.flowchain.console.

Development Notes

Write Your Graph

There are several flowchain graph examples.

Add a New Component

  1. To develop custom components, please fork this example io.flowchain.console.

  2. Publish your component to npm.

  3. Update package.json by npm install <your-package> --save.

  4. Open lib/main.js file and require (include) your component into flowchain.

var components =[
  ...
  require('io.flowchain.console')
];

You could send a PR to flowchain. All flowchain-app components will also be listed at the flowchain.io website.

Why and What

  • Instead of the classical monolithic application programming model. Flowchain-app is the flow-based programming.

  • Flowchain-app is a flow-based runtime for JavaScript IoT application server.

  • Flowchain-app is a better approach to write IoT application servers.

  • Flowchain-app is based on devify-server.

  • Flowchain-app is one-way data flow design.

Internals

  • Flowchain-app has a ultra-lightweight flow-based runtime called fb0. fb0 is tiny with 300+ lines code.

  • Flowchain-app has CoAP/WebSocket URI-based protocol servers for interoperating with IoT devices.

Credits

Flowchain-app project is heavily inspired by J. Paul Morrison and FBP-like NoFlo.

fb0 is a FBP-like system and is a JavaScript system motivated by J. Paul Morrison, and which uses a number of the same terms and concepts.

Roadmap

  • [2017] Building flowchain-app on JerryScript, an ultra-lightweight JavaScript engine for the Internet of Things.

  • [2017] React component binding with state stores and Flux pattern.

  • [2017] Serverless IoT in a simpilicy way.

License

Flowchain-app is released under the MIT License.

crypto-night's People

Contributors

angelinahih avatar ellaine avatar jollen avatar loljenchun avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crypto-night's Issues

[Crypto Night] #8 證券通證標準簡介 - 以 ERC 1400 為例

【簡介】

本期 Crypto Night 小聚主題是「證券通證標準簡介 - 以 ERC 1400 為例」。

ERC 1400 是目前社群中最受到矚目的證券通證標準,其考量在證券流通的實際層面,鏈上和鏈下參與者間的互動是相當複雜的,因此應具備進行強制轉移的能力。ERC 1400 也增加了證券相關業務會使用到的函式,如證券增發與相關法律檔案儲存等,因此可適用於更複雜的證券相關業務場景。

【主題】

• 證券通證標準簡介
• ERC1400 標準之應用場景
• 通證合法合規化

[0330 Lab] 0x1b36804d875c4a1b2abc4dfa704e5a1ae3350ba4

{
"address": "0x1b36804d875c4a1b2abc4dfa704e5a1ae3350ba4",
"msg": "[Flowchain.io 13A396F776 0x1b36804d875c4a1b2abc4dfa704e5a1ae3350ba4]",
"sig": "0x023b1868938668bae1520a28e067ce4f96da0c288d59a574cca4dccb71c55c1126322c62c09fdbaa480f92b4fccdd9acbb8a0c66c8a4d7891563e729d0a54f7c1b",
"version": "2"
}

[Crypto Night] #7 霍格華茲的區塊鏈咒語: 解讀 Mimblewimble

簡介

Mimblewimble!!! ⚡️

出自哈利波特系列叢書,是一種可以讓中咒者無法洩露秘密的咒語。在區塊鏈的世界裡,Mimblewimble 則是數位資產 Beam 和 Grin 的底層協議。作為比特幣協議的改良版,在以 Mimblewimble 建立的區塊鏈網絡中,交易的各項要素都被層層加密隱藏,非交易參與者既查不到交易地址,也查不到交易金額,甚至連中間轉手的交易過程都查不到。

值得注意的是,簡化後的交易過程,使該協議在記錄同等內容的數據時,所耗費的帳本容量和網絡帶寬要遠遠小於比特幣協議,也就是說 Mimblewimble 的隱私性更強,能源消耗更低,究竟 Mimblewimble 是如何做到的?底下使用的密碼學技術有什麼玄機?

本次小聚將由 Jollen 帶領大家一探 Mimblewimble 的底層技術!

資訊

時間:2019 年 03 月 06 日 7pm-9pm
地點:Flowchain 台北總部
地址:台北市忠孝東路 4 段 178 號 7 樓
捷運:忠孝敦化站 3 號出口 步行 1 分鐘
費用:200元(學生可憑有效學生證報到,現場全額退費)

Crypto Night #3

日期:12/12
時間:19:00 - 21:00
活動內容:
19:00-20:00 區塊鏈 101 - 你今天哈希了嗎?
 - 講者: Makee首席講師Larry
20:00-21:00 Flowchain挖礦
 - 講者:Jollen

[Crypto Night] #9 IoT + 5G 世代:Flowchain 看物聯網的機會與挑戰

【簡介】

本期 Crypto Night 小聚主題是「IoT + 5G 世代 - Flowchain 看物聯網的機會與挑戰」。

本次主題將介紹在 IoT + 5G 新世代中,Flowchain 是如何解讀物聯網的機會與挑戰!Jollen 與 IoT 創客青年 Makee 團隊的黃正全將會由淺入深介紹 5G 架構,以及 IoT 裝置進入 5G 世代的整合應用,同時也會介紹 Flowchain 最新的心血結晶-Flowchain USB Dongle 在 IoT +5G 世代的角色與功能!

【主題】

• 5G 架構
• IoT 裝置在 5G 的整合應用
• Flowchain USB Dongle - Border Router

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.