Welcome to part 1 of a 3 part tutorial on how to create a Bitcoin stat monitor application for a Raspberry Pi. We will be building a cross-platform Electron application that is powered by Node.js/Express, Angular and the Blockchain.info API. The application will display current stats about Bitcoin and the blockchain in general. Stats such as current price, current hashrate, real-time transactions, progress to the next halvening as well as anything else we can think of along the way. The application will run on our Raspberry Pi and be displayed via a connected 7" touch screen display.
Sounds cool, eh? Read on and let's get started!
If you are new to the world of Raspberry Pi, I would recommend following this guide to quickly get up to speed and setup your Pi. Feel free to skip the section on setting up a remote file share as we won't need that functionality for this project.
Connecting The Display
Before we wire up and connect the touch display, we must ensure that we have the latest updates to Raspbian and it's dependencies. First ensure your device has internet connectivity and then run the commands below.
sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade
After the Pi is updated, shut it down, unplug everything and put it to the side. If you have purchased the SmartPi touch screen and stand, follow the video below for assembly instructions. If you have just the touch display, follow this guide for wiring and connecting. Otherwise if you have plan using just a standard monitor to display the Pi screen, feel free to go on to part 2 of this series.
Here is my setup thus far.
Installing NodeJs & NPM
Depending on which linux distribution you are running on your Pi, Node and NPM may or may not already be installed. To check, from your command line, run the command found below. If they are both installed, you should see similar output.
node -v > v0.10.29 npm -v > 1.4.21
If you get one or more messages saying
bash: node: command not found, that means Node and/or NPM are not yet installed. If the version of Node is less than 6, please update to at least that version by running the following commands as root.
curl -sL https://deb.nodesource.com/setup_6.x | bash - apt-get install -y nodejs
Note: If you'd prefer to install a specific version of Node, this Nodesource page has instructions on how to do just that.
Now that our Pi has all the latest updates, Node.js/NPM installed and connected to a display in some fashion. Let's move onto part 2 of this tutorial and build our Electron application!