Bitcoin Forum
November 09, 2024, 01:07:27 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Running Bitcoind on Raspberry Pi?  (Read 5503 times)
bdangles (OP)
Member
**
Offline Offline

Activity: 100
Merit: 10


View Profile
October 24, 2014, 02:19:26 AM
 #1

Is it possible? how demanding is bitcoind as a server?
side note: I would probably store the blockchain on a 64GB usb instead of the memory card
notlist3d
Legendary
*
Offline Offline

Activity: 1456
Merit: 1000



View Profile
October 24, 2014, 02:26:54 AM
 #2

Is it possible? how demanding is bitcoind as a server?
side note: I would probably store the blockchain on a 64GB usb instead of the memory card

Yes a lot do use a raspberry pi as a form of cold storage.  You might think of a wallet that does not need the chain as you will not want to download new each time you use it.
szmarco
Hero Member
*****
Offline Offline

Activity: 574
Merit: 500



View Profile
October 24, 2014, 02:28:29 AM
 #3

Yes,It's possible.
Bicoind has the linux version.One of my friend have done it one year ago.
nextblast
Hero Member
*****
Offline Offline

Activity: 658
Merit: 500



View Profile
October 24, 2014, 03:17:59 AM
 #4

Yes, it's possible. But it may be too slow. I guess its better to run Bitcoind on a PC and invoke remote RPC from Raspberry Pi.
FinanceUS
Member
**
Offline Offline

Activity: 68
Merit: 10


View Profile
October 24, 2014, 05:59:31 AM
 #5

Yes, it's possible. But it may be too slow. I guess its better to run Bitcoind on a PC and invoke remote RPC from Raspberry Pi.


I'm also interested in it but may I know in more details how to run remote RPC for Bitcoind from Raspberry Pi?

If it's not too difficult I may want to set up one.
ferdinant
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
October 24, 2014, 06:27:21 AM
 #6

How difficult it may get ? What is the best raspery-pi version right now ?
Zelek Uther
Hero Member
*****
Offline Offline

Activity: 700
Merit: 504


Run a Bitcoin node.


View Profile
January 16, 2015, 10:08:37 PM
Last edit: January 27, 2015, 07:19:30 AM by Zelek Uther
 #7

Here is how I compiled the latest stable version of bitcoind (v0.10.0rc2 at the time of writing) on my Raspberry Pi.

Firstly I installed Raspbian on an SD Card. I'm doing this as a proof of concept, so I'm using a 64GB SD Card just to prove that it works. In future, the blockchain won't fit on a 64GB SD Card, so I'll either migrate to a larger SD Card or move the blockchain over to an external hard drive (more likely, as this is the cheaper option).

Installation Steps
sudo apt-get update && sudo apt-get dist-upgrade

Skipped the step to install Berkeley DB v4.8 as don't need a wallet on the Bitcoin Node.

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

mkdir ~/bitcoin
cd ~/bitcoin
git clone -b v0.10.0rc2 git://github.com/bitcoin/bitcoin.git
cd bitcoin
./autogen.sh
./configure --disable-wallet --without-miniupnpc
make
strip ~/bitcoin/bitcoin/src/bitcoind
strip ~/bitcoin/bitcoin/src/bitcoin-cli
sudo cp -a ~/bitcoin/bitcoin/src/bitcoind /usr/local/bin/
sudo cp -a ~/bitcoin/bitcoin/src/bitcoin-cli /usr/local/bin/
cd ~/bitcoin
mv bitcoin bitcoin-0.10.0rc2

References
The above steps were modified from instructions from http://blog.pryds.eu/2014/06/compile-bitcoin-core-on-raspberry-pi.html?m=1 and https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md

Bootstrapping the blockchain
I already had a bitcoin node on a laptop running Linux Mint 16, so I copied the blockchain onto the SD Card from the the laptop.
The laptop installation was my first node. To bootstrap the blockchain, I downloaded bootstrap.dat (a previous copy of the block chain) using BitTorrent (Transmission on Linux) and put it in the Bitcoin Core data directory before starting bitcoind.
https://bitcoin.org/en/download

While the laptop was unpacking bootstrap.dat to create a local copy of the blockchain, the CPU usage was pretty high. I suspect this step would take a long time on the Raspberry Pi (and may need more RAM too).

The Bitcoin Core data directory is:
~/.bitcoin

From https://github.com/bitcoin/bitcoin/blob/master/doc/bootstrap.md

To start bitcoind manually
bitcoind

To stop bitcoind
bitcoin-cli stop

To get information
bitcoin-cli getinfo

To start bitcoind automatically at startup
crontab -e

Add this line to the end:
@reboot /usr/local/bin/bitcoind &

Performance on the Raspberry Pi
I have forwarded port 8333 on my router to the Raspberry Pi, and the RPi has been running a fully up to date (i.e. has all blocks, fully downloaded) blockchain for nearly 4 hours now:

pi@raspberrypi7 ~ $ uptime
 14:48:17 up  3:51,  1 user,  load average: 0.22, 0.14, 0.22

pi@raspberrypi7 ~ $ bitcoin-cli getinfo
{
    "version" : 100000,
    "protocolversion" : 70002,
    "blocks" : 339279,
    "timeoffset" : -1,
    "connections" : 19,
    "proxy" : "",
    "difficulty" : 43971662056.08957672,
    "testnet" : false,
    "relayfee" : 0.00001000,
    "errors" : ""
}

Load averages of around 0.2 means that the Raspberry Pi still has plenty of time to twiddle its thumbs while dealing with its duties as a bitcoin node.

2015-01-26 performance update:
The Raspberry Pi has been running a fully up to date (i.e. has all blocks, fully downloaded) blockchain for 9 days now:

pi@raspberrypi7 ~ $ uptime
 21:24:33 up 9 days, 10:27,  1 user,  load average: 1.10, 0.98, 0.92

pi@raspberrypi7 ~ $ bitcoin-cli getinfo
{
    "version" : 100000,
    "protocolversion" : 70002,
    "blocks" : 340525,
    "timeoffset" : -1,
    "connections" : 67,
    "proxy" : "",
    "difficulty" : 43971662056.08957672,
    "testnet" : false,
    "relayfee" : 0.00001000,
    "errors" : ""
}

From ifconfig:
          RX bytes:789344501 (752.7 MiB)  TX bytes:4062070803 (3.7 GiB)

With 67 connections: Load averages of around 1 means that the Raspberry Pi is able to perform its duties as a bitcoin node, however it is near its limit in terms of handling the load.

2015-01-27 update:
From ifconfig:
          RX bytes:1543876865 (1.4 GiB)  TX bytes:2343796284 (2.1 GiB)

I was wondering why the TX bytes shown under ifconfig had gone down - how could that be possible? The answer: the Raspberry Pi is a 32-bit machine and when the bytes counter hits 4 GiB it resets to 0! So if tracking how much upload traffic your Bitcoin Node is serving is important, the RPi is not the ideal platform.


Run a Bitcoin node, support the network.
alamanjani
Full Member
***
Offline Offline

Activity: 136
Merit: 100


View Profile
January 17, 2015, 04:01:00 AM
 #8

Very interesting!
Thank you for sharing

Michail1
Legendary
*
Offline Offline

Activity: 1499
Merit: 1164



View Profile WWW
January 17, 2015, 09:13:14 PM
 #9

Here is how I compiled the latest stable version of bitcoind (v0.10.0rc2 at the time of writing) on my Raspberry Pi.

Firstly I installed Raspbian on an SD Card. I'm doing this as a proof of concept, so I'm using a 64GB SD Card just to prove that it works. In future, the blockchain won't fit on a 64GB SD Card, so I'll either migrate to a larger SD Card or move the blockchain over to an external hard drive (more likely, as this is the cheaper option).
....

While the laptop was unpacking bootstrap.dat to create a local copy of the blockchain, the CPU usage was pretty high. I suspect this step would take a long time on the Raspberry Pi (and may need more RAM too).


Nice to see a thread that keeps updating the Pi setup.  I run 3 full nodes on them.  (Thanks for the link to this thread from the other)

I will be updating to .10.orc2 this weekend.

You mentioned downloading the chain.  Well, when I did it a year ago, it took the chain 28 days to download with bootstrap.  That was at 16gb.  The chain has since doubled, so it would take much longer.  So, import seems the only way to go and the only reason I would decide against changing the version in fear it may mess up the chainstate.  Guess I will find out.  Smiley   (The big issue was that I could not use the blockchain/chainstate data from a Windows or std linux install, because the "Berkeley DB v4.8" implementation (as explained to me) was different and it made the files incompatible.

Also, in the other thread, you asked about how to change the data directory.
the command is:  -datadir=dir.
example:   bitcoind -datadir=/tmp

With the Pi; however, I would suggest the method I used.

Simple, I use the SDslot simply as the boot device (256mb card is plenty), and have it boot to the OS on the external drive (usb).
To further save power and time, I use a micro SSD drive (64GB (which obviously will have to upgraded at the rate the blockchain is increasing and assuming the Pi will continue to work for bitcoind)) so that no more power is needed - because it is supplied via USB.
Using an external drive for the OS also means you don't have to worry about the data directory since the main drive is the full external (by default).

Also, I have this running on a Solid-Run CuBox-i4Pro  (That was an entirely different headache but way faster than the Pi). 


Reynaldo
Legendary
*
Offline Offline

Activity: 1143
Merit: 1000


View Profile
January 20, 2015, 01:47:10 AM
 #10

Here is how I compiled the latest stable version of bitcoind (v0.10.0rc2 at the time of writing) on my Raspberry Pi.

Firstly I installed Raspbian on an SD Card. I'm doing this as a proof of concept, so I'm using a 64GB SD Card just to prove that it works. In future, the blockchain won't fit on a 64GB SD Card, so I'll either migrate to a larger SD Card or move the blockchain over to an external hard drive (more likely, as this is the cheaper option).
....

While the laptop was unpacking bootstrap.dat to create a local copy of the blockchain, the CPU usage was pretty high. I suspect this step would take a long time on the Raspberry Pi (and may need more RAM too).


Nice to see a thread that keeps updating the Pi setup.  I run 3 full nodes on them.  (Thanks for the link to this thread from the other)

I will be updating to .10.orc2 this weekend.

You mentioned downloading the chain.  Well, when I did it a year ago, it took the chain 28 days to download with bootstrap.  That was at 16gb.  The chain has since doubled, so it would take much longer.  So, import seems the only way to go and the only reason I would decide against changing the version in fear it may mess up the chainstate.  Guess I will find out.  Smiley   (The big issue was that I could not use the blockchain/chainstate data from a Windows or std linux install, because the "Berkeley DB v4.8" implementation (as explained to me) was different and it made the files incompatible.

Also, in the other thread, you asked about how to change the data directory.
the command is:  -datadir=dir.
example:   bitcoind -datadir=/tmp

With the Pi; however, I would suggest the method I used.

Simple, I use the SDslot simply as the boot device (256mb card is plenty), and have it boot to the OS on the external drive (usb).
To further save power and time, I use a micro SSD drive (64GB (which obviously will have to upgraded at the rate the blockchain is increasing and assuming the Pi will continue to work for bitcoind)) so that no more power is needed - because it is supplied via USB.
Using an external drive for the OS also means you don't have to worry about the data directory since the main drive is the full external (by default).

Also, I have this running on a Solid-Run CuBox-i4Pro  (That was an entirely different headache but way faster than the Pi). 



using sdcard is not recommended, they will tear off and die, no matter what size you use.

Be sure to move /tmp /tmpfs /var (or any folder that constantly needs writing) from sdcard and mount your external hdd on /home/user/ and then proceed to install the blockchain there

heslo
Legendary
*
Offline Offline

Activity: 1221
Merit: 1184


View Profile
January 20, 2015, 01:27:29 PM
 #11

Here is how I compiled the latest stable version of bitcoind (v0.10.0rc2 at the time of writing) on my Raspberry Pi.

Firstly I installed Raspbian on an SD Card. I'm doing this as a proof of concept, so I'm using a 64GB SD Card just to prove that it works. In future, the blockchain won't fit on a 64GB SD Card, so I'll either migrate to a larger SD Card or move the blockchain over to an external hard drive (more likely, as this is the cheaper option).
....

While the laptop was unpacking bootstrap.dat to create a local copy of the blockchain, the CPU usage was pretty high. I suspect this step would take a long time on the Raspberry Pi (and may need more RAM too).


Nice to see a thread that keeps updating the Pi setup.  I run 3 full nodes on them.  (Thanks for the link to this thread from the other)

I will be updating to .10.orc2 this weekend.

You mentioned downloading the chain.  Well, when I did it a year ago, it took the chain 28 days to download with bootstrap.  That was at 16gb.  The chain has since doubled, so it would take much longer.  So, import seems the only way to go and the only reason I would decide against changing the version in fear it may mess up the chainstate.  Guess I will find out.  Smiley   (The big issue was that I could not use the blockchain/chainstate data from a Windows or std linux install, because the "Berkeley DB v4.8" implementation (as explained to me) was different and it made the files incompatible.

Also, in the other thread, you asked about how to change the data directory.
the command is:  -datadir=dir.
example:   bitcoind -datadir=/tmp

With the Pi; however, I would suggest the method I used.

Simple, I use the SDslot simply as the boot device (256mb card is plenty), and have it boot to the OS on the external drive (usb).
To further save power and time, I use a micro SSD drive (64GB (which obviously will have to upgraded at the rate the blockchain is increasing and assuming the Pi will continue to work for bitcoind)) so that no more power is needed - because it is supplied via USB.
Using an external drive for the OS also means you don't have to worry about the data directory since the main drive is the full external (by default).

Also, I have this running on a Solid-Run CuBox-i4Pro  (That was an entirely different headache but way faster than the Pi). 



using sdcard is not recommended, they will tear off and die, no matter what size you use.

Be sure to move /tmp /tmpfs /var (or any folder that constantly needs writing) from sdcard and mount your external hdd on /home/user/ and then proceed to install the blockchain there



Total fucking Linux noob here man, how would you go about doing such a thing? I've interested Smiley
bluemountain
Full Member
***
Offline Offline

Activity: 197
Merit: 100


View Profile
January 20, 2015, 01:45:38 PM
 #12

You can get the Armory bundle here for Rasberry Pi, it might be easier to install and run than the bitcoind https://bitcoinarmory.com/download/
Michail1
Legendary
*
Offline Offline

Activity: 1499
Merit: 1164



View Profile WWW
January 23, 2015, 06:43:23 AM
 #13

Zelek Uther

With Wheezy release from 12/24/14 (newest at this time), your steps work except...
yum install libtools

After upgrading, my chainstate was no longer valid.  So, it will take 4 weeks plus in order to catch up.   Worried that the blocks might be changed/corrupt, I am setting up another one to start from scratch.

You were able to use the blocks/chainstate from what?  (Or, you only copied the blocks and it will take a long time to reindex?)

Michail1
Legendary
*
Offline Offline

Activity: 1499
Merit: 1164



View Profile WWW
January 23, 2015, 06:44:12 AM
 #14

You can get the Armory bundle here for Rasberry Pi, it might be easier to install and run than the bitcoind https://bitcoinarmory.com/download/

Definately easier; however, the point of this thread is to run a full node.  Not as a wallet.  Smiley

Michail1
Legendary
*
Offline Offline

Activity: 1499
Merit: 1164



View Profile WWW
January 23, 2015, 06:50:31 AM
 #15


using sdcard is not recommended, they will tear off and die, no matter what size you use.

Be sure to move /tmp /tmpfs /var (or any folder that constantly needs writing) from sdcard and mount your external hdd on /home/user/ and then proceed to install the blockchain there


Maybe you're not familiar with an Rpi.  You have NO choice.  The rpi uses the SDCard for the boot/kernal.

So, you simply have the OS/Data on the external drive.  It only needs the SDCard for the miliseconds of power up in order to boot to the drive.
Basically, I think you missed that I said that, which is why I said you only need a small SDCard for that and the smallest I could find was 256MB; however, smallest available in any store or online is 2GB.


jaberwock
Legendary
*
Offline Offline

Activity: 2730
Merit: 1127



View Profile
January 23, 2015, 06:56:56 AM
 #16

I think might not be the best long term solution because in some years the blockchain can get really big. Specially if we reach moon.

Michail1
Legendary
*
Offline Offline

Activity: 1499
Merit: 1164



View Profile WWW
January 23, 2015, 07:05:22 AM
 #17

I think might not be the best long term solution because in some years the blockchain can get really big. Specially if we reach moon.

Agreed.  Using a Pi is not anywhere near the best solution.  it's a cheap, low power experiment which handles it currently.

Blockchain is getting big no matter what platform though.

Also, we need full nodes no matter the platform.  It's what makes it decentralized and in turn what makes the system work.

Lincoln6Echo
Legendary
*
Offline Offline

Activity: 2461
Merit: 1058


Don't use bitcoin.de if you care about privacy!


View Profile
February 01, 2015, 07:53:00 PM
 #18


I'm trying to support the network with running bitcoind on a Banana Pi (nearly a raspberrry pi but with Dualcore CPU, 1GB Ram and SATA) with aligned raspbian OS and used Zelek Uther instructions. Unfortunatly i get this error (see last line):

root@lemaker:~# mkdir ~/bitcoin
root@lemaker:~# cd ~/bitcoin
root@lemaker:~/bitcoin# git clone -b v0.10.0rc2 git://github.com/bitcoin/bitcoin.git
Cloning into 'bitcoin'...
remote: Counting objects: 50638, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 50638 (delta 2), reused 1 (delta 0)
Receiving objects: 100% (50638/50638), 44.08 MiB | 665 KiB/s, done.
Resolving deltas: 100% (36643/36643), done.
Note: checking out '4e7c219122eccc6eca66d4cf95c697bea1480aab'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

root@lemaker:~/bitcoin# cd bitcoin
root@lemaker:~/bitcoin/bitcoin# ./autogen.sh
./autogen.sh: 9: ./autogen.sh: autoreconf: not found

Maybe someone knows why autogen.sh doesn't work? Thanks for your help.
Lincoln6Echo
Legendary
*
Offline Offline

Activity: 2461
Merit: 1058


Don't use bitcoin.de if you care about privacy!


View Profile
February 03, 2015, 06:29:39 PM
 #19

Solution to this problem is:
Quote
sudo apt-get install autoconf
Thanks@Zelek Uther  Wink

Didn't know that this doesn't come preinstalled with the Raspbian Distro for the Banana Pi. Now there are some new errors so I have to google some more... Roll Eyes

Zelek Uther
Hero Member
*****
Offline Offline

Activity: 700
Merit: 504


Run a Bitcoin node.


View Profile
February 03, 2015, 07:22:12 PM
 #20

Solution to this problem is:
Quote
sudo apt-get install autoconf
Thanks@Zelek Uther  Wink

Didn't know that this doesn't come preinstalled with the Raspbian Distro for the Banana Pi. Now there are some new errors so I have to google some more... Roll Eyes

You're welcome Lincoln6Echo.

Good to see more nodes running on cheap single-board computers.

Be a seeder not a leecher, be sure to forward port 8333 to your Banana Pi (if you only have 8 connections you are not contributing). Smiley

G'luck getting it up and running. Maybe start a "how-to" thread for the Banana Pi once you have it working.

Run a Bitcoin node, support the network.
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!