Add script to generate new Hush Smart Chains

For example, this is how to create a new ZUSH Hush Smart Chain, with z-to-z transactions only,
a reward of 5 ZUSH per block, a block time of 55 seconds and a halving period of every 50000 blocks:

$ ./hush-smart-chain -ac_name=ZUSH -ac_private=1 -ac_reward=5 -ac_blocktime=55 -ac_halving=50000 -gen
ASSETCHAINS_SUPPLY 10
perc 0.0000% ac_pub=[000000...] acsize.0
ERA0: end.0 reward.5 halving.50000 decay.0 notarypay.0
extralen.73 before disable bits
MAX_MONEY 6105065246 61.05065246
0000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000050c30000000000000000000000000000400000000000000037000000 extralen.77 crc0.35c92ddd
chainparams_commandline called
>>>>>>>>>> ZUSH: p2p.34998 rpc.37491 magic.d9a3bc82 3651386498 10 coins

In the last line above, you can see the p2p, rpc and magic values associated to the chain.
This commit is contained in:
Duke Leto
2019-12-24 15:46:23 -05:00
parent 75fa411537
commit bcc7fd01fd

24
src/hush-smart-chain Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Copyright (c) 2019-2020 Hush developers
# set working directory to the location of this script
# readlink -f does not always exist
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
DIR="$( cd "$( dirname "$( readlink "${BASH_SOURCE[0]}" )" )" && pwd )"
cd $DIR
NAME=HUSH3
CLIENTNAME="GoldenSandtrout"
DEFAULTS="-ac_sapling=1 -clientname=$CLIENTNAME"
# This is a Hush-flavored KMD that allows us to pass in arbitary CLI
# flags, since hushd is specific to Hush mainnet
KMD=${KOMODOD:-./komodod}
if [ -f $KMD ]; then
$KMD $DEFAULTS "$@"
else
# We prefix our binary when installed
# system wide on Debain system, to prevent clashes
KMD=hush-komodod
$KMD $DEFAULTS "$@"
fi