From d87b2c8c64bd8e0126b410fe4be9b995d9a25390 Mon Sep 17 00:00:00 2001 From: webworker01 Date: Mon, 28 May 2018 09:06:49 -0400 Subject: [PATCH 01/19] add checking git for updates --- webworker01/stats | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/webworker01/stats b/webworker01/stats index 2948c27..a1f58d0 100755 --- a/webworker01/stats +++ b/webworker01/stats @@ -1,7 +1,7 @@ #!/bin/bash #Stats script for Komodo Notary Nodes # -#Requires jq v1.5+ and bitcoin-cli, komodo-cli and chips-cli installed (e.g. symlinked to /usr/local/bin) +#Requires jq v1.5+ and bitcoin-cli, komodo-cli, chips-cli and gamecredits-cli installed (e.g. symlinked to /usr/local/bin) #==Options - Only Change These== @@ -14,6 +14,14 @@ txscanamount=77777 #You can modify this list of ACs to exclude or comment out the line to show all ignoreacs=('VOTE2018' 'BEER' 'PIZZA') +#git checking - some paths and such +repos=( +'Komodo $HOME/komodo origin/dev' +'Iguana $HOME/SuperNET origin/dev' +'Chips $HOME/chips3 origin/dev' +'GameCredits /home/gamecredits/GameCredits origin/master' +) + #==End Options== timeSince() @@ -46,6 +54,23 @@ timeSince() fi } +checkRepo() +{ + prevdir=${PWD} + + eval cd "$2" + + git remote update > /dev/null 2>&1 + + localrev=$(git rev-parse HEAD) + remoterev=$(git rev-parse $3) + + if [ $localrev != $remoterev ]; then + printf "\n\033[0;31m$1 has an update at $3! Local:${localrev:0:7} Upstream:${remoterev:0:7}\033[0m" + fi + cd $prevdir +} + #Do not change below for any reason! #The BTC and KMD address here must remain the same. Do not need to enter yours! source coinlist @@ -145,12 +170,15 @@ outputstats () fi done printf "Total: %9s %44s" "$totalntrzd" "$now"; + + for repo in "${repos[@]}"; do + checkRepo ${repo[0]} ${repo[1]} ${repo[2]} + done } if [ "$sleepytime" != "false" ] then - while true - do + while true; do outputstats sleep $sleepytime done From f98fe52a78e47bd3fc0135227a7d521bc878cac9 Mon Sep 17 00:00:00 2001 From: webworker01 Date: Mon, 28 May 2018 09:43:34 -0400 Subject: [PATCH 02/19] add glxt and eql --- webworker01/coinlist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webworker01/coinlist b/webworker01/coinlist index fab3665..82d1a72 100644 --- a/webworker01/coinlist +++ b/webworker01/coinlist @@ -27,4 +27,6 @@ coinlist=( 'CHAIN 999999' 'PRLPAY 500000000' 'DSEC 7000000' +'GLXT 100000000' +'EQL 500000000' ) From 73caa2fee73093b6ca3c2a92d3c1b9d3415c373c Mon Sep 17 00:00:00 2001 From: webworker01 Date: Mon, 28 May 2018 09:53:45 -0400 Subject: [PATCH 03/19] add glxt and eql to firewall script' --- webworker01/kmdacfirewall | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webworker01/kmdacfirewall b/webworker01/kmdacfirewall index d9d64d3..3b14a47 100755 --- a/webworker01/kmdacfirewall +++ b/webworker01/kmdacfirewall @@ -37,6 +37,9 @@ sudo ufw allow 12466 comment 'OOT' sudo ufw allow 14357 comment 'BNTN' sudo ufw allow 15586 comment 'CHAIN' sudo ufw allow 9678 comment 'PRLPAY' +sudo ufw allow 11556 comment 'DSEC' +sudo ufw allow 15722 comment 'GLXT' +sudo ufw allow 10305 comment 'EQL' sudo ufw enable # check the status again From 1f264abf3bc28b5cc4e81a4143b2fa5f42aa3736 Mon Sep 17 00:00:00 2001 From: webworker01 Date: Tue, 29 May 2018 06:23:29 -0400 Subject: [PATCH 04/19] add remote check to komodostats.com api for checkfork --- webworker01/checkfork | 49 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/webworker01/checkfork b/webworker01/checkfork index 4b14779..5653d76 100755 --- a/webworker01/checkfork +++ b/webworker01/checkfork @@ -1,39 +1,70 @@ #!/bin/bash +#You can modify this list of ACs to exclude or comment out the line to show all +ignoreacs=('VOTE2018' 'BEER' 'PIZZA') + source coinlist forked=false +remotecheck=$(curl -Ssf https://komodostats.com/api/notary/summary.json) + blocks=$(komodo-cli getinfo | jq .blocks) longest=$(komodo-cli getinfo | jq .longestchain) +remoteblocks=$(echo $remotecheck | jq '.[] | select(.ac_name=="KMD") | .blocks') if ((blocks < longest)); then forked=true printf "\033[0;31mKMD - Possible fork!\033[0m Blocks $blocks < LongestChain $longest\n" +elif ((blocks != remoteblocks)); then + forked=true + printf "\033[0;31mKMD - Possible fork!\033[0m Blocks $blocks != Remote $remoteblocks\n" else - echo "KMD - Blocks $blocks = LongestChain $longest" + echo "KMD - Blocks $blocks, LongestChain $longest, Remote $remoteblocks" fi blocks=$(chips-cli getinfo | jq .blocks) longest=$(chips-cli getinfo | jq .headers) +remoteblocks=$(echo $remotecheck | jq '.[] | select(.ac_name=="CHIPS") | .blocks') if ((blocks < longest)); then forked=true printf "\033[0;31mCHIPS - Possible fork!\033[0m Blocks $blocks < Headers $longest\n" +elif ((blocks != remoteblocks)); then + forked=true + printf "\033[0;31mCHIPS - Possible fork!\033[0m Blocks $blocks != Remote $remoteblocks\n" +else + echo "CHIPS - Blocks $blocks, LongestChain $longest, Remote $remoteblocks" +fi + +blocks=$(gamecredits-cli getinfo | jq .blocks) +remoteblocks=$(echo $remotecheck | jq '.[] | select(.ac_name=="GAME") | .blocks') + +if ((blocks != remoteblocks)); then + forked=true + printf "\033[0;31mGAME - Possible fork!\033[0m Blocks $blocks != Remote $remoteblocks\n" else - echo "CHIPS - Blocks $blocks = Headers $longest" + echo "GAME - Blocks $blocks, Remote $remoteblocks" fi for coins in "${coinlist[@]}"; do coin=($coins) + + if [[ ! ${ignoreacs[*]} =~ ${coin[0]} ]]; then - blocks=$(komodo-cli -ac_name=${coin[0]} getinfo | jq .blocks) - longest=$(komodo-cli -ac_name=${coin[0]} getinfo | jq .longestchain) + blocks=$(komodo-cli -ac_name=${coin[0]} getinfo | jq .blocks) + longest=$(komodo-cli -ac_name=${coin[0]} getinfo | jq .longestchain) + remoteblocks=$(echo $remotecheck | jq --arg acname ${coin[0]} '.[] | select(.ac_name==$acname) | .blocks') + + if ((blocks < longest)); then + forked=true + printf "\033[0;31m${coin[0]} - Possible fork!\033[0m Blocks $blocks < LongestChain $longest\n" + elif ((blocks != remoteblocks)); then + forked=true + printf "\033[0;31m${coin[0]} - Possible fork!\033[0m Blocks $blocks != Remote $remoteblocks\n" + else + echo "${coin[0]} - Blocks $blocks, LongestChain $longest, Remote $remoteblocks" + fi - if ((blocks < longest)); then - forked=true - printf "\033[0;31m${coin[0]} - Possible fork!\033[0m Blocks $blocks < LongestChain $longest\n" - else - echo "${coin[0]} - Blocks $blocks = LongestChain $longest" fi done From c3051841b67a1e2b64766f80f9a53b0799855da4 Mon Sep 17 00:00:00 2001 From: webworker01 Date: Tue, 29 May 2018 11:00:41 -0400 Subject: [PATCH 05/19] make available git updates inline to save vertical spacing, better formatting for large balances --- webworker01/stats | 54 +++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/webworker01/stats b/webworker01/stats index a1f58d0..ad39f8d 100755 --- a/webworker01/stats +++ b/webworker01/stats @@ -14,13 +14,11 @@ txscanamount=77777 #You can modify this list of ACs to exclude or comment out the line to show all ignoreacs=('VOTE2018' 'BEER' 'PIZZA') -#git checking - some paths and such -repos=( -'Komodo $HOME/komodo origin/dev' -'Iguana $HOME/SuperNET origin/dev' -'Chips $HOME/chips3 origin/dev' -'GameCredits /home/gamecredits/GameCredits origin/master' -) +#git checking - path and remote branch +komodorepo=('$HOME/komodo origin/dev') +iguanarepo=('$HOME/SuperNET origin/dev') +chipsrepo=('$HOME/chips3 origin/dev') +gamerepo=('/home/gamecredits/GameCredits origin/master') #==End Options== @@ -58,17 +56,17 @@ checkRepo() { prevdir=${PWD} - eval cd "$2" + eval cd "$1" git remote update > /dev/null 2>&1 localrev=$(git rev-parse HEAD) - remoterev=$(git rev-parse $3) + remoterev=$(git rev-parse $2) + cd $prevdir if [ $localrev != $remoterev ]; then - printf "\n\033[0;31m$1 has an update at $3! Local:${localrev:0:7} Upstream:${remoterev:0:7}\033[0m" + printf "\033[0;31m[U]\033[0m" fi - cd $prevdir } #Do not change below for any reason! @@ -83,7 +81,7 @@ timefilter=1525032458 #Second time filter for assetchains (SuperNET commit 07515fb) timefilter2=1525513998 -format="%-8s %7s %6s %7s %12.8f %8s %7s %7s\n" +format="%-11s %7s %6s %7s %.12s %8s %7s %7s\n" othercoins=( 'CHIPS chips-cli' @@ -97,7 +95,7 @@ outputstats () now=$(date +"%Y-%m-%d %T%z") printf "\n\n" - printf "%-8s %7s %6s %7s %12s %8s %7s %7s\n" "-ASSET-" "-NTRZd-" "-UTXO-" "-BLOX-" "-BALANCE-" "-LAST-" "-CNCT-"; + printf "%-11s %7s %6s %7s %12s %8s %7s %7s\n" "-ASSET-" "-NTRZd-" "-UTXO-" "-BLOX-" "-BALANCE-" "-LAST-" "-CNCT-"; btctxinfo=$(bitcoin-cli listtransactions "" $txscanamount) btclastntrztime=$(echo $btctxinfo | jq -r --arg address "$btcntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') @@ -107,18 +105,19 @@ outputstats () "$btcntrzd" \ "$(bitcoin-cli listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(bitcoin-cli getblockchaininfo | jq .blocks)" \ - "$(bitcoin-cli getbalance)" \ + "$(printf "%12.8f" $(bitcoin-cli getbalance))" \ "$(timeSince $btclastntrztime)" \ "$(bitcoin-cli getnetworkinfo | jq .connections)" kmdinfo=$(komodo-cli getinfo) kmdtxinfo=$(komodo-cli listtransactions "" $txscanamount) kmdlastntrztime=$(echo $kmdtxinfo | jq -r --arg address "$kmdntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') - printf "%-8s %7s %6s %7s %.12s %8s %7s %7s\n" "KMD" \ + + printf "$format" "KMD$(checkRepo ${komodorepo[0]} ${komodorepo[1]})" \ " " \ "$(komodo-cli listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(echo $kmdinfo | jq .blocks)" \ - "$(echo $kmdinfo | jq .balance)" \ + "$(printf "%12.8f" $(echo $kmdinfo | jq .balance))" \ "$(timeSince $kmdlastntrztime)" \ "$(echo $kmdinfo | jq .connections)" \ "$(echo $kmdtxinfo | jq '[.[] | select(.generated==true)] | length') mined" @@ -129,9 +128,11 @@ outputstats () if [[ ${coin[0]} == "GAME" ]]; then coinsutxoamount=0.00100000 coinsntraddr=Gftmt8hgzgNu6f1o85HMPuwTVBMSV2TYSt + nameoutput="${coin[0]}$(checkRepo ${gamerepo[0]} ${gamerepo[1]})" else coinsutxoamount=$utxoamt coinsntraddr=$kmdntrzaddr + nameoutput="${coin[0]}$(checkRepo ${chipsrepo[0]} ${chipsrepo[1]})" fi coinsinfo=$(${coin[1]} getinfo) @@ -140,11 +141,11 @@ outputstats () coinsntrzd=$(echo $coinstxinfo | jq --arg address "$coinsntraddr" --arg timefilter $timefilter2 '[.[] | select(.time>=($timefilter|tonumber) and .address==$address and .category=="send")] | length') totalntrzd=$(( $totalntrzd + $coinsntrzd )) - printf "$format" "${coin[0]}" \ + printf "$format" "$nameoutput" \ "$coinsntrzd" \ "$(${coin[1]} listunspent | jq --arg amt "$coinsutxoamount" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(echo $coinsinfo | jq .blocks)" \ - "$(echo $coinsinfo | jq -r '. | (.balance|tostring)')" \ + "$(printf "%12.8f" $(echo $coinsinfo | jq -r '. | (.balance|tostring)'))" \ "$(timeSince $coinslastntrztime)" \ "$(echo $coinsinfo | jq .connections)" done @@ -160,20 +161,23 @@ outputstats () lastntrztime=$(echo $txinfo | jq -r --arg address "$kmdntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') acntrzd=$(echo $txinfo | jq --arg address "$kmdntrzaddr" --arg timefilter $timefilter2 '[.[] | select(.time>=($timefilter|tonumber) and .address==$address and .category=="send")] | length') totalntrzd=$(( $totalntrzd + $acntrzd )) - printf "$format" "${coin[0]}" \ + + if [[ ${coin[0]} == "SUPERNET" ]]; then + nameoutput="${coin[0]}$(checkRepo ${iguanarepo[0]} ${iguanarepo[1]})" + else + nameoutput="${coin[0]}" + fi + + printf "$format" "$nameoutput" \ "$acntrzd" \ "$(komodo-cli -ac_name=${coin[0]} listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(echo $info | jq .blocks)" \ - "$(echo $info | jq .balance)" \ + "$(printf "%12.8f" $(echo $info | jq .balance))" \ "$(timeSince $lastntrztime)" \ "$(echo $info | jq .connections)" fi done - printf "Total: %9s %44s" "$totalntrzd" "$now"; - - for repo in "${repos[@]}"; do - checkRepo ${repo[0]} ${repo[1]} ${repo[2]} - done + printf "Total: %12s %44s" "$totalntrzd" "$now"; } if [ "$sleepytime" != "false" ] From 516d70c3cd10a971569b83ea8174acc2e3a02c8b Mon Sep 17 00:00:00 2001 From: webworker01 Date: Tue, 29 May 2018 12:15:04 -0400 Subject: [PATCH 06/19] formatting for some vertical space savings --- webworker01/stats | 65 +++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/webworker01/stats b/webworker01/stats index ad39f8d..137ea57 100755 --- a/webworker01/stats +++ b/webworker01/stats @@ -15,15 +15,16 @@ txscanamount=77777 ignoreacs=('VOTE2018' 'BEER' 'PIZZA') #git checking - path and remote branch -komodorepo=('$HOME/komodo origin/dev') -iguanarepo=('$HOME/SuperNET origin/dev') -chipsrepo=('$HOME/chips3 origin/dev') -gamerepo=('/home/gamecredits/GameCredits origin/master') +declare -A repos=( +[KMD]='$HOME/komodo origin/dev' +[SUPERNET]='$HOME/SuperNET origin/dev' +[CHIPS]='$HOME/chips3 origin/dev' +[GAME]='/home/gamecredits/GameCredits origin/master' +) #==End Options== -timeSince() -{ +timeSince () { local currentimestamp=$(date +%s) local timecompare=$1 @@ -52,8 +53,11 @@ timeSince() fi } -checkRepo() -{ +checkRepo () { + if [ -z $1 ] || [ -z $2 ]; then + return + fi + prevdir=${PWD} eval cd "$1" @@ -81,7 +85,7 @@ timefilter=1525032458 #Second time filter for assetchains (SuperNET commit 07515fb) timefilter2=1525513998 -format="%-11s %7s %6s %7s %.12s %8s %7s %7s\n" +format="%-11s %7s %6s %7s %.12s %8s %7s %7s" othercoins=( 'CHIPS chips-cli' @@ -92,7 +96,7 @@ outputstats () { count=0 totalntrzd=0 - now=$(date +"%Y-%m-%d %T%z") + now=$(date +"%H:%M") printf "\n\n" printf "%-11s %7s %6s %7s %12s %8s %7s %7s\n" "-ASSET-" "-NTRZd-" "-UTXO-" "-BLOX-" "-BALANCE-" "-LAST-" "-CNCT-"; @@ -101,7 +105,7 @@ outputstats () btclastntrztime=$(echo $btctxinfo | jq -r --arg address "$btcntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') btcntrzd=$(echo $btctxinfo | jq --arg address "$btcntrzaddr" --arg timefilter $timefilter '[.[] | select(.time>=($timefilter|tonumber) and .address==$address and .category=="send")] | length') totalntrzd=$(( $totalntrzd + $btcntrzd )) - printf "$format" "BTC" \ + printf "$format\n" "BTC" \ "$btcntrzd" \ "$(bitcoin-cli listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(bitcoin-cli getblockchaininfo | jq .blocks)" \ @@ -112,8 +116,8 @@ outputstats () kmdinfo=$(komodo-cli getinfo) kmdtxinfo=$(komodo-cli listtransactions "" $txscanamount) kmdlastntrztime=$(echo $kmdtxinfo | jq -r --arg address "$kmdntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') - - printf "$format" "KMD$(checkRepo ${komodorepo[0]} ${komodorepo[1]})" \ + repo=(${repos[KMD]}) + printf "$format\n" "KMD$(checkRepo ${repo[0]} ${repo[1]})" \ " " \ "$(komodo-cli listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(echo $kmdinfo | jq .blocks)" \ @@ -128,11 +132,9 @@ outputstats () if [[ ${coin[0]} == "GAME" ]]; then coinsutxoamount=0.00100000 coinsntraddr=Gftmt8hgzgNu6f1o85HMPuwTVBMSV2TYSt - nameoutput="${coin[0]}$(checkRepo ${gamerepo[0]} ${gamerepo[1]})" else coinsutxoamount=$utxoamt coinsntraddr=$kmdntrzaddr - nameoutput="${coin[0]}$(checkRepo ${chipsrepo[0]} ${chipsrepo[1]})" fi coinsinfo=$(${coin[1]} getinfo) @@ -140,8 +142,8 @@ outputstats () coinslastntrztime=$(echo $coinstxinfo | jq -r --arg address "$coinsntraddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') coinsntrzd=$(echo $coinstxinfo | jq --arg address "$coinsntraddr" --arg timefilter $timefilter2 '[.[] | select(.time>=($timefilter|tonumber) and .address==$address and .category=="send")] | length') totalntrzd=$(( $totalntrzd + $coinsntrzd )) - - printf "$format" "$nameoutput" \ + repo=(${repos[${coin[0]}]}) + printf "$format\n" "${coin[0]}$(checkRepo ${repo[0]} ${repo[1]})" \ "$coinsntrzd" \ "$(${coin[1]} listunspent | jq --arg amt "$coinsutxoamount" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(echo $coinsinfo | jq .blocks)" \ @@ -150,38 +152,41 @@ outputstats () "$(echo $coinsinfo | jq .connections)" done + lastcoin=(${coinlist[-1]}) for coins in "${coinlist[@]}"; do coin=($coins) - if [[ ! ${ignoreacs[*]} =~ ${coin[0]} ]] - then + if [[ ! ${ignoreacs[*]} =~ ${coin[0]} ]]; then info=$(komodo-cli -ac_name=${coin[0]} getinfo) mininginfo=$(komodo-cli -ac_name=${coin[0]} getmininginfo) txinfo=$(komodo-cli -ac_name=${coin[0]} listtransactions "" $txscanamount) lastntrztime=$(echo $txinfo | jq -r --arg address "$kmdntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') acntrzd=$(echo $txinfo | jq --arg address "$kmdntrzaddr" --arg timefilter $timefilter2 '[.[] | select(.time>=($timefilter|tonumber) and .address==$address and .category=="send")] | length') totalntrzd=$(( $totalntrzd + $acntrzd )) - - if [[ ${coin[0]} == "SUPERNET" ]]; then - nameoutput="${coin[0]}$(checkRepo ${iguanarepo[0]} ${iguanarepo[1]})" - else - nameoutput="${coin[0]}" + repo=(${repos[${coin[0]}]}) + laststring="" + + if [[ ${coin[0]} == ${lastcoin[0]} ]]; then + laststring="All:$totalntrzd @$now" fi - - printf "$format" "$nameoutput" \ + + printf "$format" "${coin[0]}$(checkRepo ${repo[0]} ${repo[1]})" \ "$acntrzd" \ "$(komodo-cli -ac_name=${coin[0]} listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(echo $info | jq .blocks)" \ "$(printf "%12.8f" $(echo $info | jq .balance))" \ "$(timeSince $lastntrztime)" \ - "$(echo $info | jq .connections)" + "$(echo $info | jq .connections)" \ + "$laststring" + + if [[ ${coin[0]} != ${lastcoin[0]} ]]; then + echo + fi fi done - printf "Total: %12s %44s" "$totalntrzd" "$now"; } -if [ "$sleepytime" != "false" ] -then +if [ "$sleepytime" != "false" ]; then while true; do outputstats sleep $sleepytime From d498e45efba7de7984efd9b1cd16ea0e1727d82d Mon Sep 17 00:00:00 2001 From: webworker01 Date: Tue, 29 May 2018 12:30:08 -0400 Subject: [PATCH 07/19] tighten up horizontal layout --- webworker01/stats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webworker01/stats b/webworker01/stats index 137ea57..ea61bd8 100755 --- a/webworker01/stats +++ b/webworker01/stats @@ -85,7 +85,7 @@ timefilter=1525032458 #Second time filter for assetchains (SuperNET commit 07515fb) timefilter2=1525513998 -format="%-11s %7s %6s %7s %.12s %8s %7s %7s" +format="%-11s %6s %6s %7s %.12s %6s %6s %6s" othercoins=( 'CHIPS chips-cli' @@ -99,7 +99,7 @@ outputstats () now=$(date +"%H:%M") printf "\n\n" - printf "%-11s %7s %6s %7s %12s %8s %7s %7s\n" "-ASSET-" "-NTRZd-" "-UTXO-" "-BLOX-" "-BALANCE-" "-LAST-" "-CNCT-"; + printf "%-11s %6s %6s %7s %12s %6s %6s %6s\n" "-ASSET-" "-NOTR-" "-UTXO-" "-BLOX-" "-BALANCE-" "-LAST-" "-CNCT-"; btctxinfo=$(bitcoin-cli listtransactions "" $txscanamount) btclastntrztime=$(echo $btctxinfo | jq -r --arg address "$btcntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') From 0cde07e756f82309b62a1d433c2647fa2488950e Mon Sep 17 00:00:00 2001 From: webworker01 Date: Tue, 29 May 2018 13:57:22 -0400 Subject: [PATCH 08/19] add dexstats remote check for checkfork, better formatting --- webworker01/checkfork | 84 ++++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 24 deletions(-) diff --git a/webworker01/checkfork b/webworker01/checkfork index 5653d76..00f2047 100755 --- a/webworker01/checkfork +++ b/webworker01/checkfork @@ -3,48 +3,73 @@ #You can modify this list of ACs to exclude or comment out the line to show all ignoreacs=('VOTE2018' 'BEER' 'PIZZA') +#how far ahead or behind before being marked as a fork +variance=3 + source coinlist forked=false remotecheck=$(curl -Ssf https://komodostats.com/api/notary/summary.json) +remotecheck2=$(curl -Ssf https://dexstats.info/api/explorerstatus.php) + +format="%-8s %8s %8s %8s %8s\n" +redformat="\033[0;31m$format\033[0m" +printf "$format" "-ASSET-" "-BLOCKS-" "-LONG-" "-RMT1-" "-RMT2-" +#KMD blocks=$(komodo-cli getinfo | jq .blocks) longest=$(komodo-cli getinfo | jq .longestchain) remoteblocks=$(echo $remotecheck | jq '.[] | select(.ac_name=="KMD") | .blocks') - +remoteblocks2=$(echo $remotecheck2 | jq '.status[] | select(.chain=="KMD") | .height | tonumber') +diff1=$((blocks-remoteblocks)) +diff2=$((blocks-remoteblocks2)) +thisformat=$format if ((blocks < longest)); then forked=true - printf "\033[0;31mKMD - Possible fork!\033[0m Blocks $blocks < LongestChain $longest\n" -elif ((blocks != remoteblocks)); then + #longest="${colorred}$longest${colorreset}" + thisformat=$redformat +fi +if (( diff1 < variance * -1 )) || (( diff1 > variance )); then forked=true - printf "\033[0;31mKMD - Possible fork!\033[0m Blocks $blocks != Remote $remoteblocks\n" -else - echo "KMD - Blocks $blocks, LongestChain $longest, Remote $remoteblocks" + #remoteblocks="${colorred}$remoteblocks${colorreset}" + thisformat=$redformat fi +if (( diff2 < variance * -1 )) || (( diff2 > variance )); then + forked=true + #remoteblocks2="${colorred}$remoteblocks2${colorreset}" + thisformat=$redformat +fi +printf "$thisformat" "KMD" "$blocks" "$longest" "$remoteblocks" "$remoteblocks2" +#CHIPS blocks=$(chips-cli getinfo | jq .blocks) longest=$(chips-cli getinfo | jq .headers) remoteblocks=$(echo $remotecheck | jq '.[] | select(.ac_name=="CHIPS") | .blocks') - +diff1=$((blocks-remoteblocks)) +thisformat=$format if ((blocks < longest)); then forked=true - printf "\033[0;31mCHIPS - Possible fork!\033[0m Blocks $blocks < Headers $longest\n" -elif ((blocks != remoteblocks)); then + #longest="${colorred}$longest${colorreset}" + thisformat=$redformat +fi +if (( diff1 < variance * -1 )) || (( diff1 > variance )); then forked=true - printf "\033[0;31mCHIPS - Possible fork!\033[0m Blocks $blocks != Remote $remoteblocks\n" -else - echo "CHIPS - Blocks $blocks, LongestChain $longest, Remote $remoteblocks" + #remoteblocks="${colorred}$remoteblocks${colorreset}" + thisformat=$redformat fi +printf "$thisformat" "CHIPS" "$blocks" "$longest" "$remoteblocks" +#GAME blocks=$(gamecredits-cli getinfo | jq .blocks) remoteblocks=$(echo $remotecheck | jq '.[] | select(.ac_name=="GAME") | .blocks') - -if ((blocks != remoteblocks)); then +diff1=$((blocks-remoteblocks)) +thisformat=$format +if (( diff1 < variance * -1 )) || (( diff1 > variance )); then forked=true - printf "\033[0;31mGAME - Possible fork!\033[0m Blocks $blocks != Remote $remoteblocks\n" -else - echo "GAME - Blocks $blocks, Remote $remoteblocks" + #remoteblocks="${colorred}$remoteblocks${colorreset}" + thisformat=$redformat fi +printf "$thisformat" "GAME" "$blocks" " " "$remoteblocks" for coins in "${coinlist[@]}"; do coin=($coins) @@ -54,20 +79,31 @@ for coins in "${coinlist[@]}"; do blocks=$(komodo-cli -ac_name=${coin[0]} getinfo | jq .blocks) longest=$(komodo-cli -ac_name=${coin[0]} getinfo | jq .longestchain) remoteblocks=$(echo $remotecheck | jq --arg acname ${coin[0]} '.[] | select(.ac_name==$acname) | .blocks') - + remoteblocks2=$(echo $remotecheck2 | jq --arg acname ${coin[0]} '.status[] | select(.chain==$acname) | .height | tonumber') + diff1=$((blocks-remoteblocks)) + diff2=$((blocks-remoteblocks2)) + thisformat=$format if ((blocks < longest)); then forked=true - printf "\033[0;31m${coin[0]} - Possible fork!\033[0m Blocks $blocks < LongestChain $longest\n" - elif ((blocks != remoteblocks)); then + #longest="${colorred}$longest${colorreset}" + thisformat=$redformat + fi + if (( diff1 < variance * -1 )) || (( diff1 > variance )); then + forked=true + #remoteblocks="${colorred}$remoteblocks${colorreset}" + thisformat=$redformat + fi + if (( diff2 < variance * -1 )) || (( diff2 > variance )); then forked=true - printf "\033[0;31m${coin[0]} - Possible fork!\033[0m Blocks $blocks != Remote $remoteblocks\n" - else - echo "${coin[0]} - Blocks $blocks, LongestChain $longest, Remote $remoteblocks" + #remoteblocks2="${colorred}$remoteblocks2${colorreset}" + thisformat=$redformat fi - + printf "$thisformat" "${coin[0]}" "$blocks" "$longest" "$remoteblocks" "$remoteblocks2" fi done if [ "$forked" = false ]; then printf "\033[0;32mAll coins are fine\033[0m\n" +else + printf "\033[0;31mPossible fork!\033[0m\n" fi \ No newline at end of file From b6a427c5dbee1c976ad558a565d4e8c6f7e0ffe6 Mon Sep 17 00:00:00 2001 From: webworker01 Date: Tue, 29 May 2018 14:00:54 -0400 Subject: [PATCH 09/19] removed unused lines --- webworker01/checkfork | 9 --------- 1 file changed, 9 deletions(-) diff --git a/webworker01/checkfork b/webworker01/checkfork index 00f2047..7c53a70 100755 --- a/webworker01/checkfork +++ b/webworker01/checkfork @@ -26,17 +26,14 @@ diff2=$((blocks-remoteblocks2)) thisformat=$format if ((blocks < longest)); then forked=true - #longest="${colorred}$longest${colorreset}" thisformat=$redformat fi if (( diff1 < variance * -1 )) || (( diff1 > variance )); then forked=true - #remoteblocks="${colorred}$remoteblocks${colorreset}" thisformat=$redformat fi if (( diff2 < variance * -1 )) || (( diff2 > variance )); then forked=true - #remoteblocks2="${colorred}$remoteblocks2${colorreset}" thisformat=$redformat fi printf "$thisformat" "KMD" "$blocks" "$longest" "$remoteblocks" "$remoteblocks2" @@ -49,12 +46,10 @@ diff1=$((blocks-remoteblocks)) thisformat=$format if ((blocks < longest)); then forked=true - #longest="${colorred}$longest${colorreset}" thisformat=$redformat fi if (( diff1 < variance * -1 )) || (( diff1 > variance )); then forked=true - #remoteblocks="${colorred}$remoteblocks${colorreset}" thisformat=$redformat fi printf "$thisformat" "CHIPS" "$blocks" "$longest" "$remoteblocks" @@ -66,7 +61,6 @@ diff1=$((blocks-remoteblocks)) thisformat=$format if (( diff1 < variance * -1 )) || (( diff1 > variance )); then forked=true - #remoteblocks="${colorred}$remoteblocks${colorreset}" thisformat=$redformat fi printf "$thisformat" "GAME" "$blocks" " " "$remoteblocks" @@ -85,17 +79,14 @@ for coins in "${coinlist[@]}"; do thisformat=$format if ((blocks < longest)); then forked=true - #longest="${colorred}$longest${colorreset}" thisformat=$redformat fi if (( diff1 < variance * -1 )) || (( diff1 > variance )); then forked=true - #remoteblocks="${colorred}$remoteblocks${colorreset}" thisformat=$redformat fi if (( diff2 < variance * -1 )) || (( diff2 > variance )); then forked=true - #remoteblocks2="${colorred}$remoteblocks2${colorreset}" thisformat=$redformat fi printf "$thisformat" "${coin[0]}" "$blocks" "$longest" "$remoteblocks" "$remoteblocks2" From c5af68d736bddc289e7ed587ec939e0c23fb8e76 Mon Sep 17 00:00:00 2001 From: patchkez Date: Wed, 30 May 2018 17:07:22 +0200 Subject: [PATCH 10/19] new coins eql --- dragonriders/dokomodo/yaml/config.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dragonriders/dokomodo/yaml/config.ini b/dragonriders/dokomodo/yaml/config.ini index 97fac67..56026d8 100644 --- a/dragonriders/dokomodo/yaml/config.ini +++ b/dragonriders/dokomodo/yaml/config.ini @@ -34,7 +34,7 @@ write_path_conf = ~/.komodo # List of assetchains to be started, it does not mean when they ar estarted that they are also notarized!!! # List is used to create configuration files for assetchains # to access its data in central registry file -production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC +production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC, GLXT, EQL development_coins_assets = PIZZA, BEER @@ -50,7 +50,7 @@ iguana_url = http://%(iguana_host)s:%(iguana_rpc_port)s # List of chains which will be notarized!!! # This will be used mostly for iguana methods, this list will be used in loop and key of coin will be used # to access its data in central registry file -production_coins = KMD, BTC, LTC, CHIPS, REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, NINJA, OOT, BNTN, CHAIN, PRLPAY, GAME, DSEC +production_coins = KMD, BTC, LTC, CHIPS, REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, NINJA, OOT, BNTN, CHAIN, PRLPAY, GAME, DSEC, GLXT, EQL development_coins = KMD, PIZZA, BEER From c9c1512a5cec92680e3f244fca646e271c994036 Mon Sep 17 00:00:00 2001 From: webworker01 Date: Wed, 6 Jun 2018 16:36:24 +0000 Subject: [PATCH 11/19] fix formatting for kmd update indicator --- webworker01/stats | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/webworker01/stats b/webworker01/stats index ea61bd8..71cafcb 100755 --- a/webworker01/stats +++ b/webworker01/stats @@ -54,23 +54,38 @@ timeSince () { } checkRepo () { - if [ -z $1 ] || [ -z $2 ]; then + if [ -z $1 ] || [ -z $2 ] || [ -z $3 ]; then return fi prevdir=${PWD} - eval cd "$1" + eval cd "$2" + + color_red=$'\033[0;31m' + color_reset=$'\033[0m' git remote update > /dev/null 2>&1 localrev=$(git rev-parse HEAD) - remoterev=$(git rev-parse $2) + remoterev=$(git rev-parse $3) cd $prevdir if [ $localrev != $remoterev ]; then - printf "\033[0;31m[U]\033[0m" + printf "$color_red[U]$color_reset" fi + + case $1 in + KMD) + printf " " + ;; + CHIPS) + printf " " + ;; + GAME) + printf " " + ;; + esac } #Do not change below for any reason! @@ -117,7 +132,7 @@ outputstats () kmdtxinfo=$(komodo-cli listtransactions "" $txscanamount) kmdlastntrztime=$(echo $kmdtxinfo | jq -r --arg address "$kmdntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') repo=(${repos[KMD]}) - printf "$format\n" "KMD$(checkRepo ${repo[0]} ${repo[1]})" \ + printf "$format\n" "KMD$(checkRepo KMD ${repo[0]} ${repo[1]})" \ " " \ "$(komodo-cli listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(echo $kmdinfo | jq .blocks)" \ @@ -143,7 +158,7 @@ outputstats () coinsntrzd=$(echo $coinstxinfo | jq --arg address "$coinsntraddr" --arg timefilter $timefilter2 '[.[] | select(.time>=($timefilter|tonumber) and .address==$address and .category=="send")] | length') totalntrzd=$(( $totalntrzd + $coinsntrzd )) repo=(${repos[${coin[0]}]}) - printf "$format\n" "${coin[0]}$(checkRepo ${repo[0]} ${repo[1]})" \ + printf "$format\n" "${coin[0]}$(checkRepo ${coin[0]} ${repo[0]} ${repo[1]})" \ "$coinsntrzd" \ "$(${coin[1]} listunspent | jq --arg amt "$coinsutxoamount" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(echo $coinsinfo | jq .blocks)" \ @@ -153,6 +168,7 @@ outputstats () done lastcoin=(${coinlist[-1]}) + secondlast=(${coinlist[-2]}) for coins in "${coinlist[@]}"; do coin=($coins) @@ -167,10 +183,13 @@ outputstats () laststring="" if [[ ${coin[0]} == ${lastcoin[0]} ]]; then - laststring="All:$totalntrzd @$now" + laststring="@ $now" + fi + if [[ ${coin[0]} == ${secondlast[0]} ]]; then + laststring="All:$totalntrzd" fi - printf "$format" "${coin[0]}$(checkRepo ${repo[0]} ${repo[1]})" \ + printf "$format" "${coin[0]}$(checkRepo ${coin[0]} ${repo[0]} ${repo[1]})" \ "$acntrzd" \ "$(komodo-cli -ac_name=${coin[0]} listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ "$(echo $info | jq .blocks)" \ From f47eed7551aed2ddb17485dd3007c61efb7c32a0 Mon Sep 17 00:00:00 2001 From: patchkez Date: Mon, 18 Jun 2018 20:24:56 +0200 Subject: [PATCH 12/19] zilla --- dragonriders/dokomodo/yaml/config.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dragonriders/dokomodo/yaml/config.ini b/dragonriders/dokomodo/yaml/config.ini index 56026d8..bb85bff 100644 --- a/dragonriders/dokomodo/yaml/config.ini +++ b/dragonriders/dokomodo/yaml/config.ini @@ -34,7 +34,7 @@ write_path_conf = ~/.komodo # List of assetchains to be started, it does not mean when they ar estarted that they are also notarized!!! # List is used to create configuration files for assetchains # to access its data in central registry file -production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC, GLXT, EQL +production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC, GLXT, EQL, ZILLA development_coins_assets = PIZZA, BEER @@ -50,7 +50,7 @@ iguana_url = http://%(iguana_host)s:%(iguana_rpc_port)s # List of chains which will be notarized!!! # This will be used mostly for iguana methods, this list will be used in loop and key of coin will be used # to access its data in central registry file -production_coins = KMD, BTC, LTC, CHIPS, REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, NINJA, OOT, BNTN, CHAIN, PRLPAY, GAME, DSEC, GLXT, EQL +production_coins = KMD, BTC, LTC, CHIPS, REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, NINJA, OOT, BNTN, CHAIN, PRLPAY, GAME, DSEC, GLXT, EQL, ZILLA development_coins = KMD, PIZZA, BEER From d01af98dbf16fcbf67de8894f82cdc480aa38185 Mon Sep 17 00:00:00 2001 From: patchkez Date: Wed, 27 Jun 2018 09:35:03 +0200 Subject: [PATCH 13/19] new coins --- dragonriders/dokomodo/yaml/config.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dragonriders/dokomodo/yaml/config.ini b/dragonriders/dokomodo/yaml/config.ini index bb85bff..ebbeb7d 100644 --- a/dragonriders/dokomodo/yaml/config.ini +++ b/dragonriders/dokomodo/yaml/config.ini @@ -34,7 +34,7 @@ write_path_conf = ~/.komodo # List of assetchains to be started, it does not mean when they ar estarted that they are also notarized!!! # List is used to create configuration files for assetchains # to access its data in central registry file -production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC, GLXT, EQL, ZILLA +production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC, GLXT, EQL, ZILLA, VRSC, RFOX development_coins_assets = PIZZA, BEER @@ -50,7 +50,7 @@ iguana_url = http://%(iguana_host)s:%(iguana_rpc_port)s # List of chains which will be notarized!!! # This will be used mostly for iguana methods, this list will be used in loop and key of coin will be used # to access its data in central registry file -production_coins = KMD, BTC, LTC, CHIPS, REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, NINJA, OOT, BNTN, CHAIN, PRLPAY, GAME, DSEC, GLXT, EQL, ZILLA +production_coins = KMD, BTC, LTC, CHIPS, REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, NINJA, OOT, BNTN, CHAIN, PRLPAY, GAME, DSEC, GLXT, EQL, ZILLA, VRSC, RFOX development_coins = KMD, PIZZA, BEER From ad6042eda65807de48036fe4641cdec9d6f8ffd9 Mon Sep 17 00:00:00 2001 From: patchkez Date: Wed, 27 Jun 2018 23:03:37 +0200 Subject: [PATCH 14/19] new coin 27 - fix --- dragonriders/dokomodo/yaml/config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dragonriders/dokomodo/yaml/config.ini b/dragonriders/dokomodo/yaml/config.ini index ebbeb7d..0415c79 100644 --- a/dragonriders/dokomodo/yaml/config.ini +++ b/dragonriders/dokomodo/yaml/config.ini @@ -34,7 +34,7 @@ write_path_conf = ~/.komodo # List of assetchains to be started, it does not mean when they ar estarted that they are also notarized!!! # List is used to create configuration files for assetchains # to access its data in central registry file -production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC, GLXT, EQL, ZILLA, VRSC, RFOX +production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC, GLXT, EQL, ZILLA, RFOX development_coins_assets = PIZZA, BEER From 5705bc3618430d6ed7ef81e52eaa022b445d6217 Mon Sep 17 00:00:00 2001 From: webworker01 Date: Thu, 28 Jun 2018 02:28:43 +0000 Subject: [PATCH 15/19] updated coinlist --- webworker01/coinlist | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webworker01/coinlist b/webworker01/coinlist index ec0d7ac..1214984 100644 --- a/webworker01/coinlist +++ b/webworker01/coinlist @@ -27,4 +27,10 @@ coinlist=( 'BNTN 500000000' 'CHAIN 999999' 'PRLPAY 500000000' +'DSEC 7000000' +'GLXT 100000000' +'EQL 500000000' +'ZILLA 11000000' +'RFOX 1000000000' +'VRSC 0' ) From 7f49a4e76c2459286d2ba2b3432f1356ecf8a3a8 Mon Sep 17 00:00:00 2001 From: webworker01 Date: Wed, 11 Jul 2018 21:46:03 +0000 Subject: [PATCH 16/19] move freshubuntu and fail2banstatusall to other repo --- webworker01/README.md | 4 +- webworker01/fail2banstatusall | 7 -- webworker01/freshubuntu | 116 ---------------------------------- 3 files changed, 2 insertions(+), 125 deletions(-) delete mode 100755 webworker01/fail2banstatusall delete mode 100755 webworker01/freshubuntu diff --git a/webworker01/README.md b/webworker01/README.md index 46c76a2..184ccee 100644 --- a/webworker01/README.md +++ b/webworker01/README.md @@ -6,8 +6,6 @@ Script Name | Function **checkforks** | Script to quickly check all assetchains for possible forks **checkmasks** | Check your nodes connectivity to the notary node network **coinlist** | Handy way to keep coin list in one place for other scripts to use (thanks to a-team) -**fail2banstatusall** | Get stats of fail2ban jails -**freshubuntu** | Run this for initial setup of your server for basic security needs (generalized on purpose so it can be used on any server) **killemall** | Hard kill komodo related processes **killthemsoftly** | Kill komodo processes nicely **kmdacfirewall** | UFW settings with commentary @@ -18,5 +16,7 @@ Script Name | Function **start** | Start chipsd and komodod **startac** | Start assetchains **stats** | Fancy cli stats for notary nodes +**fail2banstatusall** | Moved to https://github.com/webworker01/freshubuntu +**freshubuntu** | Moved to https://github.com/webworker01/freshubuntu Donate to motivate! :D RNFgPeabWXWeSq2NnYfvdsjuok5Tccd7xM diff --git a/webworker01/fail2banstatusall b/webworker01/fail2banstatusall deleted file mode 100755 index c5b3136..0000000 --- a/webworker01/fail2banstatusall +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -JAILS=`sudo fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'` -for JAIL in $JAILS -do - sudo fail2ban-client status $JAIL -done diff --git a/webworker01/freshubuntu b/webworker01/freshubuntu deleted file mode 100755 index 23f726c..0000000 --- a/webworker01/freshubuntu +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -if [ "$EUID" -ne 0 ] -then - echo -e "\e[41mPlease use sudo or run as root...\e[0m" - exit -fi - -read -p "Configure timezone & locale? (y/n) " -n 1 DOLOCALE -echo -if [[ $DOLOCALE =~ ^[Yy]$ ]] -then - dpkg-reconfigure tzdata - dpkg-reconfigure locales -fi - -read -p "Upgrade packages? (y/n) " -n 1 DOUPGRADES -echo -if [[ $DOUPGRADES =~ ^[Yy]$ ]] -then - apt-get update && apt-get -y dist-upgrade -fi - -read -p "Install extra tools? (y/n) " -n 1 DOEXTRAS -echo -if [[ $DOEXTRAS =~ ^[Yy]$ ]] -then - apt -y install fail2ban ufw git curl bash-completion htop jq -fi - -read -p "Update hostname? (y/n) " -n 1 DOHOSTNAME -echo -if [[ $DOHOSTNAME =~ ^[Yy]$ ]] -then - read -p "Enter hostname: " NEWHOSTNAME - echo "$NEWHOSTNAME" > /etc/hostname - sed -i "1i127.0.0.1 ${NEWHOSTNAME}" /etc/hosts -fi - -read -p "Disable IPV6? (y/n) " -n 1 DOIPV6 -echo - -if [[ $DOIPV6 =~ ^[Yy]$ ]] -then - echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf - echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf - echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf - sysctl -p -fi - -read -p "Configure UFW? (This will only allow incoming port 22) (y/n) " -n 1 DOUFW -echo -if [[ $DOUFW =~ ^[Yy]$ ]] -then - ufw default deny incoming - ufw default allow outgoing - ufw allow 22 comment 'SSH' - ufw enable - systemctl enable ufw - ufw status -fi - -read -p "Add non-root sudo user? (y/n) " -n 1 DONONROOT -echo -if [[ $DONONROOT =~ ^[Yy]$ ]] -then - read -p "Enter user name: " NEWUSERNAME - echo - useradd -m $NEWUSERNAME - adduser $NEWUSERNAME sudo - passwd $NEWUSERNAME - sudo chsh $NEWUSERNAME -s /bin/bash - - grep -q "^[#]*force_color_prompt=" /home/$NEWUSERNAME/.bashrc && sed -i "/^[#]*force_color_prompt=/c\force_color_prompt=yes" /home/$NEWUSERNAME/.bashrc - - source /home/$NEWUSERNAME/.bashrc - - read -p "Please enter the public key (and label if desired) for $NEWUSERNAME (not recommended: enter to skip): " NEWUSERPUBKEY - if [[ ! -z "$NEWUSERPUBKEY" ]] - then - mkdir -p /home/$NEWUSERNAME/.ssh/ - echo "ssh-rsa $NEWUSERPUBKEY" >> /home/$NEWUSERNAME/.ssh/authorized_keys - chmod -R 700 /home/$NEWUSERNAME/.ssh/ - chown -R $NEWUSERNAME:$NEWUSERNAME /home/$NEWUSERNAME/.ssh/ - - read -p "Copy key to root user? " -n 1 DOROOTKEY - if [[ $DOROOTKEY =~ ^[Yy]$ ]] - then - mkdir -p /root/.ssh - cp /home/$NEWUSERNAME/.ssh/authorized_keys /root/.ssh/ - chown -R root:root /root/.ssh/ - chmod -R 700 /root/.ssh/ - fi - fi - - read -p "Please login with the SSH key on the new user now to verify connectivity. Have you completed this? (y/n) " -n 1 TESTEDCONNECTIVITY - echo - if [[ $TESTEDCONNECTIVITY =~ ^[Yy]$ ]] - then - read -p "Disable root login? " -n 1 DOROOTDISABLE - echo - if [[ $DOROOTDISABLE =~ ^[Yy]$ ]] - then - grep -q "^[#]*PermitRootLogin" /etc/ssh/sshd_config && sed -i "/^[#]*PermitRootLogin/c\PermitRootLogin no" /etc/ssh/sshd_config || echo "PermitRootLogin no" >> /etc/ssh/sshd_config - fi - - grep -q "^[#]*PubkeyAuthentication" /etc/ssh/sshd_config && sed -i "/^[#]*PubkeyAuthentication/c\PubkeyAuthentication yes" /etc/ssh/sshd_config || echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config - grep -q "^[#]*ChallengeResponseAuthentication" /etc/ssh/sshd_config && sed -i "/^[#]*ChallengeResponseAuthentication/c\ChallengeResponseAuthentication no" /etc/ssh/sshd_config || echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config - grep -q "^[#]*PasswordAuthentication" /etc/ssh/sshd_config && sed -i "/^[#]*PasswordAuthentication/c\PasswordAuthentication no" /etc/ssh/sshd_config || echo "PasswordAuthentication no" >> /etc/ssh/sshd_config - - systemctl restart sshd.service - else - echo -e "\e[41mSorry, it won't be safe to do the final steps here then... take care.\e[0m" - fi -fi - \ No newline at end of file From 439a0d91ad73405c77ef064f69807a23d14ae701 Mon Sep 17 00:00:00 2001 From: patchkez Date: Fri, 27 Jul 2018 18:08:54 +0200 Subject: [PATCH 17/19] new SEC coin --- dragonriders/dokomodo/yaml/config.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dragonriders/dokomodo/yaml/config.ini b/dragonriders/dokomodo/yaml/config.ini index 0415c79..a805c15 100644 --- a/dragonriders/dokomodo/yaml/config.ini +++ b/dragonriders/dokomodo/yaml/config.ini @@ -34,7 +34,7 @@ write_path_conf = ~/.komodo # List of assetchains to be started, it does not mean when they ar estarted that they are also notarized!!! # List is used to create configuration files for assetchains # to access its data in central registry file -production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC, GLXT, EQL, ZILLA, RFOX +production_coins_assets = REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, PIZZA, BEER, NINJA, OOT, BNTN, CHAIN, PRLPAY, DSEC, GLXT, EQL, ZILLA, RFOX, SEC development_coins_assets = PIZZA, BEER @@ -50,7 +50,7 @@ iguana_url = http://%(iguana_host)s:%(iguana_rpc_port)s # List of chains which will be notarized!!! # This will be used mostly for iguana methods, this list will be used in loop and key of coin will be used # to access its data in central registry file -production_coins = KMD, BTC, LTC, CHIPS, REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, NINJA, OOT, BNTN, CHAIN, PRLPAY, GAME, DSEC, GLXT, EQL, ZILLA, VRSC, RFOX +production_coins = KMD, BTC, LTC, CHIPS, REVS, SUPERNET, DEX, PANGEA, JUMBLR, BET, CRYPTO, HODL, MSHARK, BOTS, MGW, COQUI, WLC, KV, CEAL, MESH, MNZ, AXO, ETOMIC, BTCH, VOTE2018, NINJA, OOT, BNTN, CHAIN, PRLPAY, GAME, DSEC, GLXT, EQL, ZILLA, VRSC, RFOX, SEC development_coins = KMD, PIZZA, BEER From e176f9073dfad159cdd46a34cb2daa29460ad0f9 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 31 Jul 2018 16:34:46 +0800 Subject: [PATCH 18/19] deleted: stats --- webworker01/stats | 160 ---------------------------------------------- 1 file changed, 160 deletions(-) delete mode 100755 webworker01/stats diff --git a/webworker01/stats b/webworker01/stats deleted file mode 100755 index 2948c27..0000000 --- a/webworker01/stats +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash -#Stats script for Komodo Notary Nodes -# -#Requires jq v1.5+ and bitcoin-cli, komodo-cli and chips-cli installed (e.g. symlinked to /usr/local/bin) - -#==Options - Only Change These== - -#Seconds in display loop, change to false if you don't want it to loop -sleepytime=600 - -#How many transactions back to scan for notarizations -txscanamount=77777 - -#You can modify this list of ACs to exclude or comment out the line to show all -ignoreacs=('VOTE2018' 'BEER' 'PIZZA') - -#==End Options== - -timeSince() -{ - local currentimestamp=$(date +%s) - local timecompare=$1 - - if [ ! -z $timecompare ] && [[ $timecompare != "null" ]] - then - local t=$((currentimestamp-timecompare)) - - local d=$((t/60/60/24)) - local h=$((t/60/60%24)) - local m=$((t/60%60)) - local s=$((t%60)) - - if [[ $d > 0 ]]; then - echo -n "${d}d" - fi - if [[ $h > 0 ]]; then - echo -n "${h}h" - fi - if [[ $d = 0 && $m > 0 ]]; then - echo -n "${m}m" - fi - if [[ $d = 0 && $h = 0 && $m = 0 ]]; then - echo -n "${s}s" - fi - - fi -} - -#Do not change below for any reason! -#The BTC and KMD address here must remain the same. Do not need to enter yours! -source coinlist -utxoamt=0.00010000 -ntrzdamt=-0.00083600 -btcntrzaddr=1P3rU1Nk1pmc2BiWC8dEy9bZa1ZbMp5jfg -kmdntrzaddr=RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA -#Only count KMD->BTC after this timestamp (block 814000) -timefilter=1525032458 -#Second time filter for assetchains (SuperNET commit 07515fb) -timefilter2=1525513998 - -format="%-8s %7s %6s %7s %12.8f %8s %7s %7s\n" - -othercoins=( -'CHIPS chips-cli' -'GAME gamecredits-cli' -) - -outputstats () -{ - count=0 - totalntrzd=0 - now=$(date +"%Y-%m-%d %T%z") - - printf "\n\n" - printf "%-8s %7s %6s %7s %12s %8s %7s %7s\n" "-ASSET-" "-NTRZd-" "-UTXO-" "-BLOX-" "-BALANCE-" "-LAST-" "-CNCT-"; - - btctxinfo=$(bitcoin-cli listtransactions "" $txscanamount) - btclastntrztime=$(echo $btctxinfo | jq -r --arg address "$btcntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') - btcntrzd=$(echo $btctxinfo | jq --arg address "$btcntrzaddr" --arg timefilter $timefilter '[.[] | select(.time>=($timefilter|tonumber) and .address==$address and .category=="send")] | length') - totalntrzd=$(( $totalntrzd + $btcntrzd )) - printf "$format" "BTC" \ - "$btcntrzd" \ - "$(bitcoin-cli listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ - "$(bitcoin-cli getblockchaininfo | jq .blocks)" \ - "$(bitcoin-cli getbalance)" \ - "$(timeSince $btclastntrztime)" \ - "$(bitcoin-cli getnetworkinfo | jq .connections)" - - kmdinfo=$(komodo-cli getinfo) - kmdtxinfo=$(komodo-cli listtransactions "" $txscanamount) - kmdlastntrztime=$(echo $kmdtxinfo | jq -r --arg address "$kmdntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') - printf "%-8s %7s %6s %7s %.12s %8s %7s %7s\n" "KMD" \ - " " \ - "$(komodo-cli listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ - "$(echo $kmdinfo | jq .blocks)" \ - "$(echo $kmdinfo | jq .balance)" \ - "$(timeSince $kmdlastntrztime)" \ - "$(echo $kmdinfo | jq .connections)" \ - "$(echo $kmdtxinfo | jq '[.[] | select(.generated==true)] | length') mined" - - for coins in "${othercoins[@]}"; do - coin=($coins) - - if [[ ${coin[0]} == "GAME" ]]; then - coinsutxoamount=0.00100000 - coinsntraddr=Gftmt8hgzgNu6f1o85HMPuwTVBMSV2TYSt - else - coinsutxoamount=$utxoamt - coinsntraddr=$kmdntrzaddr - fi - - coinsinfo=$(${coin[1]} getinfo) - coinstxinfo=$(${coin[1]} listtransactions "" $txscanamount) - coinslastntrztime=$(echo $coinstxinfo | jq -r --arg address "$coinsntraddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') - coinsntrzd=$(echo $coinstxinfo | jq --arg address "$coinsntraddr" --arg timefilter $timefilter2 '[.[] | select(.time>=($timefilter|tonumber) and .address==$address and .category=="send")] | length') - totalntrzd=$(( $totalntrzd + $coinsntrzd )) - - printf "$format" "${coin[0]}" \ - "$coinsntrzd" \ - "$(${coin[1]} listunspent | jq --arg amt "$coinsutxoamount" '[.[] | select(.amount==($amt|tonumber))] | length')" \ - "$(echo $coinsinfo | jq .blocks)" \ - "$(echo $coinsinfo | jq -r '. | (.balance|tostring)')" \ - "$(timeSince $coinslastntrztime)" \ - "$(echo $coinsinfo | jq .connections)" - done - - for coins in "${coinlist[@]}"; do - coin=($coins) - - if [[ ! ${ignoreacs[*]} =~ ${coin[0]} ]] - then - info=$(komodo-cli -ac_name=${coin[0]} getinfo) - mininginfo=$(komodo-cli -ac_name=${coin[0]} getmininginfo) - txinfo=$(komodo-cli -ac_name=${coin[0]} listtransactions "" $txscanamount) - lastntrztime=$(echo $txinfo | jq -r --arg address "$kmdntrzaddr" '[.[] | select(.address==$address)] | sort_by(.time) | last | "\(.time)"') - acntrzd=$(echo $txinfo | jq --arg address "$kmdntrzaddr" --arg timefilter $timefilter2 '[.[] | select(.time>=($timefilter|tonumber) and .address==$address and .category=="send")] | length') - totalntrzd=$(( $totalntrzd + $acntrzd )) - printf "$format" "${coin[0]}" \ - "$acntrzd" \ - "$(komodo-cli -ac_name=${coin[0]} listunspent | jq --arg amt "$utxoamt" '[.[] | select(.amount==($amt|tonumber))] | length')" \ - "$(echo $info | jq .blocks)" \ - "$(echo $info | jq .balance)" \ - "$(timeSince $lastntrztime)" \ - "$(echo $info | jq .connections)" - fi - done - printf "Total: %9s %44s" "$totalntrzd" "$now"; -} - -if [ "$sleepytime" != "false" ] -then - while true - do - outputstats - sleep $sleepytime - done -else - outputstats - echo -fi From 94d572171d55060820007b46a0259ce6d212ea27 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 31 Jul 2018 18:41:54 +0800 Subject: [PATCH 19/19] modified: btc_splitfunds modified: startassets --- a-team/scripts.notary/btc_splitfunds | 1 + a-team/scripts.notary/sendawaynn.sh | 5 +++-- a-team/scripts.notary/startassets | 18 +++--------------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/a-team/scripts.notary/btc_splitfunds b/a-team/scripts.notary/btc_splitfunds index 30f8b3b..73fd08d 100755 --- a/a-team/scripts.notary/btc_splitfunds +++ b/a-team/scripts.notary/btc_splitfunds @@ -17,4 +17,5 @@ if [ "$UTXOS" -lt "99" ] RESULT="$(acsplit BTC 20)" print_txid "$RESULT" fi +echo "" echo "---------------------------------------------------------------------------------------------" diff --git a/a-team/scripts.notary/sendawaynn.sh b/a-team/scripts.notary/sendawaynn.sh index ce7025a..4dbbf49 100755 --- a/a-team/scripts.notary/sendawaynn.sh +++ b/a-team/scripts.notary/sendawaynn.sh @@ -24,7 +24,7 @@ echo 'Balance: '$balance if (( $(echo "$balance < 11" | bc -l) )); then echo "----------------------------------------------------------------" echo " " - exit +# exit fi # Set the send to address, and send all coinbase transactions @@ -36,9 +36,10 @@ hex=$(curl -s --user $curluser:$curlpass --data-binary "@$curdir/createrawtx.cur nlocktime=$(printf "%08x" $(date +%s) | dd conv=swab 2> /dev/null | rev) hex=${hex::-8}$nlocktime signed=$(curl -s --user $curluser:$curlpass --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransaction", "params": ["'$hex'"]}' -H 'content-type: text/plain;' http://127.0.0.1:$curlport/ | jq -r .result.hex) +echo $signed #Broadcast the transaction -txid=$(curl -s --user $curluser:$curlpass --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["'$signed'"]}' -H 'content-type: text/plain;' http://127.0.0.1:$curlport/ | jq -r .result) +#txid=$(curl -s --user $curluser:$curlpass --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["'$signed'"]}' -H 'content-type: text/plain;' http://127.0.0.1:$curlport/ | jq -r .result) #echo $txid echo "----------------------------------------------------------------" echo " " diff --git a/a-team/scripts.notary/startassets b/a-team/scripts.notary/startassets index d40242e..9e1ef85 100755 --- a/a-team/scripts.notary/startassets +++ b/a-team/scripts.notary/startassets @@ -1,31 +1,19 @@ #!/bin/bash set -eo pipefail +delay=10 source ~/komodo/src/pubkey.txt overide_args="${@}" extra_args="-connect=172.16.16.11" source skip -#wait for deamon to start -delay () { - started=0 - while [[ $started -eq 0 ]]; do - sleep 5 - komodo-cli $1 getbalance - outcome=$(echo $?) - if [[ $outcome -eq 0 ]]; then - started=1 - fi - done -} - verusd $overide_args $extra_args -pubkey=$pubkey & -delay -ac_name=VRSC +sleep $delay ~/komodo/src/listassetchainparams | while read args; do if [[ " ${skip[@]} " =~ " ${args} " ]]; then pointless=0 else komodod $args $overide_args $extra_args -pubkey=$pubkey & - delay $(echo $args | awk '{print $2}') + sleep $delay fi done