Book Image

Hands-On IoT Solutions with Blockchain

By : Maximiliano Santos, Enio Moura
Book Image

Hands-On IoT Solutions with Blockchain

By: Maximiliano Santos, Enio Moura

Overview of this book

Blockchain has been the hot topic of late thanks to cryptocurrencies. To make matters more interesting, the financial market is looking for ways to reduce operational costs and generate new business models, and this is where blockchain solutions come into the picture. In addition to this, with Internet of Things (IoT) trending and Arduino, Raspberry Pi, and other devices flooding the market, you can now create cheap devices even at home. Hands-On IoT Solutions with Blockchain starts with an overview of IoT concepts in the current business scenario. It then helps you develop your own device on the IBM Watson IoT platform and create your fi rst IoT solution using Watson and Intel Edison.Once you are familiar with IoT, you will learn about Blockchain technology and its use cases. You will also work with the Hyperledger framework and develop your own Blockchain network. As you progress through the chapters, you'll work with problem statements and learn how to design your solution architecture so that you can create your own integrated Blockchain and IoT solution. The next set of chapters will explain how to implement end-to-end Blockchain solutions with IoT using the IBM Cloud platform. By the end of this book, you will have mastered the convergence of IoT and Blockchain technology and exploited the best practices and drivers to develop a bulletproof integrated solution.
Table of Contents (15 chapters)
Title Page
About Packt
Contributors
Preface
Index

Creating the backend application


With the device firmware setup completed, it's now time to focus on developing the application that will process the device events and send commands so that John's plant will get watered when he's not home.

The code for the application will run on the IBM Cloud Platform (Bluemix). Since this is just an example application, we're going to use environment variables to store parameters (temperature and soil moisture thresholds).

 

Creating a Cloud Foundry application in the IBM Cloud Platform

  1. To create an application in IBM Cloud, access https://console.bluemix.net, select the Create Resource option, and select Cloud Foundry Apps in the left menu, followed by SDK for Node.js. After doing this, name the application and create the runtime:
  1. When application creation is complete, select Connections in the left menu and create a connection to the IoT service:
  1. After creating the connection to the IBM Watson IoT Platform organization, select the Runtimeoption in the left...