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.

119 lines
3.8 KiB

# initial set up
This page describes all requried steps to run a HSC, mostly a copy-paste from:
https://git.hush.is/hush/hsc-creator/src/branch/master/docs.md and https://hush.is/hsc-creator and https://git.hush.is/hush/hush-smart-chains
2 static IPs are needed, we can use `sudo ufw allow from IP2` on a first node and `sudo ufw allow from IP1` on a second node to make sure servers can ping each other. To verify use `ping IP2` and `ping IP1`
# install hush3
```
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python zlib1g-dev wget \
bsdmainutils automake curl unzip nano libsodium-dev
```
```
git clone https://git.hush.is/hush/hush3
cd hush3
./build.sh -j$(nproc)
cd src
```
# using tmux
`sudo apt install tmux -y`
We do not want to lose our process and break our chain. So we can run the following:
`tmux new-session -t NODE1` and `tmux new-session -t NODE2` on our second node
it is better to have more than 2 nodes, I have 2 free servers to run nodes on, so it can be 4 already
# running the HSC
From your NODE1 run:
```
./hush-smart-chain -ac_name=SHT -ac_private=1 -ac_blocktime=260 -ac_halving=420000 -ac_reward=2400000000 -ac_supply=987318 -addnode=IP2 &
```
From your NODE2 run:
```
./hush-smart-chain -ac_name=SHT -ac_private=1 -ac_blocktime=260 -ac_halving=420000 -ac_reward=2400000000 -ac_supply=987318 -addnode=IP1 &
```
`-ac_name=SHT` - name
`-ac_private=1` - full z2z privacy feature, just like Hush or ARRR
`ac_supply=987318` - pre-mined supply
`-ac_blocktime=260` + `-ac_halving=420000` + `-ac_reward=2400000000` makes SHT with block time of 260 seconds and halving every 420000 blocks with initial reward of 24 SHT.
# Compare the magic number
Example: magic.c89b00b16, the string `c89b00b16` will be different, but must be identical on both nodes
# Before mining the pre-mined supply
All of the pre-mined coins are mined in the first block. Therefore, whichever machine executes the mining command will receive the entirely 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 command:
```
# Get a new address
newaddress=$(./hush-cli -ac_name=SHT getnewaddress)
# Get the corresponding pubkey
pubkey=$(./hush-cli -ac_name=SHT validateaddress $newaddress | jq -r '.pubkey' )
# Indicate the pubkey to the daemon
./hush-cli -ac_name=SHT setpubkey $pubkey
```
# Enable mining
```
./hush-cli -ac_name=SHT setgenerate true $(nproc)
```
mining is prohibited with any VPS providers, so if you're planning to use one it is safe to run with `-j 2`(?) option instead of `$(nproc)`, will be updated...
# verify if mining is working
After enabling mining, you can check that the two nodes are connected by using the following command:
```
./hush-cli -ac_name=SHT getinfo | grep connections
```
must be `"connections": 1`.
# useful RPC commands
All RPC command for Hush can be used the same way for the HSC. The total list: https://faq.hush.is/rpc/coinsupply.html
Most useful:
```
./hush-cli -ac_name=SHT getinfo
```
# TO-DO list
- figure out how to properly publish the source code of the new chain created. (can be very confused about this one)
- change all tickers from HUSH to SHT.
- ac_? for the total supply.
- mining, will coolmine and/or luckpool support SHT? solo-mining docs from @jahway603
- wallets.
- dPoW?
- specify the devReward wallet, so some portion of all mined coins can go to the devReward address.
The last response from @Duke regarding the last to-do mentioned above:
https://git.hush.is/hush/hush3/src/branch/master/src/hushd#L85
`ac_founders` and there is also ac_foundersreward
`ac_script` is the pubkey of the FR address
`ac_perc` is the percentage