From d0db377309c673a6c715b73d0ca876d7aeefd622 Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 1 Apr 2024 22:50:41 +0200 Subject: [PATCH] [days[-1]] --- RUNTIME/G1PalPay.sh | 4 +- RUNTIME/G1Voeu.sh | 2 +- RUNTIME/PLAYER.refresh.sh | 41 ++++---- RUNTIME/UPLANET.refresh.sh | 45 ++++---- RUNTIME/ZEN.SECTOR.memory.sh | 3 +- RUNTIME/ZEN.UMAP.memory.sh | 1 + templates/UPlanetCompass/index.html | 157 +++++++++------------------- tools/getUMAP_ENV.sh | 16 +-- 8 files changed, 111 insertions(+), 158 deletions(-) diff --git a/RUNTIME/G1PalPay.sh b/RUNTIME/G1PalPay.sh index 92d2da5a..5b03daa4 100755 --- a/RUNTIME/G1PalPay.sh +++ b/RUNTIME/G1PalPay.sh @@ -204,10 +204,10 @@ echo "====(•‿‿•)======= %%%%% (°▃▃°) %%%%%%% ======(•‿‿•)= ## SEARCH FOR TODAY MODIFIED TIDDLERS WITH MULTIPLE EMAILS IN TAG # This can could happen in case Tiddler is copied OR PLAYER manualy adds an email tag to Tiddler to share with someone... ################################################################# -echo "# EXTRACT [days:modified[-1]] DAYS TIDDLERS" +echo "# EXTRACT [days[-1]] DAYS TIDDLERS" tiddlywiki --load ${INDEX} \ --output ~/.zen/tmp/${MOATS} \ - --render '.' "today.${PLAYER}.tiddlers.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:modified[-1]]' + --render '.' "today.${PLAYER}.tiddlers.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days[-1]]' # cat ~/.zen/tmp/${MOATS}/today.${PLAYER}.tiddlers.json | jq -rc # LOG diff --git a/RUNTIME/G1Voeu.sh b/RUNTIME/G1Voeu.sh index cc516452..8c6d68fb 100755 --- a/RUNTIME/G1Voeu.sh +++ b/RUNTIME/G1Voeu.sh @@ -151,7 +151,7 @@ TEXT="\n <\$action-navigate \$to=<> \$scroll=no/>\n \n -SHOW G1"${VoeuName}"\n +ALL G1"${VoeuName}"\n " # NEW IVEU TIDDLER diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh index 86b43ef9..b4f9e13e 100755 --- a/RUNTIME/PLAYER.refresh.sh +++ b/RUNTIME/PLAYER.refresh.sh @@ -58,9 +58,9 @@ for PLAYER in ${PLAYERONE[@]}; do cat ~/.zen/tmp/${MOATS}/${PLAYER}.COINScheck ###DEBUG MODE COINS=$(cat ~/.zen/tmp/${MOATS}/${PLAYER}.COINScheck | tail -n 1) ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1) - echo "+++ WALLET BALANCE _ $COINS (G1) _ / $ZEN ♥ /" + echo "+++ WALLET BALANCE _ $COINS (G1) _ / $ZEN ZEN /" - #~ ## ZENCARD ARE ACTIVATED WITH 1 G1 + 10 ♥ (= 10 €/OC) ? + #~ ## ZENCARD ARE ACTIVATED WITH 1 G1 + 10 ZEN (= 10 €/OC) ? echo "## >>>>>>>>>>>>>>>> REFRESH ASTRONAUTE TW" ## REFRESH ASTRONAUTE TW ASTRONAUTENS=$(ipfs key list -l | grep -w ${G1PUB} | cut -d ' ' -f1) @@ -327,18 +327,6 @@ for PLAYER in ${PLAYERONE[@]}; do ## GET ORIGINH FROM LAST KNOWN TW STATE mkdir -p ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER} - if [[ -s ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html ]]; then - tiddlywiki --load ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html \ - --output ~/.zen/tmp/${MOATS} \ - --render '.' "${FPLAYER}.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${FPLAYER}" ## GET ORIGIN - - ORIGINH=$(cat ~/.zen/tmp/${MOATS}/${FPLAYER}.json | jq -r '.[].text' | sha256sum | cut -d ' ' -f 1) - echo "ORIGINH: $ORIGINH" - fi - - ( ## REFRESH LOCAL PLAYER CACHE with FRIEND ACTUAL TW (&) will be used TOMORROW - ipfs --timeout 480s cat --progress=false ${FTW} > ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html - ) & ## CHECK ALREADY IN ${FPLAYER^^} IHASH rm -f ~/.zen/tmp/${MOATS}/finside.json @@ -349,6 +337,23 @@ for PLAYER in ${PLAYERONE[@]}; do INSIDEH=$(cat ~/.zen/tmp/${MOATS}/finside.json | jq -rc '.[].ihash') echo "INSIDEH: $INSIDEH" + if [[ -s ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html ]]; then + tiddlywiki --load ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html \ + --output ~/.zen/tmp/${MOATS} \ + --render '.' "${FPLAYER}.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${FPLAYER}" ## GET ORIGIN + + ORIGINH=$(cat ~/.zen/tmp/${MOATS}/${FPLAYER}.json | jq -r '.[].text' | sha256sum | cut -d ' ' -f 1) + ## USE IPFSH=$(cat ~/.zen/tmp/${MOATS}/${FPLAYER}.json | jq -r '.[].text' | ipfs add -q) + ## TODO MICROLEDGER TIDDLER + echo "ORIGINH: $ORIGINH" + else + ORIGINH="$INSIDEH" + fi + + ( ## REFRESH LOCAL PLAYER CACHE with FRIEND ACTUAL TW (&) will be used TOMORROW + ipfs --timeout 480s cat --progress=false ${FTW} > ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html + ) & + ## UPDATE IF IHASH CHANGED -> New drawing => Friend get informed if [[ -z $INSIDEH || $INSIDEH != $IHASH || $ORIGINH != $INSIDEH ]]; then cat ${MY_PATH}/../templates/data/_UPPERFPLAYER_.json \ @@ -370,7 +375,7 @@ for PLAYER in ${PLAYERONE[@]}; do [[ -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ]] \ && cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \ && rm ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html \ - || echo "ERROR - CANNOT CREATE TW NEWINDEX - ERROR" + || echo "ERROR - CANNOT IMPORT ${FPLAYER^^}.json - ERROR" if [[ $ORIGINH != $INSIDEH && $ORIGINH != "" ]]; then echo "ORIGINH Update" @@ -382,7 +387,7 @@ for PLAYER in ${PLAYERONE[@]}; do [[ -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ]] \ && cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \ && rm ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html \ - || echo "ERROR - CANNOT CREATE TW NEWINDEX - ERROR" + || echo "ERROR - CANNOT IMPORT ${FPLAYER}.json - ERROR" fi fi @@ -535,7 +540,7 @@ if [[ ${days} -ge 14 ]]; then ## DEAD PLAYER ?? if [[ ${days} -eq 27 ]]; then echo "

WARNING.

Your TW will be UNPLUGGED and stop being published..." > ~/.zen/tmp/alert - echo "

TW : ${PLAYER}

ADD MORE ♥ ($ZEN) " >> ~/.zen/tmp/alert + echo "

TW : ${PLAYER}

ADD MORE ZEN ($ZEN) " >> ~/.zen/tmp/alert ${MY_PATH}/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/alert "TW ALERT" echo "<<<< PLAYER TW WARNING <<<< ${DIFF_SECONDS} > ${days} days" @@ -547,7 +552,7 @@ if [[ ${days} -ge 14 ]]; then continue fi - ## PAY 1 ♥ TO UMAPG1PUB + ## PAY 1 ZEN TO UMAPG1PUB [[ "${UMAPG1PUB}" != "" ]] \ && ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "0.1" "${UMAPG1PUB}" "UPLANET:TW:${YOUSER}:/ipfs/${TW}" diff --git a/RUNTIME/UPLANET.refresh.sh b/RUNTIME/UPLANET.refresh.sh index 64573429..6ed013c6 100755 --- a/RUNTIME/UPLANET.refresh.sh +++ b/RUNTIME/UPLANET.refresh.sh @@ -74,7 +74,7 @@ for UMAP in ${unique_combined[@]}; do COINS=$($MY_PATH/../tools/COINScheck.sh ${G1PUB} | tail -n 1) ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1) - echo "UMAP (${COINS} G1) ${ZEN} ♥ : ${G1PUB}" + echo "UMAP (${COINS} G1) ${ZEN} ZEN : ${G1PUB}" ## ORIGIN ########################################################## ## CALCULATE INITIAL UMAP GEOSPACIAL IPNS KEY @@ -104,9 +104,9 @@ for UMAP in ${unique_combined[@]}; do ipfs --timeout 300s get --progress=false -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/ if [[ $? != 0 ]]; then echo "(╥☁╥ ) swarm online memory empty (╥☁╥ )" - # Try retieve memory from UPlanet ♥ Memory + # Try retieve memory from UPlanet ZEN Memory [[ ${ZEN} -gt 0 ]] \ - && echo "INTERCOM Refreshing from ♥ MEMORY" \ + && echo "INTERCOM Refreshing from ZEN MEMORY" \ && ${MY_PATH}/../RUNTIME/ZEN.UMAP.memory.sh "${UMAP}" "${MOATS}" "${G1PUB}" fi # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@ -191,13 +191,13 @@ for UMAP in ${unique_combined[@]}; do echo ">> NEXT REFRESHER WILL BE $(cat ${UREFRESH} | head -n 1)" ######################################################## # NODE SELECTION in UMAP.refresher - ############ 101 ♥ REFILL ?! + ############ 101 ZEN REFILL ?! CURRENT=$(readlink ~/.zen/game/players/.current | rev | cut -d '/' -f 1 | rev) [[ ${COINS} == "" || ${COINS} == "null" ]] \ && [[ ${ZEN} -lt 100 && ${CURRENT} != "" ]] \ && MIUSER=$(${MY_PATH}/../tools/clyuseryomail.sh "${CURRENT}") \ && ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/.current/secret.dunikey" "11.1" "${G1PUB}" "UPLANET:101ZEN:${UMAP}:${MIUSER}" \ - && echo "UPLANET:101:${UMAP}:${MIUSER}" && echo " ~~~ (♥‿‿♥) ~~ _${LAT}_${LON} ~~ (♥‿‿♥) ~~~ " + && echo "UPLANET:101:${UMAP}:${MIUSER}" && echo " ~~~ (ZEN‿‿ZEN) ~~ _${LAT}_${LON} ~~ (ZEN‿‿ZEN) ~~~ " # %%%%%%%%%% ################################################## ## SECTOR LINKING >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${SLAT}_${SLON} @@ -258,10 +258,11 @@ for UMAP in ${unique_combined[@]}; do rm ~/.zen/tmp/${MOATS}/next.priv ## BOOSTRAP SWARM PUBLICATION _next.umapns echo "${G1PUB}:${DEMAINDATE}:${NEXTNS}" \ - > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/_next.umapns - ## IN UMAP KEY PUBLICATION - cp ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/_next.umapns \ - ~/.zen/tmp/${MOATS}/${UMAP}/ + > ~/.zen/tmp/${MOATS}/${UMAP}/_next.umapns + + cp ~/.zen/tmp/${MOATS}/${UMAP}/_next.umapns \ + ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/ + ## SECTOR NEXTNS ############### INFORM "PLAYER.refresh.sh" WITH _next.sector ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/next.priv "${DEMAINDATE}${UPLANETNAME}${SECTOR}" "${DEMAINDATE}${UPLANETNAME}${SECTOR}" ipfs key rm "next" > /dev/null 2>&1 @@ -271,10 +272,11 @@ for UMAP in ${unique_combined[@]}; do rm ~/.zen/tmp/${MOATS}/next.priv ## BOOSTRAP SWARM PUBLICATION _next.sectorns echo "${SECTORG1PUB}:${DEMAINDATE}:${NEXTNS}" \ - > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/_next.sectorns - ## IN UMAP KEY PUBLICATION - cp ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/_next.sectorns \ - ~/.zen/tmp/${MOATS}/${UMAP}/ + > ~/.zen/tmp/${MOATS}/${UMAP}/_next.sectorns + + cp ~/.zen/tmp/${MOATS}/${UMAP}/_next.sectorns \ + ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/ + ## REGION NEXTNS ############### INFORM "PLAYER.refresh.sh" WITH _next.region ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/next.priv "${DEMAINDATE}${UPLANETNAME}${REGION}" "${DEMAINDATE}${UPLANETNAME}${REGION}" ipfs key rm "next" > /dev/null 2>&1 @@ -284,10 +286,11 @@ for UMAP in ${unique_combined[@]}; do rm ~/.zen/tmp/${MOATS}/next.priv ## BOOSTRAP SWARM PUBLICATION _next.regionns echo "${REGIONG1PUB}:${DEMAINDATE}:${NEXTNS}" \ - > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/_next.regionns - ## IN UMAP KEY PUBLICATION - cp ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/_next.regionns \ - ~/.zen/tmp/${MOATS}/${UMAP}/ + > ~/.zen/tmp/${MOATS}/${UMAP}/_next.regionns + + cp ~/.zen/tmp/${MOATS}/${UMAP}/_next.regionns \ + ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/ + #################################################################################### ## TODATE DATA echo "WRITE $TODATE DATA /UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}" @@ -507,12 +510,12 @@ for UMAP in ${unique_combined[@]}; do && echo "UPDATING MOATS" ###################################################### - ## ♥ CHAINING - # Send 1 ♥ to UPlanet SECTORG1PUB Wallet containing REGION TW HASH + ## ZEN CHAINING + # Send 1 ZEN to UPlanet SECTORG1PUB Wallet containing REGION TW HASH INTERCOM="UPLANET:${UMAP}:${TODATE}:/ipfs/${UMAPROOT}" - echo "> INTERCOM ${INTERCOM} (${ZEN} ♥ > 11 ?)" + echo "> INTERCOM ${INTERCOM} (${ZEN} ZEN > 11 ?)" if [[ ${ZEN} -gt 11 ]]; then - echo "---ZZZ-- UMAP 2 SECTOR ♥ CHAINING ---ZZZ------ZZZ----" + echo "---ZZZ-- UMAP 2 SECTOR ZEN CHAINING ---ZZZ------ZZZ----" ${MY_PATH}/../tools/PAY4SURE.sh ~/.zen/tmp/${MOATS}/${UMAP}.dunikey "0.1" "${SECTORG1PUB}" "${INTERCOM}" fi diff --git a/RUNTIME/ZEN.SECTOR.memory.sh b/RUNTIME/ZEN.SECTOR.memory.sh index 5d809613..00f08185 100755 --- a/RUNTIME/ZEN.SECTOR.memory.sh +++ b/RUNTIME/ZEN.SECTOR.memory.sh @@ -56,7 +56,8 @@ if [[ -s ~/.zen/tmp/${MOATS}/${REGION}.g1history.json ]]; then if [[ $ipfs_pop ]]; then g1pub=$(jq -r '.[] | select(.comment | test("UPLANET:'"${SECTOR}"'")) | .pubkey' ~/.zen/tmp/${MOATS}/${REGION}.g1history.json | tail -n 1) echo "INFO :: $g1pub Memory updater" - ipfs --timeout 180s get --progress="false" -o ~/.zen/tmp/${MOATS}/${SECTOR} $ipfs_pop \ + ipfs --timeout 180s get --progress="false" -o ~/.zen/tmp/${MOATS}/${SECTOR} $ipfs_pop + && ipfs pin rm $ipfs_pop \ || echo "$ipfs_pop ERROR ... " else echo "WARNING cannot revover any memory !!" diff --git a/RUNTIME/ZEN.UMAP.memory.sh b/RUNTIME/ZEN.UMAP.memory.sh index e32f0b15..edef0e87 100755 --- a/RUNTIME/ZEN.UMAP.memory.sh +++ b/RUNTIME/ZEN.UMAP.memory.sh @@ -61,6 +61,7 @@ if [[ -s ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json ]]; then g1pub=$(jq -r '.[] | select(.comment | test("UPLANET:'"${UMAP}"'")) | .pubkey' ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json | tail -n 1) echo "INFO :: $g1pub Memory updater" ipfs --timeout 180s get --progress="false" -o ~/.zen/tmp/${MOATS}/${UMAP} $ipfs_pop \ + && ipfs pin rm $ipfs_pop \ || echo "$ipfs_pop ERROR ... " else echo "WARNING cannot revover any memory !!" diff --git a/templates/UPlanetCompass/index.html b/templates/UPlanetCompass/index.html index 420d4588..7162b3ee 100644 --- a/templates/UPlanetCompass/index.html +++ b/templates/UPlanetCompass/index.html @@ -3,128 +3,71 @@ -Compass +Map with Markers + + + + + -
-
-
-
-
-
-
-
-
-
-
+