UPlanet KEYS Flash Mem process

This commit is contained in:
fred 2024-02-21 13:54:34 +01:00
parent c2e9655e75
commit 17dca2cafc
4 changed files with 63 additions and 17 deletions

View File

@ -87,10 +87,17 @@ fi
###############################################################################
if [[ ${QRCODE} == "station" ]]; then
## CHECK FOR ANY ALREADY RUNNING make_image_ipfs_index_carousel
carouselrunning=$(ps axf --sort=+utime | grep -w 'make_image_ipfs_index_carousel' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
if [[ ! -s ~/.zen/tmp/ISTATION ]]; then
## GENERATE PLAYER G1 TO ZEN ACCOUNTING
ISTATION=$($MY_PATH/../tools/make_image_ipfs_index_carousel.sh | tail -n 1)
echo $ISTATION > ~/.zen/tmp/ISTATION ## STATION G1WALLET CAROUSEL
if [[ $carouselrunning ]]; then
ISTATION="/ipfs/QmVTHH8sTXEqRBsvcKo5jDo16rvp7Q7ERyHZP5vmWUxeS6" ## G1WorldCrafting.jpg
else
## GENERATE PLAYER G1 TO ZEN ACCOUNTING
ISTATION=$($MY_PATH/../tools/make_image_ipfs_index_carousel.sh | tail -n 1)
echo $ISTATION > ~/.zen/tmp/ISTATION ## STATION G1WALLET CAROUSEL
fi
else
ISTATION=$(cat ~/.zen/tmp/ISTATION)
fi

48
UPlanetKEYS_refresh.sh Executable file
View File

@ -0,0 +1,48 @@
#!/bin/bash
########################################################################
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
## EXPLORE SWARM MAPNS
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
## LOG into ~/.zen/tmp/_12345.log
exec 2>&1 >> ~/.zen/tmp/_12345.log
echo "(◕‿◕ ) ${ME} (◕‿◕ ) "
WKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/_index.html | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#WKEYS[@]} " UMAPS"
SKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/SECTORS/_*_*/_*.?_*.?/_index.html | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#SKEYS[@]} " SECTORS"
RKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/REGIONS/_*_*/_index.html | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#RKEYS[@]} " REGIONS"
## CHECK FOR ANY ALREADY MErunning
MErunning=$(ps axf --sort=+utime | grep -w ${ME} | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
[[ $MErunning ]] && echo "${ME} MErunning for too long..." && kill -9 $MErunning
echo "(◕‿◕ ) ${ME} starting UPlanet Terraformation _______________________________"
combined=("${WKEYS[@]}" "${SKEYS[@]}" "${RKEYS[@]}")
UKEYS=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
echo ${#UKEYS[@]} " JOBS..."
## STORAGE FOR IPFS GET on UPLANET KEYS
mkdir -p ~/.zen/tmp/flashmem
floop=0
medo=0
for key in ${UKEYS[@]}; do
rm -Rf ~/.zen/tmp/flashmem
echo "ipfs --timeout 30s get -o ~/.zen/tmp/flashmem /ipns/$key"
ipfs --timeout 30s get -o ~/.zen/tmp/flashmem /ipns/$key
[ $! -eq 0 ] && medo=$((medo +1))
floop=$((floop +1))
[ $floop -gt 100 ] && break
done
echo "(◕‿◕ ) ${ME} :: $medo SUCCESS over $floop KEYS from ${#UKEYS[@]} JOBS"

View File

@ -81,9 +81,12 @@ while true; do
## FIXING TIC TAC FOR NODE & SWARM REFRESH ( 1H )
if [[ ${duree} -gt 3600000 ]]; then
#### UPLANET FLASHMEM UPDATES
${MY_PATH}/UPlanetKEYS_refresh.sh &
#####################################
( ##### SUB-PROCESS RUN
exec 2>&1 >> ~/.zen/tmp/_12345.log
( ##### SUB-PROCESS £
start=`date +%s`
# MONITOR pending

View File

@ -1,12 +0,0 @@
#!/bin/bash
## EXPLORE SWARM MAPNS
echo "World UMAPS"
cat ~/.zen/tmp/swarm/12D*/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/_index.html
echo "World SECTORS"
cat ~/.zen/tmp/swarm/12D*/UPLANET/SECTORS/_*_*/_*.?_*.?/_index.html
echo "World REGIONS"
cat ~/.zen/tmp/swarm/12D*/UPLANET/REGIONS/_*_*/_index.html