Skip to main content

Mainnet from Snapshot

Overview

The current HAQQ version of mainnet is v1.7.8. Sources of all scripts are here github

Quickstart

Battle tested on Ubuntu LTS 22.04

You can follow these steps to set up your environment:

Install packages:

sudo apt-get update && \
sudo apt-get install curl git make gcc liblz4-tool build-essential jq aria2 -y

Preresquisites for compile from source

  • make & gcc
  • Go 1.21+

Easy GO compiler and HAQQ Node installation

bash <(curl -s https://raw.githubusercontent.com/haqq-network/mainnet/master/install_go.sh) && \
source $HOME/.bash_profile && \
bash <(curl -s https://raw.githubusercontent.com/haqq-network/mainnet/master/install_haqq.sh)

Do the same manually:

Download latest binary for your arch: https://github.com/haqq-network/haqq/releases/tag/v1.7.8

Build from source:

cd $HOME
git clone -b v1.7.8 https://github.com/haqq-network/haqq
cd haqq
make install

Verify Binary Version:

haqq@haqq-node:~# haqqd -v
haqqd version "1.7.8" 3058d8f0485747aa5eacb352330d6bc1a867a838

Initialize

Run script:

export CUSTOM_MONIKER="mainnet_node"
export HAQQD_DIR="$HOME/.haqqd" # default haqq home folder

haqqd config chain-id haqq_11235-1 && \
haqqd init $CUSTOM_MONIKER --chain-id haqq_11235-1

# Prepare genesis file for mainet(haqq_11235-1)
curl -L https://raw.githubusercontent.com/haqq-network/mainnet/master/genesis.json -o $HAQQD_DIR/config/genesis.json

# Prepare addrbook
curl -L https://raw.githubusercontent.com/haqq-network/mainnet/master/addrbook.json -o $HAQQD_DIR/config/addrbook.json

After that need to download a haqq node snapshot from one of our providers:

Example download command via aria2(via polkachu):

aria2c https://snapshots.polkachu.com/snapshots/haqq/haqq_12345540.tar.lz4

And decompress to HAQQD_DIR and start node(archive name is just for example use actual name from provider)

Example for Polkachu format:

lz4 -c -d haqq_12345540.tar.lz4  | tar -x -C $HAQQD_DIR

Example for Publicnode format:

lz4 -c -d haqq-pruned-12345957-12345967.tar.lz4  | tar -x -C $HAQQD_DIR

After decompress you can try to start the node:

haqqd start

Upgrade to Validator Node

You now have an active full node. What's the next step? You can upgrade your full node to become a Haqq Validator. The top 150 validators have the ability to propose new blocks to the Haqq Network. Continue onto the Run a Validator.