SWARM.refresh inspecting and debugging

This commit is contained in:
fred 2023-10-14 17:09:07 +02:00
parent 2d59456951
commit 1ff1d5e305
3 changed files with 2 additions and 61 deletions

View File

@ -48,11 +48,9 @@ espeak "Players refresh" > /dev/null 2>&1
~/.zen/Astroport.ONE/RUNTIME/PLAYER.refresh.sh
espeak "REFRESHING SWARM" > /dev/null 2>&1
# Refresh ~/.zen/game/players/PLAYER
~/.zen/Astroport.ONE/RUNTIME/MAP.refresh.sh
~/.zen/Astroport.ONE/RUNTIME/SWARM.refresh.sh
espeak "REFRESHING UPLANET" > /dev/null 2>&1
# Refresh ~/.zen/game/players/PLAYER
~/.zen/Astroport.ONE/RUNTIME/UPLANET.refresh.sh

View File

@ -1,57 +0,0 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "$MY_PATH/../tools/my.sh"
################################################################################
## MAP REFRESH
# LOAD EXTRA DATA TO CACHE ~/.zen/tmp/${IPFSNODEID}/
# PUBLISH STATION BALISE
############################################
echo "## RUNNING MAP.refresh"
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
#################################################################
## IPFSNODEID ASTRONAUTES SIGNALING ## 12345 port
############################
# UDATE STATION BALISE
if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
# ONLY FRESH DATA HERE
BSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
## Getting actual online version
#~ ipfs get -o ~/.zen/tmp/${IPFSNODEID} /ipns/${IPFSNODEID}/
## COPY STATION yt-dlp.list
cp $HOME/.zen/.yt-dlp.list ~/.zen/tmp/${IPFSNODEID}/yt-dlp.list
## COPY COINS VALUE OF THE DAY
mkdir -p ~/.zen/tmp/${IPFSNODEID}/COINS/
cp -f ~/.zen/tmp/coucou/*.COINS ~/.zen/tmp/${IPFSNODEID}/COINS/
## COPY FRIENDS
PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
echo "FOUND : ${PLAYERONE[@]}"
## RUNING FOR ALL LOCAL PLAYERS
for PLAYER in ${PLAYERONE[@]}; do
echo "${PLAYER} SEEKING OWN FRIENDS"
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/FRIENDS/
cp -Rf ~/.zen/game/players/${PLAYER}/FRIENDS/* ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/FRIENDS/
done
echo "############################################ MY MAP "
ls ~/.zen/tmp/${IPFSNODEID}/
echo "############################################"
NSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
ROUTING=$(ipfs add -rwHq ~/.zen/tmp/${IPFSNODEID}/* | tail -n 1 )
ipfs name publish /ipfs/${ROUTING}
echo ">> $NSIZE Bytes STATION BALISE > ${myIPFS}/ipns/${IPFSNODEID}"
fi
exit 0

View File

@ -78,7 +78,7 @@ while true; do
duree=$(expr ${MOATS} - $lastrun)
## FIXING TIC TAC FOR NODE & SWARM REFRESH ( 1H )
if [[ duree -gt 3600000 ]]; then
if [[ ${duree} -gt 3600000 ]]; then
#####################################
( ##### SUB-PROCESS RUN