Uncoment and add input tx survey

This commit is contained in:
fred 2020-03-14 21:23:14 +01:00
parent 1fe76a70a3
commit 8547a1cef8
1 changed files with 21 additions and 8 deletions

View File

@ -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