better G1 timestamp precision

This commit is contained in:
qo-op 2020-04-19 19:09:29 +02:00
parent 586e37b6e2
commit 61a4cffa4f
3 changed files with 33 additions and 15 deletions

View File

@ -30,8 +30,8 @@ echo "
"
DELAY="$1"
IPFSNODEID=$(ipfs id -f='<id>\n')
[[ $IPFSNODEID == "" ]] && echo "$USER Please Install IPFS !!" && exit 1
ipfsnodeid=$(ipfs id -f='<id>\n')
[[ "$ipfsnodeid" == "" ]] && echo "$USER Please Install IPFS !!" && exit 1
[[ ! -d ~/.zen/cache/g1_TX_inputs ]] && mkdir -p ~/.zen/cache/g1_TX_inputs # Directory containing G1 blockchain incoming TX Scan
[[ ! -d ~/.zen/ipfs ]] && mkdir -p ~/.zen/ipfs # Directory where NODE store SMS & other Channel Wallets
[[ ! -d ~/.zen/ipfs_swarm ]] && mkdir -p ~/.zen/ipfs_swarm # Local copy of all SSB friends IPFS Nodes published ipfs
@ -61,7 +61,7 @@ fi
#########################################################################################################
echo "======================================="
echo "IPFS Node ID = $IPFSNODEID
echo "IPFS Node ID = $ipfsnodeid
__
_|_ _ _| |\ | _ _| _ /__/| _.|| __|_
(_| |(/_(_|< | \|(_)(_|(/_ \_| | \/\/(_|||(/_|_
@ -96,7 +96,7 @@ if [[ $DELAYUNIT != "minutes" && $DELAYUNIT != "minute" ]]; then
# HOW MANY TX DO WE HAVE...
TXnb=$(cat /tmp/g1_TX.scan.txt | jq '.history.received[].hash' | wc -l)
echo "DETECTED $TXnb TX... Checking TX/IN..."
echo "During $DELAY, detected $TXnb TX... Now looking for INPUT TX..."
# PARSE $TXnb TX
line=1
while [[ $line -le $TXnb ]]; do
@ -122,11 +122,20 @@ ___ ___ _ ___ _
|/\ _|_| \|| |_|| | \(/_(_(/_|\/(/_(_|
"
# Add CASE for received here
###### CREATE ZEN VALUE IN IPFS #########
[[ $CMD == "ZEN" ]] && $MY_PATH/zen_MAKE.sh $ZEN $TXhash
############################################
case "$CMD" in
ZEN)
# Create ZenTAG QRCode
$MY_PATH/zen_MAKE.sh $ZEN $TXhash
;;
*)
echo "$TXhash = $ZEN ZEN"
# $MY_PATH/zen_MAKE.sh "ME" $TXhash
;;
esac
fi
((line++))
@ -139,7 +148,7 @@ else
# MINUTE DELAY = pending // TODO: if anyone succeed in passing $VAR in jq command, both can be merge...
# HOW MANY TX DO WE HAVE...
TXnb=$(cat /tmp/g1_TX.scan.txt | jq '.history.pending[].hash' | wc -l)
echo "DETECTED $TXnb TX... Checking TX/IN..."
echo "During $DELAY, detected $TXnb TX... Now looking for INPUT TX..."
# PARSE $TXnb TX
line=1
while [[ $line -le $TXnb ]]; do
@ -164,12 +173,21 @@ ___ ___ _ ___ _
|/\ _|_| \|| |_|| | (/_| |(_||| |(_|
_|
"
# Add CASE for pending here
###### CREATE ZEN VALUE IN IPFS #########
[[ $CMD == "ZEN" ]] && $MY_PATH/zen_MAKE.sh $ZEN $TXhash
############################################
case "$CMD" in
ZEN)
# Create ZenTAG QRCode
$MY_PATH/zen_MAKE.sh $ZEN $TXhash
;;
*)
echo "$TXhash = $ZEN ZEN"
# $MY_PATH/zen_MAKE.sh "ME" $TXhash
;;
esac
fi
((line++))
done

View File

@ -83,7 +83,7 @@ do
--no-mtime -o "~/.zen/miam/$timestamp/%(id)s.%(ext)s" $msg_ytdlurl
# REFERENCE msg_key AND timestamp
[[ $timestamp ]] && echo "$timestamp" > ~/.zen/zenyta.last.ts
[[ $timestamp ]] && echo "$((timestamp + 1))" > ~/.zen/zenyta.last.ts
[[ $msg_key ]] && echo "$msg_key" > ~/.zen/miam/$timestamp/msg_key
done < <(printf '%s\n' "$messages")

View File

@ -83,7 +83,7 @@ do
--no-mtime -o "~/.zen/miam/$timestamp/%(id)s.%(ext)s" $msg_ytdlurl
# REFERENCE msg_key AND timestamp
[[ $timestamp ]] && echo "$timestamp" > ~/.zen/zenytv.last.ts
[[ $timestamp ]] && echo "$((timestamp + 1))" > ~/.zen/zenytv.last.ts
[[ $msg_key ]] && echo "$msg_key" > ~/.zen/miam/$timestamp/msg_key
done < <(printf '%s\n' "$messages")