A Complete Beginners Guide to Installing a Bitcoin Full Node on Linux (2021 Edition)
Tags: Full Node, Linux, Lightning Network, Bitcoin, Cryptocurrency

Creating The bitcoin.conf File

We need to create a configuration file now, so in the file explorer create a file called bitcoin.conf . Open it, paste the following, and save the file:

# Needed for full validation

assumevalid=0 # Improves LND performance

# Needs to be set now if you're going to install Lightning later

txindex=1 # Not needed, but will show us useful info later in the tutorial

debug=net

Alternatively, this next config is exactly the same but without the comments:

assumevalid=0

txindex=1

debug=net

debug=net will just show us some extra network activity in the log output. This can be left out if you really don’t care, or removed after you are done with the tutorial.

By default, not all of the debug information is included in the log file. Setting it to 1 will include all of it, but there’s way too many lines and all the info flies by too fast when tailing the log. It’s useful for diagnostic purposes, but we’re not going to use it.

All the debug config options you can set are: net, tor, mempool, http, bench, zmq, db, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb.

Disclaimer: Do not leave debug set to 1 indefinitely or your log file will grow larger than the entire blockchain and fill up your hard drive. It’s happened to me.

txindex=1 will create a transaction index as the blockchain syncs, which will ready the node for my Lightning tutorial that follows this.

assumevalid=0 will force your node to validate every transaction & block from the Genesis block (the very first block mined).

This is also where you can optionally set your node to prune the blockchain as it goes along. Right now the entire blockchain is about 160 GB in size. If you don’t have enough storage space, you could prune the data down to under 5 GB at the moment. I don’t recommend doing that unless you need to, but this is what you would enter on its own line to bring it down to 10 GB:

#(Example config) debug=net

prune=10000

If you’re going to follow the Lightning guide, do not prune your node.

Your config file can have many options set, and it doesn’t matter what order they’re in, so it could also look like this if you hypothetically want to restrict your node’s mempool to 100 MB worth of transactions:

#(Example config) debug=net

prune=10000

maxmempool=100

Or like this if you want to (and should) force your node to check the validity of every signature. The definition of a full node is contested, but my stance is a full node is one that has fully validated the entire blockchain, so this “assume valid” setting in the config file will be necessary. Setting it to 0 tells your node to not assume anything. Without this set your node will skip over validating older blockchain data:

#(Example config) debug=net

assumevalid=0

For now just save the bitcoin.conf file with debug set to net, txindex set to 1, add a prune value if you need it, along with assumevalid set to 0 if you want your node to fully validate the blockchain (recommended, and it shouldn’t add too much time to the syncing process unless you’re on very low end hardware).

Again, the order they are listed in the config file doesn’t matter.

Alternatively you can use something like Jameson Lopp’s config generator if you’re interested in setting additional config options.