Skip to main content

Install full node from source code

Goal

This article will guide you to install Hathor core from source code.

Hathor core is the official and reference client for operating a full node in Hathor Network.

Requirements

Hardware

  • CPU: 2 vCPU
  • Memory: 16 GB
  • Disk: 20 GB
  • Bandwidth: 10 Gbps

Platform

Ubuntu \ge v20.04; or macOS \ge 11; or Windows (WSL) \ge v10.

Software

Step-by-step

  1. Download source code.
  2. Install dependencies.
  3. Start the application.

Step 1: download source code

  1. Start a shell session.
  2. Change the working directory to where you want to store the application — namely, source code and database.
  3. Create the data directory, to store the application database (mainly the blockchain).
  4. Run the command to download the latest release of Hathor core:
git clone -b release https://github.com/HathorNetwork/hathor-core.git

Step 2: install dependencies

  1. Run the command to install system dependencies:
sudo apt install build-essential liblz4-dev libbz2-dev libsnappy-dev librocksdb-dev
  1. Run the command to install Poetry with the official installer:
curl -sSL https://install.python-poetry.org | python3 -
  1. Run the command to change the working directory (the one you chose to store the application) to its child hathor-core:
cd hathor-core
  1. Run the command to check if Poetry's current virtual environment is using the correct version of Python3:
poetry env info

The output must present the version of Python you chose to use as requirement — namely, version 3.X.Y, same of the python3.X.Y-dev package.

  1. (Optional) If Poetry's current virtual environment isn't using the correct version of Python, run the command to create and activate the correct virtual environment:
poetry env use python3.X.Y
  1. Run the command to install the application dependencies (Python packages):
poetry install

Step 3: start the application

Run the command to start the application:

poetry run hathor-cli run_node --testnet --wallet-index --status 8080 --data ../data

Your Hathor full node will connect to other peers of Hathor Network testnet and will start syncing its database with theirs — i.e., all blocks and transactions ever recorded in Hathor blockchain testnet.

Task completed

In the browser, you can use the URL http://localhost:8080/v1a/status/ to monitor the status of your full node.

You now have a running instance of Hathor full node in Hathor Network testnet, that will listen to API requests at port 8080. Note that your full node cannot receive API requests or participate in network consensus while it is not synced with its peers. Syncing is an ongoing process that is part of the operations of a full node. However, reaching synchronization with Hathor Network starting from an empty database (from genesis block) takes on average 10 hours for testnet and 24 hours for mainnet. If you want to expedite this process, see How to bootstrap from a snapshot.

Finally, here we used the minimal configuration to have an operational full node. For a custom setup, see Hathor full node configuration.

What's next?