How to run a node on Windows
Introduction
This guide explains how to set up a full node for the Hoosat Network (HTND) on a Windows system. Running a node allows you to use features like a private local wallet or solo mining without relying on mining pools and their fees. It also contributes to the network's decentralization by participating in peer-to-peer communication.
Prerequisites:
Before you begin, ensure you have the following installed on your Windows system:
- Go (Golang): Go is a programming language used to build HTND. Download and install the latest stable version of Go from the official website: https://go.dev/doc/install
- Git: Git is a version control system used to manage code repositories. Download and install Git for Windows from the official website: https://git-scm.com/downloads
- TDM-GCC is compiler required. Install tdm64-gcc-10.3.2-2.exe and the go build of Hoosat Network daemon should work on windows. Download from official website: https://jmeubank.github.io/tdm-gcc/download
Instructions:
1. Download HTND Source Code:
- Open a powershell terminal window (search for "powershell" in the Start menu).
- Run the following command to clone the HTND repository from Github:
git clone https://github.com/Hoosat-Oy/HTND.git
This will download the HTND source code into a new folder named "HTND" in your current directory.
2. Build and Install HTND:
- Navigate to the downloaded HTND directory using the cd command in your Powershell terminal:
- Run the following command to build and install HTND as a program:
cd HTND
go install . ./cmd/...
This will compile the HTND source code and place the executable files in the \go\bin folder (assuming you set up the Go environment variable). If you didn't set the environment variable, the executables will be in the current directory (HTND\cmd).
3. Running the node:
- First navigate to the go binary path. Before navigation to the Go binary path you can check the path with the following, which should output something similar (C:\Users\hoosat\go):
- Then change directory like this (output path from previous command + \bin):
go env GOPATH
cd C:\Users\hoosat\go\bin
To check that you are in the correct folder where htnd.exe resides you can run the command. The returned file list should include htnd.exe and other programs installed with go from source.
ls
Now there are three options for running the HTND node, each with different storage requirements:
- Normal Purging Node (Without Local Wallet): This option uses minimal disk space but doesn't allow local wallet functionality. To run it, simply execute the following command in your terminal:
- Normal Purging Node (With Local Wallet): This option allows using a local wallet but requires more storage space than the purging node without a wallet. To run it, use the following command:
- Full Archiving Node (With Local Wallet): This option downloads and stores the entire blockchain on your system, requiring the most storage space. It also allows local wallet functionality. To run it, use the following command:
HTND.exe -a mainnet-node-1.hoosat.fi
HTND.exe --utxoindex -a mainnet-node-1.hoosat.fi
HTND.exe --utxoindex --archival -a mainnet-node-1.hoosat.fi
Replace .exe with just HTND if you didn't set up the Go environment variable.
4. Verification:
- If the node starts successfully, you'll see messages in the terminal window indicating it's connecting to the network and performing other tasks.
- If you encounter any issues during the process, refer to the Hoosat Network documentation or join the 🆘-ticket channel on our Discord server for assistance.
- Running a full archiving node requires significant storage space as it downloads the entire blockchain. Consider your available disk space before choosing this option.
- Make sure you keep the HTND node software updated for optimal performance and security.
Troubleshooting:
Additional Notes:
Updating Node.
You can update node by shutting down the node, then running git pull in the htnd source directory and reinstalling and restarting the node with your settings.
cd location_of_htnd_source
git pull
go install . ./cmd/..
cd location_of_go_binaries
HTND.exe your parameters