1

If I have a network made of IoT devices (contain 1000000 device). I need to manage them using a smart contract. And that contract contains a constant function (to avoid paying gas). How can this scenario achieve?
Can the IoT devices query that function in the contract without being a part of the etherum Blockchain as the devices are low constrained devices??

  • 1
    Can you tell us just a bit more about the scenario? What information will they be getting from your function? Are you familiar with Web3? – Shawn Tabrizi Aug 26 '18 at 5:46
  • Information like the version of Firmware they need. I am just new to solidity and web3 – Mohamed Aug 26 '18 at 6:15
1

Can the IoT devices query that function in the contract without being a part of the etherum Blockchain as the devices are low constrained devices?

  1. Queries to/Reading from the blockchain doesn't cost gas, but writing on the blockchain does.
  2. Yes IoT devices can query any public blockchain. You do not have to be part of the ethereum blockchain to read data from it... you just have to write code that does that for you. The code will depend on the operating system on the IoT devices and the coding language you choose to use.
1

Referring to @YulePale's answer: yes, the blockchain is public but you can't access it without a node which is connected to the blockchain. So in that sense you can't query the function without being a part of the Ethereum blockchain.

So all your IoT devices need to have access to some node which is connected to the blockchain. They can either run their own nodes (probably not a feasible idea for IoT devices) or use some more centralized node(s). The easiest way would be for you to host some nodes somewhere which provide the devices with the required access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.