Reference simple CLI wallet for Hush Smart Chains
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.

97 lines
2.7 KiB

2 years ago
#!/usr/bin/env bash
# Copyright (c) 2022 Jahway603 & The Hush developers
#
# This is a Hush Smart Chain (HSC) CLI basic wallet for testing new HSC
### Config section - change if needed
hush_cli_location="./src/hush-cli"
### Checking...
2 years ago
if [[ $# -eq 0 ]] ; then
echo "WARNING: You didn't specify the name of your Hush Smart Chain (HSC)!"
echo "Please try ./hsc-cli -h to see the proper commands."
exit 1
fi
Help()
{
2 years ago
echo "This is a series of test scripts to interact with your new Hush Smart Chain (HSC)."
echo
echo "Syntax: ./hsc-cli Name-of-HSC"
echo "Start the hsc-cli for your specified HSC"
2 years ago
}
# Get the help options
while getopts ":h" option; do
case $option in
h) # display Help
Help
exit;;
esac
done
# Main
echo
cat <<'EOF'
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
dP dP .d88888b a88888b. a88888b. dP dP
88 88 88. "' d8' `88 d8' `88 88 88
88aaaaa88a `Y88888b. 88 88 88 88
88 88 `8b 88 88888888 88 88 88
88 88 d8' .8P Y8. .88 Y8. .88 88 88
dP dP Y88888P Y88888P' Y88888P' 88888888P dP
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
EOF
echo
2 years ago
echo "Welcome to this Hush Smart Chain CLI experience for $1"
echo
echo "Please select from the following options for your testing:"
select option in z_gettotalbalance z_listaddresses z_getnewaddress getinfo getwalletinfo getpeerinfo listunspent z_getbalances getchaintxstats z_shieldcoinbase
2 years ago
do
case $option in
"getinfo")
2 years ago
$hush_cli_location -ac_name=$1 getinfo
2 years ago
;;
"getwalletinfo")
2 years ago
$hush_cli_location -ac_name=$1 getwalletinfo
;;
"getpeerinfo")
$hush_cli_location -ac_name=$1 getpeerinfo
2 years ago
;;
"listunspent")
2 years ago
$hush_cli_location -ac_name=$1 listunspent
;;
2 years ago
"z_getbalances")
2 years ago
$hush_cli_location -ac_name=$1 z_getbalances
;;
"z_getnewaddress")
$hush_cli_location -ac_name=$1 z_getnewaddress
2 years ago
;;
"z_gettotalbalance")
$hush_cli_location -ac_name=$1 z_gettotalbalance
;;
"z_getnewaddress")
$hush_cli_location -ac_name=$1 z_getnewaddress
;;
"z_listaddresses")
$hush_cli_location -ac_name=$1 z_listaddresses
;;
"getchaintxstats")
$hush_cli_location -ac_name=$1 getchaintxstats
;;
"z_shieldcoinbase")
echo "Enter your z-addr:"
read input_zaddr
if [[ $input_zaddr == zs1* ]] ; then
echo "You entered: $input_zaddr"
$hush_cli_location -ac_name=$1 z_shieldcoinbase "*" "$input_zaddr"
fi
;;
2 years ago
*)
2 years ago
echo "Invalid entry - try again."
2 years ago
break
;;
esac
done