Bitcoin full node - Part 3

By Saniat0r | my_bitcoin_articles | 13 Feb 2020


Configuration

It is possible the generate a custom configuration suitable to you in here
https://jlopp.github.io/bitcoin-core-config-generator/

Also this links are very useful to setup your configuration

https://bitcoin.org/en/full-node

https://en.bitcoin.it/wiki/Full_node

https://en.bitcoin.it/wiki/Running_Bitcoin

https://en.bitcoin.it/wiki/Bitcoind


For my configuration I created the ~/.bitcoin directory

$ mkdir ~/.bitcoin

And now I need to create a bitcoin.conf file inside that directory. I already have one from my other full nodes so will upload the final version to pastebin and in here I will say what I changed.

I will use only one core of my RPi3 cpu


# Bitcoin Core daemon
bitcoind -par=1 -daemon

# Bitcoin Core GUI
bitcoin-qt -par=1


This is my node comment


# Node comment
uacomment=my-node-is-the-best-node

Misc

I will not store the blockchain on the RPi sdcard, because this will read and write a lot of times on my sd card and can damage it. I will use an external hard drive to store the blocks.


$ cd ~/storage/
$ mkdir blocks
$ mkdir chainstate
$ cd ~/.bitcoin/
$ ln -s ~/storage/blocks/
$ ln -s ~/storage/chainstate/

I have a script called btcsync.sh, that I use to see the node status.


$ chmod +x btcsync.sh 

And now I will add some alias to my  ~/.bashrc


alias BTC_start="source ~/.bash_profile ; bitcoind -daemon -disablewallet"

alias BTC_stop="source ~/.bash_profile ; bitcoin-cli stop"

And also add this function to my ~/.bashrc

alias BTC_status="$HOME/btcsync.sh"

I will also configure tor on it!

 

Tor setup

I followed this guide

https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service

 

Syncing the node

I could download the full blockchain and validate everything on my RPi3. But the RPi3 is not a very powerful hardware so it would take a lot of time doing that. And even worse is that I am using only one core of my RPi3, because I need it for other stuff.

I also run a full node on my x64 hardware and I have a local blockchain on that node already verified by me. This is very important "a blockchain verified by me" or in other words verified by my full node.

So I can copy that blockchain to my RPi3 and just wait it to sync a few blocks that were mined while I was copying the files over my LAN network.

If you are thinking that downloading and verifying a full blockchain even in a x64 hardware take to long for you. I am sorry but you have to do that. You can't get a trusted source for a blockchain besides your own blockchain. If you already have one it's great because in that way you can copy to another computers controlled by you and only you. Bitcoin is trust less system! We don't trust anyone and we verify everything. And the ability of anyone verifying their own blockchain is the key of the success of bitcoin, the decentralization. A full P2P decentralized network that no one controls and that no one can shutdown.

So, first I need to stop any node that is running and then copy the files from my full node on a x64 machine to my RPi3.


$ rsync -av ~/.bitcoin/blocks/ pi@rpi3_local_address:~/.bitcoin/blocks/
$ rsync -av ~/.bitcoin/chainstate/ pi@rpi3_local_address:~/.bitcoin/chainstate/

Start the node


$ BTC_start
Bitcoin server starting

When I started the node it was only 50 blocks behind. So it synced very fast.

Let's check if is everything ok!

 

$ ./btcsync.sh


Linux 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l unknown unknown GNU/Linux

Wed 12 Feb 23:55:08 GMT 2020

23:55:08 up 6 days, 11:32, 3 users, load average: 0.86, 1.11, 1.22

OK!!! bitcoind is running

Number of blocks 617138
up to date
100.0 % Done

Chaintip: 000000000000000000029a5fc56092dec5362923c9b205007b707cd8df104fde

 

Blockchain storage space:
278G ~/.bitcoin/blocks
3.7G ~/.bitcoin/chainstate

Full node running for days-hours:minutes:seconds
6-11:30:22


Bitcoin is in reward era 3 and current block height is 617138 blocks. And there are 12862 blocks left for halving.

Reward-Drop ETA date: Tue 12 May 08:35:09 BST 2020

Next difficulty adjustment is just 1774 blocks away at Tue 25 Feb 07:35:09 GMT 2020

 

Notes

In this article I made reference to bitcoin whitepaper created by Satoshi. But the whitepaper of bitcoin is not a gospel and bitcoin is not a religion, and also that's why it's important you run a full node. Because sometime along the way we may need to change something that is not or is against some idea in the whitepaper. The only way to do that is you and only can support that change, running your own full node!

Always remember that bitcoin is a voting system and it's first application was finance. You vote with your node on your computer, phone, tablet, etc... and even with a SoC computer.

Thanks

Many thanks to all the men and women working on the development of bitcoin. Thanks for improving bitcoin with your work and thanks for beside all the improvement that we have and will have in this project in the future, everyone can run it in their own homes with inexpensive hardware.

People need to learn the value of having a network like this that runs on every hardware that anyone can afford.

If the bitcoin network remains decentralized like today, it will never die. Because for that they need to shutdown node by node and make sure that none of those nodes comes back online.

Plz! Run a full bitcoin node and experience bitcoin and try to see beyond the price. I guarantee that will help you to face corrections and pullbacks because then you will know it will go up again.

https://www.publish0x.com/?a=4QbYNj9dzq

How do you rate this article?

1



my_bitcoin_articles
my_bitcoin_articles

This is my blog about bitcoin.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.