How to run a Bitcoin node on a Raspberry Pi

in #bitcoin8 years ago (edited)

This is a tutorial on how to make a remotely accessible Bitcoin node on a Raspberry Pi.

Bitcoin is a fully digital P2P currency. It is the first decentralized peer-to-peer payment network that is powered only by users with no central authority or middlemen. From a user perspective, Bitcoin is pretty much like cash for the Internet.

Raspberry Pi is a credit card-sized ARM computer. It's cheap and can run variety of different linux programs. More information about it can be found at the Raspberry Pi Foundation's website.

To use Bitcoin you do not need to run a full node (you can for example use web-based wallets, such as Coinbase or Blockchain.info), but it helps the network by providing better availability.

REQUIREMENTS

Please note that this tutorial has been tested with Raspberry Pi 2 Model B. The previous models may not be powerful enough to run the full Bitcoin node.

SETUP

  • Install Raspbian
  • Login using your credentials
  • Update Raspbian to latest packages:

sudo apt-get update
sudo apt-get upgrade

  • Install some required dependencies for Bitcoin:

sudo apt-get install build-essential autoconf libssl-dev libboost-dev libboost-chrono-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libboost-thread-dev libtool

INSTALLING BERKELEY DB

Unfortunately Raspbian has a very old version of the Bitcoin client (called Bitcoin Core). That's why we need to install Bitcoin Core and Berkeley DB version 4.8 manually.

  • Download Berkeley DB version 4.8:

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz

  • Extract the file and change to that directory:

tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/

  • Configure the package:

../dist/configure --enable-cxx

  • Compile the package and install (this will take a while)

make
sudo make install

INSTALLING BITCOIN CORE

And finally, we can install the Bitcoin client.

  • Go to https://bitcoin.org/en/download and check the latest version (at the time of this writing it's 0.12.1. Substitute this number in future for yours if it's different)
  • Clone the git repository

git clone -b 0.12.1 https://github.com/bitcoin/bitcoin.git bitcoin-0.12.1
cd bitcoin-0.12.1

  • Configure the package

./autogen.sh
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"

  • Compile Bitcoin Core (this will take several hours)

make
sudo make install

USAGE

You now have a complete Bitcoin node installed. You can start it anywhere by typing:

bitcoind

Do remember to check the settings for bitcoind (with 'bitcoind --help'). One useful setting is -dbcache, which sets the database cache limit. Around 50-100 should be fine.

To run the client automatically on startup, edit '/etc/rc.local' file and append to the end of the file:

/usr/local/bin/bitcoind &

ADDITIONAL STUFF

Bitcoin uses port 8333 to communicate with the network, so make sure to open port on your router if necessary.

Syncing the whole blockchain can take days. To get current status of your client, you can run:

bitcoin-cli getinfo

You can find the latest blocks on blockexplorer.com.

You can access your computer remotely with SSH. Run the raspberry pi configuration tool and enable SSH server.

sudo raspi-config

Sort:  

hi i just posted an article a few days ago about a new os for Raspbery Pi and mini computers that supports many cryptocurrencies called ROKOS checkit out here:
https://steemit.com/cryptocurrency/@dasan-oneia/rokos-a-cryptocurrency-base-os-poised-to-to-power-the-hole-ecology-of-minicomputers-an-iot-devices

Congratulations @krisseck! You have received a personal award!

Happy Birthday - 1 Year on Steemit
Click on the badge to view your own Board of Honor on SteemitBoard.

For more information about this award, click here

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @krisseck! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 3 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.27
TRX 0.11
JST 0.031
BTC 67320.55
ETH 3709.85
USDT 1.00
SBD 3.78