This experimental SDK will help you to add to our existing Private Blockchain network to control an LED from your Raspberry Pi -3.
- Raspberry Pi 3 with Raspbian Jessie installed in 16 GB micro SD card.
- Stable internet connection with minimum 500 kbps speed.
Download or clone this GitHub repository in your RPI-3 and extract it to the Desktop, using below command.
$ cd Desktop $ git clone https://github.com/HurifyPlatform/IOTBlockchain-Ethereum-SDK.git $ cd IOTBlockchain-Ethereum-SDK
- Now you have successfully cloned the GitHub repository to your Desktop.
- To install the necessary software run the installation script using the below command.
$ sudo sh install.sh
- This script will first update your OS, then start to install the stable version of Golang, Go-Ethereum, node, and npm.
- After the installation, you will get a greeting messages with the version number of software installed.
- And then this script will allow you to enter into the geth console where you can join our Private Blockchain network, using the following commands.
In geth console
- Creating an account:
Password -- Give your custom password
Note: Remember your password, Since we can't able to change it in future.
- Connect to our Private Blockchain Network
- Check the peering
- Peering will initially take the time to happen. Once it was done then block synchronization will happen, which you can able to view it in your geth console.
contract.jsfile in the contract folder will help you to compile and deploy contract in blockchain.
Sample Code for controlling the LED on an IoT Device using IOTBlockchain-Ethereum-SDK was given in IoT-Blink folder.
This code will allow users to deploy the contract and control the blinkibng of LED based on the events.