# Introduction of IOTA swarm node Swarm node 為 IOTA 開發人員 Come-from-beyond (CFB) 與 LiQio 所領導的專案,目前不太清楚實現的方式,以下是由 IOTA slack 中所獲得的片段資訊: * Swam node 用意在於幫助 Tangle 內的節點 (full node) 快速達到 fully-synced,以下是 Come-from-Beyond 的解釋: ``` Come-from-Beyond [4:52 AM] swarm nodes run swarm logic, it's far from logic of full nodes which share all txs with the… Come-from-Beyond [4:52 AM] swarm nodes establish links similar to pheromone trails of ants ``` * CFB 有意願拿 Swarm node 取代 full node (why???): 以下為 slack 對話紀錄: ``` Tim van Helsdingen [8:27 PM] no fullnodes in the future? how does that work? Come-from-Beyond in the future we won't use full nodes Posted in #generalDec 20th at 8:22 PM Mika Tuupola [8:28 PM] Swarm kind of nodes. [8:28] Ok with python script I can attach a transaction in 15 seconds. [8:28] Out of that network maybe 3-5 seconds. Mika Tuupola [8:28 PM] So PoW about 10 seconds (edited) ``` 一樣的描述,可在一篇 CFB 的[文章](https://medium.com/@comefrombeyond/thank-you-269640e794e7)中的節錄預見: ``` In the future the majority of the nodes will be swarm nodes forming clusters and using Swarm Intelligence. A swarm can process more transactions than a single full node. ``` * Swarm node 在你加入他們為鄰居之後,幾分鐘或幾小時內會開始有傳輸。 * Swarm node 關閉了 API & TCP port,目前只開放 UDP ## Swarm Node: * udp://94.156.128.15:14600 * udp://88.99.249.250:41041 (admin by CFB) * udp://185.181.8.149:14600 ## Add a Swarm Node * Add swarm node as neighbor (on node1) ``` { "address": "88.99.249.250:41041", "connectionType": "udp", "numberOfAllTransactions": 1, "numberOfInvalidTransactions": 0, "numberOfNewTransactions": 0, "numberOfRandomTransactionRequests": 0, "numberOfSentTransactions": 7 } ``` ## A food discussion about swarm node [Questions on IOTA scaling and use cases](https://www.reddit.com/r/Iota/comments/6le1i6/questions_on_iota_scaling_and_use_cases/) 這篇文章提到一個有趣的觀點,關於 CFB 定調後續會使用 swarm node 取代 full node 的一些 use case. 舉一個例子,我有一台烤麵包機,冰箱 ... ... 等等的 IOT 裝置,我有什麼動機在這麼低等的機器上運行 full node? 答案是,full node 除了要執行交易之外,還得要驗證交易以及儲存所有的分類帳,這種事情,恐怕只有交易所跟支付站才有真正的動機架設。 那麼低等的 IOT 裝置呢?他們只需要 swarm node,也就是說,IOT 裝置只需要發起 issue,驗證以及儲存分類帳可以轉嫁給 full node,怎麼做到呢?我們先以發起交易來討論,交易的發起步驟為: 1. signature 2. tip selection 3. POW 4. broadcast 由上述我們可以得知,只要有 tips 即可發起交易,最後再將 POW 過後的 trytes broadcast 給 full node 驗證就可以了。這就是 IOT 裝置該做的事情。(當然,前提還是 local snapshot 要實現,否則你無法只儲存 tips.) # TODO * HTTP request 辨識標籤 & callback function * 負載平衡 (動態重新導向 full-nodes) * 容錯機制 (AvailabilityDetection) * [IOTA REST API](https://iota.readme.io/reference) result cache * [Seed balance](https://iota.readme.io/reference#getbalances) (餘額) * [Transaction history](https://iota.readme.io/reference#findtransactions) (交易歷史紀錄)