Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: osoverflow on May 10, 2019, 01:02:57 PM



Title: Bitcoin Full node and LN into RPi 3
Post by: osoverflow on May 10, 2019, 01:02:57 PM
HI! I'm trying to run bitcoind in a full node way into a RPi3.

I mounted an external disk with enough space, and started the bitcoind service, but after a day syncing the chain, everything crashed, I suppose is because a global out of memory problem.

This is my bitcoin.conf file, do you know how to run the process with low memory consumption?
Code:
server=1
listen=1
daemon=1
txindex=1
dbcache=100
logips=1
maxconnections=40
maxuploadtarget=5000
maxorphantx=10
maxmempool=50
upnp=1
rest=1
walletrbf=1
usehd=1
zmqpubhashblock=tcp://127.0.0.1:29000
zmqpubhashtx=tcp://127.0.0.1:29000
zmqpubrawblock=tcp://127.0.0.1:29000
zmqpubrawtx=tcp://127.0.0.1:29000


Title: Re: Bitcoin Full node and LN into RPi 3
Post by: DaCryptoRaccoon on May 10, 2019, 01:07:35 PM
Did you add enough swap space? this can cause the RPI to crash.

To add a 1gb swap file, in /swapfile:

Code:
sudo dd if=/dev/zero of=/swapfile bs=1024M count=1000
sudo mkswap /swapfile
sudo swapon /swapfile



Title: Re: Bitcoin Full node and LN into RPi 3
Post by: osoverflow on May 10, 2019, 04:02:01 PM
Did you add enough swap space? this can cause the RPI to crash.

To add a 1gb swap file, in /swapfile:

Code:
sudo dd if=/dev/zero of=/swapfile bs=1024M count=1000
sudo mkswap /swapfile
sudo swapon /swapfile



Good catch! I will create it. I also read about enabling zram, to compress ram, but my linux version (Libre Elec) has no support for that.


Title: Re: Bitcoin Full node and LN into RPi 3
Post by: ABCbits on May 10, 2019, 06:33:17 PM
Alternatively, you can configure Bitcoin Core to use less RAM by modify mempool, UTXO cache and signature cache size.
Example from https://bitcoin.stackexchange.com/a/50743 (https://bitcoin.stackexchange.com/a/50743) :

Code:
-blocksonly -dbcache=20 -maxsigcachesize=4 -maxconnections=4 -rpcthreads=1

Take note the sync process will be longer due to less cache used.


Title: Re: Bitcoin Full node and LN into RPi 3
Post by: Rath_ on May 10, 2019, 09:18:12 PM
Why don't you sync with the chain on your PC? The processing power of Pi restricts the speed of sync and this might be also a workaround for your problem.


Title: Re: Bitcoin Full node and LN into RPi 3
Post by: osoverflow on May 14, 2019, 09:07:32 PM
Why don't you sync with the chain on your PC? The processing power of Pi restricts the speed of sync and this might be also a workaround for your problem.

I want to test all the process in a weak environment to tune it :)


Title: Re: Bitcoin Full node and LN into RPi 3
Post by: DaveF on May 15, 2019, 11:22:03 AM
Why don't you sync with the chain on your PC? The processing power of Pi restricts the speed of sync and this might be also a workaround for your problem.

I want to test all the process in a weak environment to tune it :)

Some thoughts:

The question becomes then how weak an environment do you want?

You are using an external drive, but you can get 512GB good fast name brand SD cards for ~$125 USD (Samsung / Sandisk / PNY) you can get off brand ones that are still OK for less. But their performance sucks.

You are using an external drive, which is good. BUT are you using a 5400 RPM or a 7200 RPM or a SSD?

Setting up the swap space and configuring node are going to be ALMOST the same process, BUT not 100% the same. You are going to get different answers in what is going to get you the best way to do it depending on what else you have. With a good fast SD & SSD you can use more swap with a smaller performance hit to other I/O  operations then with a generic slow SD and 5400 RPM drive.

And don't get me started on USB -> SATA adapter quality & speed.

-Dave


Title: Re: Bitcoin Full node and LN into RPi 3
Post by: osoverflow on May 20, 2019, 09:53:01 PM
Why don't you sync with the chain on your PC? The processing power of Pi restricts the speed of sync and this might be also a workaround for your problem.

I want to test all the process in a weak environment to tune it :)

Some thoughts:

The question becomes then how weak an environment do you want?

You are using an external drive, but you can get 512GB good fast name brand SD cards for ~$125 USD (Samsung / Sandisk / PNY) you can get off brand ones that are still OK for less. But their performance sucks.

You are using an external drive, which is good. BUT are you using a 5400 RPM or a 7200 RPM or a SSD?

Setting up the swap space and configuring node are going to be ALMOST the same process, BUT not 100% the same. You are going to get different answers in what is going to get you the best way to do it depending on what else you have. With a good fast SD & SSD you can use more swap with a smaller performance hit to other I/O  operations then with a generic slow SD and 5400 RPM drive.

And don't get me started on USB -> SATA adapter quality & speed.

-Dave


For me the task is to use a single PI for multiple tasks. I have a RPi3 with Kodi, and bought an external 7200rpm 8TB disk and connected to it to store my media, and also to serve as a NAS for my home. And I was wondering if it could serve for bitcoin and lightning node, just after I got my new internet connection.

It happens that it can!

I only created the swap file, and started bitcoind with optimized parameters, and it is syncing, very slow, but advancing.

I'm not in hurry for it to finish, but when it finish, I think in couple weeks, I will setup the lightning node there.