The grey squares show the tips of the tangle.īelow you can see each endpoint used in the visualization and its description. The green transactions demonstrate the transactions that the currently selected peer (i.e. In the upper left part, the user can switch between peers. The tangle visualization looks like the figure below. to get the peer IP addresses in the Kubernetes cluster. Whereas in the visualization side Flask is used for service discovery, i.e. transaction creation time, transaction ID). Flask exposes in the peer side transaction information (e.g. To do so, we added multiple endpoints using theįlask micro-framework in the peer and the visualization as well. The visualization needs to use the service discovery of Kubernetes to find out how many active peers exist and how to reach them. First, we containerized the code so we could deploy it in the cluster. To integrate the visualization project, some adjustment to the code was necessary. Another motivation was the evaluation of the tip selection and transaction approval algorithms. As mentioned before, there was no way to see if the tangle was being built in the right way. The visualization shows the state of the tangle in a web browser. Open package.json, we will install the required libraries for iota: and socket.io: socket.io & socket.io-client.We subscribe to channel ID (root) to receive the stream of data from Tangle and send to HTML app via websocket.We will use the restricted mode with sidekey to publish the data to Tangle.We include the iota libraries and define the iota provider from Devnet.Generate some random numbers simulating sensor dataĬonst data = Math.floor((Math.random()*89)+10) Ĭonst dateTime = moment().utc().format('DD/MM/YYYY hh:mm:ss') Ĭonst json = `) MamState = Mam.changeMode(mamState, MODE) Ĭonst trytes = (JSON.stringify(packet)) Ĭonst message = Mam.create(mamState, trytes) Ĭonsole.log('Address: ', message.address) Īwait Mam.attach(message.payload, message.address) MamState = Mam.changeMode(mamState, MODE, key) Let mamState = Mam.init(iota, undefined, SECURITYLEVEL) Ĭonst key = (SIDEKEY) If you do, make the same changes in mam_receive.js file.Ĭonst Mam = require('./lib/') Ĭonst MODE = 'restricted' // public, private or restrictedĬonst SIDEKEY = 'mysecret' // Enter only ASCII characters. The published data can be viewed using the mam_receive.js file orġ) You can change the default settings: MODE, SIDEKEY, SECURITYLEVEL or TIMEINTERVAL This file will work on a computer or Raspberry Pi. The mam_publish.js file publishes random generated numbers on the tangle using MAM. Create NodeJS app mam_publish.js to emulate the sensor reading and publish the data to Tangle.To display the temperature data in real time without need to refresh the browser. SAP Analytics Cloud Analytics Application.HTML app to embed the SAP Analytics Cloud in an iFrame and receive the stream of data from NodeJS App and send to SAP Analytics Cloud. NodeJS app to receive the stream of data from Tangle and send to HTML app via websocket, socket.io that we installed in HANA XSA. We will use the side_key to encrypt and decrypt the data. Sensor Device: NodeJS app mam_publish.js to emulate the sensor temperature data reading and send the data in MAM to Tangle with restricted mode.In a nutshell, we will create the following parts: The message is encrypted by the side_key. Restricted mode: Anyone with a side_keyhas access to the message.Private mode: Only the publisher has access to the message.Public mode: Anyone has access to the message.There are different type of privacy modes when we publish the message with MAM to Tangle: Only those with the right channel IDs (The channel ID is also called the root) can get access to the message. IOTA MAM makes possible for the the devices to encrypt the data streams and securely store those in Tangle each on separate address and only authorized parties that will be able to read and parse the message streams. This is why sometimes a small disconnected tangle shows up, mostly right after you open the viz. A continuous message stream is created on the Tangle and will continue until the device stop publishing the data ( Messaging). Since the visualizer does not show the entire tangle from the beginning of time, sometimes a transaction that validates two transactions that your computer hasnt seen (but nonetheless are in the tangle) gets sent to you.The message is confirmed to be coming from the device ( Authenticated).In this tutorial, we will create simple scenarios to send the IoT temperature data to the IOTA Tangle using Masked Authentication Messaging (MAM) which means that: But its technology is also well suited for payments between humans as well. IOTA is an open source distributed ledger called Tangle that is developed for Internet of Things (IoTs) or Machine to Machine (M2M) economy. In order to build this app, you need to have the following components: In this blog, we’ll learn how to send the IoT data to the IOTA Tangle with SAP HANA XSA and display it real time in SAP Analytics Cloud.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |