A comprehensive guide to setting up your own HUSH Smart Chain.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
dan_s 14d9bf9ae5 update "test-hsc-setup.md" 2 years ago
LICENSE Initial commit 2 years ago
README.md Update 'README.md' 2 years ago
test-hsc-setup.md update "test-hsc-setup.md" 2 years ago

README.md

hush-smart-chain-setup-guide

Note: This guide will be using Ubuntu 20.04.5, if using a different Linux Distro you may need to install UFW

A comprehensive guide to setting up your own HUSH Smart Chain (HSC).

If setting up on a VPS make sure you know how to connect remotely via SSH, here is a short guide on setting up a VPS:
  • insert link to guide here

Using Tmux

tmux is a terminal multiplexer, this allows us to run multiple terminal sessions in the same window and switch between them.

sudo apt install tmux -y

Here is quick cheat sheet of tmux commands:

  • Detach current session: Ctrl + b + d
  • List all active sessions: tmux ls
  • Start new session: tmux new-session -t session-name
  • Attach to a session: tmux attach -t session_name
  • Split window in current session vertically: Ctrl + b + %
  • Split window in current session horizontally: Ctrl + b + "
  • Navigate split windows: Ctrl + b + (arrow keys)

Initial set up

Install HUSH

Before you can create your own chain you need to have at least 2 nodes set up and able to communicate with each other. Check out this tutorial on how to set up HUSH on each machine you will be using to launch a HSC:


Assigning a static ip address

Once you have HUSH installed, you need to make sure the network settings for each machine are set up properly in order to communicate with each other. Each machine will need a static ip address. This can be enabled in the network settings of your operating system by changing the ip configuration from DHCP to a static ip address of your choosing.

Note: If you are using a Virtual Machine set the network type to Bridged, this allows your router to see the VM as if it were another computer on the network.


Creating the HSC

Setting up a test HSC on a local network

If you want to test the chain before launching it is recommended to create it on a local network to see how the parameters will affect the chain's performance, reward allocation, and dev-tax/pre-mine.


Setting up a HSC node on a VPS

Once you have HUSH installed on your VPS, ssh to it from your local machine and cd to the /hush3 directory.
From here we will input the command to create our HSC and generate a .conf file. This will give us the port we need to allow the vps to accept incoming connections from other nodes.

while in the /hush3 directory input the ./hush-smart-chain command with the desired options.
You can generate your own command here if you are unfamiliar with all the options:

Note: By adding & to the end of this command, it will execute in the background while still allowing you to input commands in the current shell window

You can find the NAMEOFHSC.conf file in the home/.hush directory. In some cases it may be hidden in root/.hush, you can find any hidden directories/files with ls -a.

After opening the .conf file with nano NAMEOFHSC.conf look for rpcport=, the port you will be allowing will be the rpcport - 1, this will be the p2pport that the nodes will use to connect to each other.

After finding the port, in your VPS, Ctrl + x then enter sudo ufw allow port/tcp where port is the rpcport - 1.



Setting up the mining node

Now that you have set up your VPS to allow incoming connections on the required port, it's time to set up a mining node.

Open a new terminal or create a new tmux instance on your local machine and navigate to the hush3/src directory. Here we will input the same command as on the VPS but add a few extra parameters to enable mining.

Note: Make sure the -ac_ options are EXACTLY the same otherwise your node will not be able to connect to the VPS!
./hush-smart-chain -ac_name=NAMEOFHSC -ac_private=1 -ac_blocktime=260 -ac_halving=420000 -ac_reward=2400000000 -ac_supply=987318 -addnode=VPS-ip -gen=1 -genproclimit=1 &

Enable Mining

To start mining on your local node input the following command:

./hush-cli -ac_name=NAMEOFHSC setgenerate true $(nproc) &

Verify if mining is working

After mining was enabled, you can check if the two nodes are connected by using the following command:

./hush-cli -ac_name=NAMEOFHSC getinfo | grep connections

If working, it should return "connections": 1.



Useful RPC commands

All RPC commands for Hush can be used the same way for any HSC. The total list:

Most useful:

./hush-cli -ac_name=NAMEOFHSC getinfo