The SensorDApp Tutorial
This is the first in a series of step by step tutorials on how to develop a decentralized application
The Teloscope team believes in the importance of producing DApps’ development tutorials in order to spur coding interest among the Telos community and foster new and amazing use cases.
Part 1 of
This article serves as an introduction and is the first in a series of step by step tutorials on how to develop a decentralized application (or DApp) for the Telos blockchain network. Although in the future we will focus on quick snippets that explain how to implement particular functionalities, in this series we will focus on basic concepts. So you can build your first Telos Dapp from scratch. The final outcome will be a simple yet effective IoT-related DApp. We will call it “SensorDApp”.
The SensorDApp has a sheer, simple aspiration: let you store sensors’ data directly into the Telos Blockchain. We selected this scope because it proves two great advantages of Telos: high transaction capacity and no need of user payment whenever data is “stored” into the blockchain.
We conceived this DApp to be easy to use and to implement, so it requires as little hardware as possible — in fact you don’t even need the hardware if you just want to learn how to code the DApp. And if you go for the full experience you only need to add this affordable minimum:
- A Raspberry Pi model 3 small single-board computer. (Est. price: $40)
- An AM2303 humidity and temperature sensor. (Est. price: $10)
Well, now let’s go down the rabbit hole…
We have broken down the development of SensorDApp into 5 easy b̵u̵t̵ ̵s̵o̵c̵i̵a̵l̵ ̵t̵i̵m̵e̵ ̵c̵o̵n̵s̵u̵m̵i̵n̵g̵ steps:
- Develop and successfully deploy a smart contract on the Telos Tesnet, which will be able to store data of sensors associated with an account. The advantage of being a smart contract designed to store the sensors’ data is that the DApp will not make use of your RAM in Telos. You will only need to “pay” for allocating CPU and bandwidth resources.
- Connect the Raspberry Pi with a Telos API node, so that it can make transactions with the network in real time.
- Develop the front-end of the application, where you can get the values for a sensor and graphically visualize them.
- Deploy the DApp on IPFS, so that there is no need for more infrastructure dedicated to the front-end than the Raspberry Pi.
- Finally, we will guide you through the whole process of running the DApp, from creating the accounts, creating the sensors and inserting them into the front-end.
Once you had completed all the chapters in this tutorial, you will be able to deploy your own sensor to store its data on the Telos blockchain.
So stay tuned to keep up with the following articles if you want to learn the wonders of coding DApps for Telos.
If you are in the mood for the second part of the tutorial see below…
Save and retrieve data using Multi Index Tables
The second part of this tutorial series starts a trilogy of articles centered on the smart contract development.
And if you want to connect directly with the community of creators and developers of DApps for Telos, please join the Telos Dapp Development telegram group.
This tutorial has been created by members of The Teloscope team.
You can support us by including theteloscope among the list of BPs that deserve your vote.