How to Deploy a HQZ Pillar

HYPERQUBE_Z LAUNCH PART 2

Genesis Timestamp: Wednesday February 19 12:00 AM UTC (1739923200)

HQZ Node Deployment

This post provides a bash script to deploy an HQZ Pillar. The script sets up the required directories, downloads the genesis.json file, creates a configuration file, clones a deployment repository, backs up any pre-existing configuration, and finally runs the deployment script. After deployment, you will need to update the producer wallet file with your actual keystore if it does not already exist.

Note: The script must be run as root.

Overview

The deployment script performs the following steps:

  • Checks for curl: Installs it if it’s not already present.
  • Pre-deployment backup:
    If the /root/.hqzd directory already exists, the script stops the go-hyperqube service and backs up the folder to /root/.hqzd.bak before proceeding.
  • Creates necessary directories:
    The script verifies that both /root/.hqzd and /root/.hqzd/wallet exist. If the wallet directory is missing, it gets created.
  • Downloads genesis.json:
    Downloads the file and saves it to /root/.hqzd/genesis.json.
  • Prompts for input:
    Asks for the pillar name and producer address.
  • Generates config.json:
    Creates a configuration file with your provided values.
  • Creates a producer wallet file (if missing):
    A wallet file is created at /root/.hqzd/wallet/<producer_address> containing a placeholder message. If a wallet file already exists for the given producer address, it won’t be overwritten.
  • Clones the deployment repository and runs the deployment script.

Prerequisites

  • A Linux machine with root access and minimum system requirements (2vCPUs and 4GB RAM).
  • A package manager (apt-get or yum) to install missing tools.
  • Git must be installed on your system.
  • Internet access to download necessary files and clone repositories.

Deployment Instructions

  1. Download the Deployment Script

    Download the deployment script from the following URL:

    hqz.sh

    For example, run:

    curl -fsSL -o hqz.sh https://gist.githubusercontent.com/0x3639/7ac174f199d9087e58ff3bf9328fe07e/raw/72d0512c958aadc805970d41844465b76d82c847/hqz.sh
    
  2. Make the Script Executable

    Change the permissions to make it executable:

    chmod +x hqz.sh
    
  3. Run the Script as Root

    Execute the script as root (either log in as root or use sudo):

    sudo ./hqz.sh
    

    During execution, the script will:

    • Check if /root/.hqzd already exists; if it does, it stops the go-hyperqube service and backs up the directory to /root/.hqzd.bak.
    • Create any missing directories (both /root/.hqzd and /root/.hqzd/wallet).
    • Download genesis.json into /root/.hqzd/.
    • Prompt you for the pillar name and producer address.
    • Generate a config.json file with your provided values.
    • Create a wallet file at /root/.hqzd/wallet/<producer_address> (if it doesn’t already exist).
    • Clone the deployment repository and run its deployment script.

Post-Deployment: Updating the Producer Wallet File (ONLY IF YOU CREATED THE PRODUCER ON A DIFFERENT MACHINE)

After the deployment is complete, you must update the producer wallet file with your actual keystore. Follow these steps if you need to move the producer file to the server:

  1. Locate the Producer Wallet File on the machine that created the Producer file

    On the machine where you originally created your Producer address, navigate to your wallet directory:

    cd ~/.hqzd/wallet
    ls
    

    You should see a file named after your producer address.

  2. Retrieve the Keystore

    Display the contents of the producer file:

    cat ~/.hqzd/wallet/<producer_address>
    

    Replace <producer_address> with your actual producer address and copy the output (your keystore).

  3. Update the Wallet File on the Pillar Machine

    On the Pillar machine where you ran the hqz.sh script, open the wallet file located at:

    /root/.hqzd/wallet/<producer_address>
    

    Replace the placeholder text:

    #Replace with the keystore of the producer address
    

    with your actual keystore. You can use an editor like nano:

    nano /root/.hqzd/wallet/<producer_address>
    

    Save and exit after pasting the keystore.

Restart go-hyperqube

After updating the wallet file, start the node service:

sudo systemctl start go-hyperqube

Check the status to ensure it is running:

sudo systemctl status go-hyperqube

To follow the logs:

sudo journalctl -u go-hyperqube -f

Happy deploying!

1 Like

Thanks for the instructions @0x3639. I’ll just add a comment.

If you created the producer keystore on a separate machine, you’ll also need to update the password in the configuration file.

Yes thanks for pointing that out. The script assume you have not changed the password from the default password when creating the devnet.

If you setup your Pillar wallet on Virtual Box, can not get copy/paste to work, and you want to export the Pillar keystore to your pc using scp:

1. Check to see if ssh is installed on the VM

systemctl status ssh

Install ssh if needed:
sudo apt update
sudo apt install openssh-server

2. Check the VirtualBox Network Type - These instructions apply to NAT

NAT (Default)

  • Your VM does not have a directly accessible IP.
  • You must set up port forwarding to allow scp.

To enable SCP access:

  1. Open VirtualBox → Select your VM → Settings → Network.

  2. Under Adapter 1, ensure “Attached to” is NAT.

  3. Click Port Forwarding.

  4. Add a new rule:

  • Protocol: TCP
  • Host IP: 127.0.0.1
  • Host Port: 2222
  • Guest IP: Leave blank
  • Guest Port: 22
  1. Click OK and restart the VM.

  2. You can try to scp the hqz keystore from your root directory but if you have problems due to user permissions, copy the hqz keystore your user directory.

sudo cp /root/.hqzd/wallet/hqz /home/<username>
sudo chown <username>:<username> /home/<username>/hqz (three instances of username)

Now run scp from your Mac terminal.

scp -P 2222 <username>@127.0.0.1:/home/<username>/hqz ~/Downloads/ (note two instances of username)

height = 1

I’ve slightly adjusted @0x3639 hqz.sh script to support ARM.

NOTICE: This is cloning a refactored version of the deployment script, specifically a feature/arm-support branch that adds arm support at github.com/coinselor/deployment

To use it, follow 0x instructions but used this hqz.sh script instead:

curl -fsSL -o hqz.sh https://gist.githubusercontent.com/coinselor/4f571024f9b7a0d44dd8fd580b718f49/raw/63159f181cebd09fc15ebbddb3565bc48167307f/hqz.sh

It will ask to choose a branch from hypercore-one/deployment, choose hyperqube_z