Skip to content

Instantly share code, notes, and snippets.

@thelazier
Last active October 7, 2016 12:26
Show Gist options
  • Save thelazier/c2ccafd5bfa3dda89a18 to your computer and use it in GitHub Desktop.
Save thelazier/c2ccafd5bfa3dda89a18 to your computer and use it in GitHub Desktop.
dash-cli command shell script
#Locking Masternode Tx with dash-cli
dash-cli masternode outputs |grep '"' |cut -d '"' -f 2,4|sed "s/\"/ /g" |awk '{print "dash-cli lockunspent false \"[{\\\"txid\\\":\\\"" $1 "\\\",\\\"vout\\\":" $2 "}]\"" }' |/bin/sh
#create mnbudget vote cmd from show using jq (deprecated)
CURR_BLOCK=$(dash-cli getinfo |jq '.blocks')
dash-cli mnbudget show |jq '.|keys[] as $name| {"\($name)"}[] |select(.Amount > 0)|select(.BlockEnd > '$CURR_BLOCK')| "dash-cli mnbudget vote \($name) \(.URL) \(.TotalPaymentCount) \(.BlockStart) \(.PaymentAddress) \(.Amount/100000000) no"' |cut -d'"' -f 2
#show mnbudget vote status
dash-cli mnbudget show |jq '.|keys[] as $name| {"\($name)"}[] | "\($name) Y:\(.Yeas) N:\(.Nays) A:\(.Abstains) \(.Ratio*100)%" '
"core-team Y:500 N:0 A:0 100%"
"public-awareness Y:472 N:1 A:0 99.788584%"
"reimbursement Y:487 N:0 A:0 100%"
#Create MN.conf from outputs [testnet]
for op in $(dash-cli masternode outputs |grep '"' |cut -d '"' -f 2,4|sed "s/\"/:/g"); do if [ -z $n ]; then n=0; fi; echo MN$n 103.58.149.157:19999 $(dash-cli masternode genkey) ${op%:*} ${op#*:} >> ~/.dashcore/testnet3/masternode.conf; n=$(($n+1)); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment