From bcc7fd01fd4c0a476c95b2395e64aca09ba56d5f Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 24 Dec 2019 15:46:23 -0500 Subject: [PATCH] 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. --- src/hush-smart-chain | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 src/hush-smart-chain diff --git a/src/hush-smart-chain b/src/hush-smart-chain new file mode 100755 index 000000000..d35b86983 --- /dev/null +++ b/src/hush-smart-chain @@ -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