- 2 nodes (a node can be either a physical computer or a VPS)
- It's best for the node which mines your genesis block to be a physical computer, since it will have access to potentially a lot of funds. Do not trust a VPS with your funds!
Basic knowledge about how to connect two nodes is recommended for the initial setup.
As per the original blockchain designs of Satoshi Nakamoto, a Hush Smart Chain does not exist on a single node. Rather, it exists via a connection between two or more nodes. This is the nature of decentralization: it is on the network we rely, rather than a single authority. Therefore, the design of the technology encourages the developer to have two separate nodes which are able to connect over a network.
In the most ideal circumstance, the new Hush developer will already have two virtual private servers (VPS's) available for testing. VPS's can be cheap and easy to manage. A typical VPS will either have a static external IP or can be assigned one.
If the new developer does not have two VPS's available, setting up a test Hush Smart Chain on two local machines in a home or office-type setting is still achievable, but it may require more troubleshooting.
When using a home or office-type setup, the challenge lies in the way the network is created, and there are myriad network setups.
For example, if the developers are operating on a local router, where the two machines are connected via wifi, the local ip addresses of the machines are harder to find. This is because the router assigns new local ip addresses to the machines each time they re-connect to the router. It is not possible to see the ip addresses from the Internet. In this situation, the developer must log into the router's software interface and search for the currently assigned local ip addresses.
To test the creation of a Smart Chain using only a single node, use the `-testnode=1` parameter. This is good for a simple test, but two nodes should be used for rigorous testing that would simulate the network more correctly.
To prepare for the next step, execute the following command in the terminal on both machines:
```bash
curl ifconfig.me
```
From the response, record the `ip address` value for additional use.
With the ip addresses available, we are now prepared to test the connection between the machines.
```bash
ping <inserttheipaddressoftheothermachinehere>
```
This command will generate a response every second, indicating the `ping` speed with which your machines are able to connect.
```bash
$ ping 192.168.1.101
PING 192.168.1.101 (192.168.1.101) 56(84) bytes of data
64 bytes from 192.168.1.101: icmp_seq=1 ttl=64 time=131 ms
64 bytes from 192.168.1.101: icmp_seq=2 ttl=64 time=2.40 ms
Remember to use the exact same parameters on both nodes, or they will not be able to connect to each other, because they will be different, incompatible blockchains. All parameters that start with `-ac_` must match exactly for the same RPC port and other details to match.
By default, a Proof-of-Work algorithm of Equihash (200,9) is used, which is compatible with existing ASICs that are used to mine HUSH, ZEC, ZEN and a few other cryptocoins. To use a CPU mining algorith, use randomx like this:
In the above string, take note of the p2p and RPC ports, as well as the magic number. These values must match on both nodes for the chains to be identical. If they are not the same, verify that the launch command is the same on both the nodes.
In the example above, the p2p port is `6969`. Make sure that the p2p port is open to the internet or any other network from which the second node connects.
Once the daemon loads, compare the string that starts with `>>>>>>>>>>` in the second node to the one from the first node to make sure they are identical.
The arguments `-gen -genproclimit=1` enables mining on this node with 1 CPU thread. The genesis block should be mined with 1 thread to avoid issues. Once the genesis block (genblock) is mined, you can increase the number of CPU threads it uses with:
to mine with 2 CPU threads. Mining with too many threads will likely degrade performance of your VPS, make sure to leave at least 1 CPU thread not mining, so the operating system and other processes have resources.
On a Hush-based blockchain, all of the pre-mined coins are mined in block 1. Therefore, whichever machine executes the mining command will receive the entirety of the blockchain's pre-mined coin supply, as set in the `ac_supply` parameter. Upon mining the first block, these coins are available in the default `wallet.dat` file. Use `getwalletinfo` to see the balance.
Using the `hush-cli` software, which is included in any default installation of `hushd`, you can now execute many commands on your new Smart Chain. This enables you to perform transactions, create and execute smart contracts (if they are enabled on your HSC) and use HushChat protocol and applications.
Since the Hush codebase long ago forked from Zcash (which forked from Bitcoin), essentially all commands that are available on these two upstream blockchains are also available on your new Smart Chain.
## Example commands
To see general information about your new Smart Chain, execute this command:
`./hush-cli -ac_name=LULZ getinfo`
The following command returns information about all available RPC and API commands: