From 8547a1cef8266fdb349346b25f3a17a42ddb1e0f Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 14 Mar 2020 21:23:14 +0100 Subject: [PATCH] Uncoment and add input tx survey --- process-likes-g1tx.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/process-likes-g1tx.sh b/process-likes-g1tx.sh index 9253be5..5693688 100755 --- a/process-likes-g1tx.sh +++ b/process-likes-g1tx.sh @@ -141,15 +141,11 @@ do if [[ $g1_author != $g1pub ]]; then sleep 3 #printf '%s\n' "silkaj -af --file ~/.ssb/secret.dunikey tx --output $g1_author --amountUD 0.1 --comment _SSB:LIKE:$target_id" - - # silkaj -p "$duniter_server" -af --file ~/.ssb/secret.dunikey tx --output $g1_author --amountUD 0.1 --comment "_SSB:LIKE:$target_id" -y 2>/dev/null - - - #thank_you_msg="Hi there! I liked your post and thus sent you Ğ1 #libremoney. We don\'t really know how you may be able to use it but, hey, that is still money, right? Cheers!" - + #### SEND 10 LOVE = 0.1 DU to $g1_author wallet + silkaj -p "$duniter_server" -af --file ~/.ssb/secret.dunikey tx --output $g1_author --amountUD 0.1 --comment "_SSB:LIKE:$target_id" -y 2>/dev/null + #### WRITE RESPONSE MESSAGE sbotc publish '{"type":"post","text":"Thanks for this post ; I have just sent you G1 #libremoney. Claim it! ", "branch": "'"$target_id"'", "root": "'"$root_id"'"}' - - #sleep 60 # DO NOT OVER CHARGE DUNITER + sleep 60 # DO NOT OVER CHARGE DUNITER else echo "I LIKE MY MESSAGE $target_id" fi @@ -160,3 +156,20 @@ do exit 1 fi done + +####################################################################### +## SCAN G1 BLOCKCHAIN FOR INCOMING TX +####################################################################### +EVERY=1 +TIMEBEFORE=$(date --date="-$EVERY minutes" +"%s") +TIMESTAMP=$(date +"%s") +#log "GETTING last $EVERY mn TX : https://duniter-g1.p2p.legal/tx/history/$g1pub/times/$TIMEBEFORE/$TIMESTAMP" +curl -s https://$duniter_server/tx/history/$g1pub/times/$TIMEBEFORE/$TIMESTAMP | jq '.history.pending' | jq '.[].comment' > /tmp/zenfontain.g1tx.txt +while read txincmd +do + export $txincmd + log "$g1pub TX IN PENDING !! COMMENT = " $txincmd + sbotc publish '{"type":"post","text":"I am receiving G1 on my SSB Wallet $g1pub"}' + + +done < /tmp/zenfontain.g1tx.txt