A full-node is a program that fully validates transactions and blocks of a blockchain. It is distinct from a light-node that only processes block headers and a small subset of transactions. Running a full-node requires more resources than a light-node but is necessary in order to be a validator. In practice, running a full-node only implies running a non-compromised and up-to-date version of the software with low network latency and without downtime.

Of course, it is possible and encouraged for users to run full-nodes even if they do not plan to be validators.

Requirements

Understanding pruning

In order to run a full node, different hardware requirements should be met based on the pruning strategy you would like to use.

Pruning is the term used to identify the periodic action that can be taken in order to free some disk space on your full node. This is done by removing old blocks data from the disk, freeing up space.

Inside dHealth, there are various types of pruning strategies that can be applied. You can find pruning strategy specified at ~/.dhealth/config/app.toml(mainnet) or ~/.dhealth-testnet/config/app.toml (testnet). The main ones are:

  • default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals;
  • nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node);
  • everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals (At the moment this option is not recommended as it can easily corrupt the database and the node will halt);
  • custom: allow pruning options to be manually specified through pruning-keep-recent, pruning-keep-every, and pruning-interval.

Hardware requirements

You can easily understand how using a pruning strategy of nothing will use more disk space than everything. For this reason, there are different disk space that we recommend based on the pruning strategy you choose:

Pruning strategyMinimum disk spaceRecommended disk space
everything20 GB60 GB
default80 GB160 GB
nothing120 GB> 300 GB

Apart from disk space, the following requirements should be met.

Minimum CPU coresRecommended CPU cores
24
Minimum RAMRecommended RAM
4 GB8 GB

1. Setup your environment

In order to run a fullnode, you need to build dhealthd which requires Go, git, gcc and ignite installed.

This process depends on your working environment.

# Update the system
sudo apt-get update
sudo apt-get upgrade

# Install Go v1.21.6
curl -OL https://golang.org/dl/go1.21.6.linux-amd64.tar.gz
sudo tar -C /usr/local -xvf go1.21.6.linux-amd64.tar.gz

# Install git, gcc and make
sudo apt-get install git build-essential ufw curl jq --yes

# Install ignite
rm $(which ignite)
sudo curl https://get.ignite.com/[email protected]! | sudo bash

# Export environment variables
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export PATH="$PATH:$GOROOT/bin"' >> ~/.bashrc
echo 'export PATH="$PATH:~/go/bin"' >> ~/.bashrc
source ~/.bashrc
# Install Go v1.21.6
curl -OL https://golang.org/dl/go1.21.6.linux-amd64.tar.gz
sudo tar -C /usr/local -xvf go1.21.6.linux-amd64.tar.gz

# Install software using Homebrew
brew install git curl jq

# Install ignite
rm $(which ignite)
sudo curl https://get.ignite.com/[email protected]! | sudo bash

# Export environment variables
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export PATH="$PATH:$GOROOT/bin"' >> ~/.bashrc
echo 'export PATH="$PATH:~/go/bin"' >> ~/.bashrc
source ~/.bashrc
The software has not been tested on Windows
If you are currently running a Windows PC, the following options should be considered:

1. Switch to a Mac 👨‍💻.
2. Wipe your hard drive and install a Linux system on your PC.
3. Install a separate Linux system using VirtualBox
4. Run a Linux instance on a cloud provider.

Note that is still possible to build and run the software on Windows
but it may give you unexpected results and it may require additional setup to be done.
If you insist to build and run the software on Windows, the best bet would be installing
the Chocolatey package manager.

2. Install the software

Once you have set up your environment correctly, you are now ready to install the dHealth software and start your full node.

In order to do so, you can follow our setup guide.