Browse Source

Thanks to Duke for helping explain all of this gibberish

pull/2/head
PJ Your Heiness 3 years ago
parent
commit
b722d14899
  1. 35
      docs.md

35
docs.md

@ -77,4 +77,37 @@ In the above string, take note of the p2p and RPC ports, as well as the magic nu
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.
This completes the first half of the Smart Chain creation process.
This completes the first half of the Smart Chain creation process.
## Part II: Connecting the Second Node
On the second node you issue the same command, but with a key difference. This time, use the first node's IP address.
```bash
./hush-smart-chain -ac_name=LULZ -ac_supply=55555 -addnode=<IP address of the first node> &
```
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.
Mining can be started on a node using the following command:
```bash
./hush-cli -ac_name=LULZ setgenerate true $(nproc)
```
`$(nproc)` in the above command makes the daemon mine using all the available CPU threads, which might be necessary in a low end VPS.
On a Hush-based blockchain, all of the pre-mined coins are mined in the first block. 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.
To collect all the mining rewards from the node to a single address, execute the following commands before issuing the `setgenerate` command:
```bash
# Get a new address
newaddress=$(./hush-cli -ac_name=HELLOWORLD getnewaddress)
# Get the corresponding pubkey
pubkey=$(./hush-cli -ac_name=LULZ validateaddress $newaddress | jq -r '.pubkey' )
# Indicate the pubkey to the daemon
./hush-cli -ac_name=LULZ setpubkey $pubkey
```
Loading…
Cancel
Save