Browse Source

modified: cron_splitfunds

master^2
blackjok3r 7 years ago
parent
commit
d6cb12a911
  1. 43
      a-team/scripts.notary/cron_splitfunds

43
a-team/scripts.notary/cron_splitfunds

@ -1,53 +1,56 @@
#!/bin/bash #!/bin/bash
# Remove BEER and PIZZA from splitfund as they are not notarized. # Remove BEER and PIZZA from splitfund as they are not notarized.
declare -a skip=("BEER" "PIZZA") declare -a skip=("BEER" "PIZZA")
# Minimum number of UTXOs to maintain
TARGETAMNT=10
print_txid () { print_txid () {
echo -n $(echo $1 | jq -r .txid) echo -n $(echo $1 | jq -r .txid)
} }
# Minimum number of UTXOs to maintain
MINUTXOS=10
# Amount of UTXOs to create at one time # Amount of UTXOs to create at one time
SPLITAMNT=10 splitamount () {
SPLITAMNT=$(( $TARGETAMNT -$1 ))
}
#Print Date and Time #Print Date and Time
now=$(date +"%Y-%m-%d %T%z") now=$(date +"%Y-%m-%d %T%z")
echo $now echo $now
# Manual Check of CHIPS, KMD echo "Checking CHIPS, KMD, GAME, VRSC"
echo "Checking GAME, CHIPS, KMD, VRSC"
cd ~ cd ~
echo -n CHIPS echo -n CHIPS
UTXOS="$(chips-cli listunspent | grep -c .00010000)" UTXOS="$(chips-cli listunspent | grep -c .00010000)"
echo -n -e '\t\t';echo -n "$UTXOS" echo -n -e '\t\t';echo -n "$UTXOS"
if [ "$UTXOS" -lt "$MINUTXOS" ] if [ "$UTXOS" -lt "25" ]
then then
SPLITAMNT=$(( 25 -$UTXOS ))
echo -n " - SPLITFUNDING CHIPS: " echo -n " - SPLITFUNDING CHIPS: "
RESULT="$(acsplit CHIPS $SPLITAMNT)" RESULT="$(acsplit CHIPS $SPLITAMNT)"
print_txid $RESULT print_txid $RESULT
fi fi
echo "" echo ""
echo -n GAME echo -n KMD
UTXOS="$(gc-cli listunspent | grep -c .00100000)" UTXOS="$(komodo-cli listunspent | grep -c .00010000)"
echo -n -e '\t\t';echo -n "$UTXOS" echo -n -e '\t\t';echo -n "$UTXOS"
if [ "$UTXOS" -lt "15" ] if [ "$UTXOS" -lt "50" ]
then then
echo -n " - SPLITFUNDING GAME: " SPLITAMNT=$(( 50 -$UTXOS ))
RESULT=$(curl --silent --url "http://127.0.0.1:7776" --data "{\"coin\":\"GAME\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":\"100000\",\"sendflag\":1,\"duplicates\":"15"}") echo -n " - SPLITFUNDING KMD: "
RESULT="$(acsplit KMD 77)"
print_txid $RESULT print_txid $RESULT
fi fi
echo "" echo ""
echo -n KMD echo -n GAME
UTXOS="$(komodo-cli listunspent | grep -c .00010000)" UTXOS="$(gc-cli listunspent | grep -c .00100000)"
echo -n -e '\t\t';echo -n "$UTXOS" echo -n -e '\t\t';echo -n "$UTXOS"
if [ "$UTXOS" -lt "77" ] if [ "$UTXOS" -lt "$TARGETAMNT" ]
then then
echo -n " - SPLITFUNDING KMD: " splitamount $UTXOS
RESULT="$(acsplit KMD 77)" echo -n " - SPLITFUNDING GAME: "
RESULT=$(curl --silent --url "http://127.0.0.1:7776" --data "{\"coin\":\"GAME\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":\"100000\",\"sendflag\":1,\"duplicates\":"$SPLITAMNT"}")
print_txid $RESULT print_txid $RESULT
fi fi
echo "" echo ""
@ -55,8 +58,9 @@ echo ""
echo -n VRSC echo -n VRSC
UTXOS="$(komodo-cli -ac_name=VRSC listunspent | grep -c .00010000)" UTXOS="$(komodo-cli -ac_name=VRSC listunspent | grep -c .00010000)"
echo -n -e '\t\t';echo -n "$UTXOS" echo -n -e '\t\t';echo -n "$UTXOS"
if [ "$UTXOS" -lt "$MINUTXOS" ] if [ "$UTXOS" -lt "$TARGETAMNT" ]
then then
splitamount $UTXOS
echo -n " - SPLITFUNDING VRSC: " echo -n " - SPLITFUNDING VRSC: "
RESULT="$(acsplit VRSC $SPLITAMNT)" RESULT="$(acsplit VRSC $SPLITAMNT)"
print_txid $RESULT print_txid $RESULT
@ -72,7 +76,8 @@ echo "Checking Other Coins"
echo -n $chain echo -n $chain
UTXOS="$(komodo-cli -ac_name=$chain listunspent | grep -c .00010000)" UTXOS="$(komodo-cli -ac_name=$chain listunspent | grep -c .00010000)"
echo -n -e '\t\t';echo -n "$UTXOS" echo -n -e '\t\t';echo -n "$UTXOS"
if [ "$UTXOS" -lt "$MINUTXOS" ]; then if [ "$UTXOS" -lt "$TARGETAMNT" ]; then
splitamount $UTXOS
echo -n " - SPLITFUNDING $chain: " echo -n " - SPLITFUNDING $chain: "
RESULT="$(acsplit $chain $SPLITAMNT)" RESULT="$(acsplit $chain $SPLITAMNT)"
print_txid $RESULT print_txid $RESULT

Loading…
Cancel
Save