GEOKEYS_refresh.sh

This commit is contained in:
fred 2024-03-16 10:59:18 +01:00
parent 893295807f
commit 1afb1faa9e
2 changed files with 5 additions and 32 deletions

View File

@ -50,12 +50,11 @@ if [[ -s ~/.zen/tmp/${MOATS}/${REGION}.g1history.json ]]; then
intercom=$(jq -r '.[] | select(.comment | test("UPLANET:'"${SECTOR}"'")) | .comment' ~/.zen/tmp/${MOATS}/${REGION}.g1history.json | tail -n 1)
ipfs_pop=$(echo "$intercom" | rev | cut -d ':' -f 1 | rev)
todate=$(echo "$intercom" | rev | cut -d ':' -f 2 | rev)
echo "SYNC ~/.zen/tmp/${MOATS}/${SECTOR} <=> $ipfs_pop"
echo "SYNC ${SECTOR} <= $todate => $ipfs_pop"
if [[ $ipfs_pop ]]; then
echo "FOUND $todate MEMORY SLOT"
g1pub=$(jq -r '.[] | select(.comment | test("UPLANET:'"${SECTOR}"'")) | .g1pub' ~/.zen/tmp/${MOATS}/${REGION}.g1history.json | tail -n 1)
[[ "$g1pub" != "$G1PUB" ]] && echo "INFO :: $g1pub Memory updater"
g1pub=$(jq -r '.[] | select(.comment | test("UPLANET:'"${SECTOR}"'")) | .pubkey' ~/.zen/tmp/${MOATS}/${REGION}.g1history.json | tail -n 1)
echo "INFO :: $g1pub Memory updater"
[[ "$todate" == "$YESTERDATE" ]] \
&& ipfs --timeout 90s get -o ~/.zen/tmp/${MOATS}/${SECTOR} $ipfs_pop \
|| echo "$ipfs_pop ERROR ... not from $YESTERDATE ... "
@ -71,30 +70,4 @@ fi
end=`date +%s`
echo "(${SECTOR}.memory) ${todate} get time : "`expr $end - $start` seconds.
#~ ## EXTRACT WORLDG1PUB HISTORY
#~ ${MY_PATH}/timeout.sh -t 20 $MY_PATH/jaklis/jaklis.py history -n 300 -p ${WORLDG1PUB} -j \
#~ > ~/.zen/tmp/${MOATS}/${WORLDG1PUB}.g1history.json
#~ ## SCAN FOR UPLANET:${SECTOR} in TX
#~ if [[ -s ~/.zen/tmp/${MOATS}/${WORLDG1PUB}.g1history.json ]]; then
#~ intercom=$(jq -r '.[] | select(.comment | test("UPLANET:'"${SECTOR}"'")) | .comment' ~/.zen/tmp/${MOATS}/${WORLDG1PUB}.g1history.json)
#~ ipfs_pop=$(echo "$intercom" | grep -oP 'UPLANET:'"${SECTOR}"':/ipfs/\K[^"]+')
#~ todate=$(echo "$intercom" | grep -oP 'UPLANET:'"${SECTOR}"':\K[^:]*')
#~ echo "SYNC ~/.zen/tmp/${MOATS}/${SECTOR} <=> /ipfs/$ipfs_pop"
#~ if [[ $ipfs_pop ]]; then
#~ echo "from $todate memory slot"
#~ ipfs --timeout 90s get -o ~/.zen/tmp/${MOATS}/${SECTOR} /ipfs/$ipfs_pop
#~ end=`date +%s`
#~ echo "(${SECTOR}) ${todate} get time : "`expr $end - $start` seconds.
#~ else
#~ echo "WARNING cannot remember... scan for more TX ??!"
#~ fi
#~ else
#~ echo "FATAL ERROR cannot access to WORLDG1PUB history"
#~ exit 1
#~ fi
exit 0

View File

@ -69,7 +69,7 @@ echo 0 > ~/.zen/tmp/random.sleep
#### UPLANET FLASHMEM UPDATES
${MY_PATH}/RUNTIME/UPlanetKEYS_refresh.sh &
${MY_PATH}/RUNTIME/GEOKEYS_refresh.sh &
###################################################################
## WILL SCAN ALL BOOSTRAP - REFRESH "SELF IPNS BALISE" - RECEIVE UPLINK ORDERS
@ -100,7 +100,7 @@ while true; do
${MY_PATH}/ping_bootstrap.sh
#### UPLANET FLASHMEM UPDATES
${MY_PATH}/RUNTIME/UPlanetKEYS_refresh.sh &
${MY_PATH}/RUNTIME/GEOKEYS_refresh.sh &
#####################################
( ##### SUB-PROCESS £