diff --git a/.DS_Store b/.DS_Store
index bd03b9f5..d7691240 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/20h12.process.sh b/20h12.process.sh
index c10183ca..78fd8813 100755
--- a/20h12.process.sh
+++ b/20h12.process.sh
@@ -16,7 +16,13 @@ LOWMODE=$(sudo systemctl status ipfs | grep disabled) ## IPFS DISABLED - START O
[[ ! $isLAN ]] && LOWMODE="" ## LOWMODE ONLY FOR LAN STATION
# echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
-sudo systemctl restart ipfs && sleep 10
+#~ sudo systemctl stop astroport
+## CHECK IF IPFS NODE IS RESPONDING (ipfs name resolve ?)
+ipfs --timeout=30s swarm peers 2>/dev/null > ~/.zen/tmp/ipfs.swarm.peers
+[[ ! -s ~/.zen/tmp/ipfs.swarm.peers || $? != 0 ]] \
+ && echo "---- SWARM COMMUNICATION BROKEN / RESTARTING IPFS DAEMON ----" \
+ && sudo systemctl restart ipfs \
+ && sleep 60
floop=0
while [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]]; do
@@ -31,12 +37,21 @@ done
echo "TODAY UPlanet landings"
ls ~/.zen/tmp/ZONE_* 2>/dev/null
-## REMOVE TMP BUT KEEP SWARM and coucou
+## REMOVE TMP BUT KEEP swarm, flashmem and coucou
mv ~/.zen/tmp/swarm ~/.zen/swarm
mv ~/.zen/tmp/coucou ~/.zen/coucou
+mv ~/.zen/tmp/flashmem ~/.zen/flashmem
rm -Rf ~/.zen/tmp/*
mv ~/.zen/swarm ~/.zen/tmp/swarm
mv ~/.zen/coucou ~/.zen/tmp/coucou
+mv ~/.zen/flashmem ~/.zen/tmp/flashmem
+
+### DELAY _12345 ASTROPORT DURING 20H12 UPDATE ###
+MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
+MOATS_plus_5_hours=$(date -d "now + 5 hours" +"%Y%m%d%H%M%S%4N")
+mkdir ~/.zen/tmp/${IPFSNODEID}
+echo ${MOATS_plus_5_hours} > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats
+echo 9000 > ~/.zen/tmp/random.sleep
## UPDATE G1BILLETS code
[[ -s ~/.zen/G1BILLET/G1BILLETS.sh ]] \
diff --git a/AI/Readme.md b/AI/Readme.md
new file mode 100644
index 00000000..c0c56ac2
--- /dev/null
+++ b/AI/Readme.md
@@ -0,0 +1,39 @@
+# Pourquoi ?
+
+## La Monnaie est Buggée !
+Dans l'écosystème actuel, la notion de monnaie est sujette à des défauts.
+ La distinction entre une unité non libre et une monnaie libre révèle des imperfections
+ dans les échanges économiques.
+
+## Blockchain = Registre Global
+La blockchain, en tant que registre global, offre une opportunité de remédier aux lacunes du
+système financier actuel. Elle peut être envisagée comme une carte d'identité pour le Web3,
+offrant transparence et traçabilité.
+
+## IA Apprentissage et Contrôle
+La gestion de l'intelligence artificielle est cruciale. La comparaison entre un ChatGPT privé
+et Mistral libre souligne la nécessité d'un contrôle plus étendu.
+"The PILE", source d'information, demande une cohérence accrue pour garantir une
+diffusion fiable des connaissances.
+
+## Loi de Moore vs Industrie
+La cadence effrénée de la Loi de Moore, avec une progression tous les 1,5 ans,
+se heurte à la réalité industrielle où les cycles d'investissement s'étendent de 3 à 11 ans.
+Les rendements sur investissements sont souvent compromis, créant des opportunités pour de nouveaux acteurs.
+
+## Web2.0 Épileptique
+Les soubresauts du Web2.0, caractérisés par l'instabilité des données et de leur localisation,
+soulignent la nécessité d'une approche plus stable et cohérente.
+
+# Comment ?
+
+## UPlanet / Astroport.ONE
+La solution réside dans UPlanet et Astroport.ONE, des initiatives axées sur la décentralisation et la régulation.
+En adoptant une blockchain multi-grille sphérique et des clés géospatiales, ces plateformes créent un réseau de :
+* stations index (300€)
+* stations de stockage (1500€)
+* stations IA avec GPU (5000€)
+
+
+Ces stations, en synergie, visent à résoudre les problèmes évoqués, offrant une alternative innovante
+pour les investisseurs souhaitant participer à la transformation du paysage technologique.
diff --git a/API/AMZQR.sh b/API/AMZQR.sh
index cecb794b..2cb62f43 100755
--- a/API/AMZQR.sh
+++ b/API/AMZQR.sh
@@ -26,6 +26,8 @@ MOATS=$9
COOKIE=$10"
PORT="$1" THAT="$2" AND="$3" THIS="$4" APPNAME="$5" WHAT="$6" OBJ="$7" VAL="$8" MOATS="$9" COOKIE="$10"
+[[ "$PORT" == "" ]] && echo "$MY_PATH/AMZQR.sh '0' 'la chaine a mettre en QRCODE' 'et' 'TV'" && exit 1
+
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: ${myASTROPORT}
Access-Control-Allow-Credentials: true
@@ -37,6 +39,8 @@ Content-Type: text/html; charset=UTF-8
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
+
+[[ ${MOATS} == "" ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}/
##################################################
@@ -44,10 +48,12 @@ USTRING=$(urldecode "${THAT}")
IMAGE="${THIS}"
[[ ! -s ${MY_PATH}/../images/${IMAGE}.png || ${USTRING} == "" ]] \
- && exho "UNKNOW IMAGE ${IMAGE}" \
- && (echo "$HTTPCORS ERROR - BAD PARAMS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
+ && echo "UNKNOW IMAGE ${IMAGE}" \
+ && ( [[ $PORT != "0" ]] && echo "$HTTPCORS ERROR - BAD PARAMS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 1
+echo amzqr "${USTRING}" -l H -c -p ${MY_PATH}/../images/${IMAGE}.png -n ${MOATS}.png -d ~/.zen/tmp/${MOATS}/
+
## RUN AMZQR
amzqr "${USTRING}" -l H -c -p ${MY_PATH}/../images/${IMAGE}.png -n ${MOATS}.png -d ~/.zen/tmp/${MOATS}/
IPFSMG=$(ipfs add -q ~/.zen/tmp/${MOATS}/${MOATS}.png | tail -n 1)
@@ -55,6 +61,18 @@ echo "${myIPFS}/ipfs/${IPFSMG}"
echo "$HTTPCORS " | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
+if [[ $PORT == "0" ]]; then
+ [[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]] && xdg-open ${myIPFS}/ipfs/${IPFSMG}
+
+ LP=$(ls /dev/usb/lp* 2>/dev/null | head -n1)
+ [[ ! $LP ]] && echo "NO PRINTER FOUND - Brother QL700 validated" && exit 1
+
+ echo "IMPRESSION QRCODE"
+ brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/${MOATS}/${MOATS}.png > ~/.zen/tmp/${MOATS}/toprint.bin 2>/dev/null
+ sudo brother_ql_print ~/.zen/tmp/${MOATS}/toprint.bin $LP
+
+fi
+
rm -Rf ~/.zen/tmp/${MOATS}/
end=`date +%s`
echo "(AMZQR) Operation time was "`expr $end - $start` seconds.
diff --git a/API/UPLANET.sh b/API/UPLANET.sh
index 6af7321e..720e769c 100755
--- a/API/UPLANET.sh
+++ b/API/UPLANET.sh
@@ -159,22 +159,23 @@ mkdir -p ~/.zen/tmp/${MOATS}/${LAT}_${LON}
ipfs key rm ${G1PUB} > /dev/null 2>&1
rm ~/.zen/tmp/${MOATS}/_ipns.priv 2>/dev/null
-${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/_ipns.priv "${YESTERDATE}${UPLANETNAME}${LAT}" "${YESTERDATE}${UPLANETNAME}${LON}"
+${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/_ipns.priv "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}"
UMAPNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/_ipns.priv )
[[ ! ${UMAPNS} ]] && (echo "$HTTPCORS ERROR - (╥☁╥ ) - UMAPNS COMPUTATION DISFUNCTON" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
echo "UMAPNS : ${myIPFS}/ipns/${UMAPNS}"
## ALL TEST PASSED -> CREATE ZENCARD + ASTROID
-NPASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-9) ## NOUVEAU PASS 8 CHIFFRES
-PPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 4) ## STRONGER TW SECURITY "AlpH4nUm"
-NPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 10) ## STRONGER TW SECURITY "AlpH4nUm"
-
+#~ NPASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-9) ## NOUVEAU PASS 8 CHIFFRES
+#~ NPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 10) ## STRONGER TW SECURITY "AlpH4nUm"
+#~ PPASS=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 2)
+PPASS=$(${MY_PATH}/../tools/diceware.sh $(${MY_PATH}/../tools/getcoins_from_gratitude_box.sh) | xargs)
+NPASS=$(${MY_PATH}/../tools/diceware.sh $(${MY_PATH}/../tools/getcoins_from_gratitude_box.sh) | xargs)
## CREATE ASTRONAUTE TW ON CURRENT ASTROPORT
(
-echo VISA.new.sh "${EMAIL}_${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "/ipns/${UMAPNS}" "${LAT}" "${LON}"
+echo VISA.new.sh "${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "/ipns/${UMAPNS}" "${LAT}" "${LON}"
##### (☉_☉ ) #######
-${MY_PATH}/../RUNTIME/VISA.new.sh "${EMAIL}_${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "/ipns/${UMAPNS}" "${LAT}" "${LON}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
+${MY_PATH}/../RUNTIME/VISA.new.sh "${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "/ipns/${UMAPNS}" "${LAT}" "${LON}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
## TO REMOVE : MONITOR
${MY_PATH}/../tools/mailjet.sh "support@qo-op.com" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt "LOG VISA.new $EMAIL" ## Send VISA.new log to EMAIL
@@ -183,10 +184,9 @@ end=`date +%s`
echo "(TW REGISTRATION) Operation time was "`expr $end - $start` seconds.
) &
-
########################################
## Calculating TW IPNS ADDRESS
-TWADD=$(${MY_PATH}/../tools/keygen -t ipfs "${EMAIL}_${PPASS}" "${NPASS}")
+TWADD=$(${MY_PATH}/../tools/keygen -t ipfs "${PPASS}" "${NPASS}")
## HTTP nc ON PORT RESPONSE
echo "$HTTPCORS
@@ -216,11 +216,11 @@ echo "$HTTPCORS
UPlanet Registration
- Your AstroID seeds are:
+ ${EMAIL} AstroID seeds are:
- ${EMAIL}_${PPASS}
- ${NPASS}
-
+ ${PPASS}
+ ${NPASS}
+ ${PASS}
Generating account...
Please check your mail box to get your ZenCard and PIN code.
diff --git a/ASTROBOT/G1CopierYoutube.sh b/ASTROBOT/G1CopierYoutube.sh
index 61fdaad6..b7e1ec8f 100755
--- a/ASTROBOT/G1CopierYoutube.sh
+++ b/ASTROBOT/G1CopierYoutube.sh
@@ -69,11 +69,11 @@ for YURL in $(cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/CopierYoutube.js
lastrun=$(echo "$CMD" | rev | cut -d ':' -f 1 | rev) && echo "$CMD"
duree=$(expr ${MOATS} - $lastrun)
fi
- # ONE WEEK NEW SCAN
- if [[ $duree -ge 604800000 || ! -s ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.cache.${PLAYER} ]]; then
- /usr/local/bin/yt-dlp $BROWSER --print "%(id)s&%(webpage_url)s" "${YURL}" >> ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.cache.${PLAYER}
- sed -i "s~$lastrun~$MOATS~g" ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.command # UPDATE LASTRUN
- fi
+ # ONE WEEK NEW SCAN
+ if [[ $duree -ge 604800000 || ! -s ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.cache.${PLAYER} ]]; then
+ /usr/local/bin/yt-dlp $BROWSER --print "%(id)s&%(webpage_url)s" "${YURL}" 2>/dev/null >> ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.cache.${PLAYER}
+ sed -i "s~$lastrun~$MOATS~g" ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.command # UPDATE LASTRUN
+ fi
done # FINISH YURL loop
@@ -94,6 +94,9 @@ while read LINE;
echo "_____ $LINE _____ $boucle"
YID="$(echo "$LINE" | rev | cut -d '=' -f 1 | rev )"
+ #~ [[ $boucle -gt 50 ]] && break ## TODO SCAN FOR ABROAD SAME COPY DONE
+ ### MAKE BETTER THAN RANDOM !! CONNECT TO THE WARM...
+
###################################################################
## Search for $YID.TW.json TIDDLER in local & MySwarm cache
#~ echo "--- CACHE SEARCH FOR $YID ---"
diff --git a/BOOKS/HowTo_natools.py.md b/BOOKS/HowTo_natools.py.md
new file mode 100644
index 00000000..e985a6e3
--- /dev/null
+++ b/BOOKS/HowTo_natools.py.md
@@ -0,0 +1,48 @@
+To use `natools` for message encryption (to destination) and signature (from sender), you would typically follow these steps:
+
+### 1. Generate Key Pairs:
+ - Both the sender and the recipient need to generate their key pairs (public and private keys). You can use the `natools` script to generate keys.
+
+ ```bash
+ # Sender generate keys
+ python3 natools.py privkey -k ~/.zen/game/sender_secret.dunikey -f cred
+ python3 natools.py pubkey -k ~/.zen/game/sender_secret.dunikey -o sender_public_key
+
+ # Recipient generates keys
+ python3 natools.py privkey -k ~/.zen/game/myswarm_secret.dunikey -f cred
+ python3 natools.py pubkey -k ~/.zen/game/myswarm_secret.dunikey -o recipient_public_key
+ ```
+
+### 2. Encrypt the Message:
+ - The sender uses the recipient's public key to encrypt the message.
+
+ ```bash
+ python3 natools.py encrypt -i plaintext.txt -k recipient_public_key -o encrypted_message.bin
+ ```
+
+### 3. Sign the Message:
+ - The sender signs the original message using their private key.
+
+ ```bash
+ python3 natools.py sign -i plaintext.txt -k sender_private_key -o signature.bin
+ ```
+
+### 4. Verify the Signature:
+ - The recipient uses the sender's public key to verify the signature.
+
+ ```bash
+ python3 natools.py verify -i plaintext.txt -p sender_public_key
+ ```
+
+ - The script will output "Signature OK!" if the verification is successful.
+
+### 5. Decrypt the Message:
+ - The recipient uses their private key to decrypt the message.
+
+ ```bash
+ python3 natools.py decrypt -i encrypted_message.bin -k recipient_private_key -o decrypted_message.txt
+ ```
+
+Now you have successfully performed message encryption to the destination and signature from the sender using the `natools` script. Adjust the file paths and content as needed for your specific use case.
+
+Note: Ensure that both sender and recipient securely store their private keys. Public keys can be shared openly. The encrypted message, signature, and decrypted message are intermediate files used for illustration; adjust as needed in your application.
diff --git a/RUNTIME/DRAGON_p2p_ssh.sh b/RUNTIME/DRAGON_p2p_ssh.sh
index f83529bb..73c50772 100755
--- a/RUNTIME/DRAGON_p2p_ssh.sh
+++ b/RUNTIME/DRAGON_p2p_ssh.sh
@@ -49,7 +49,7 @@ done < ${MY_PATH}/../A_boostrap_ssh.txt
[[ -s ~/.ssh/id_ed25519.pub ]] && cp ~/.ssh/id_ed25519.pub ~/.zen/tmp/${IPFSNODEID}/y_ssh.pub
## DRAGONz PGP/SSH style (https://pad.p2p.legal/keygen)
gpg --export-ssh-key $(cat ~/.zen/game/players/.current/.player) 2>/dev/null > ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub
-[[ -z ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub ]] && rm ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub # remove empty file
+[[ ! -s ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub ]] && rm ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub # remove empty file
############################################
### FORWARD SSH PORT over /x/ssh-${IPFSNODEID}
@@ -69,18 +69,48 @@ echo
PORT=22000
PORT=$((PORT+${RANDOM:0:3}))
-echo "#!/bin/bash
-if [[ ! \$(ipfs p2p ls | grep x/ssh-${IPFSNODEID}) ]]; then
- ipfs --timeout=10s ping -n 3 /p2p/${IPFSNODEID}
- ipfs p2p forward /x/ssh-${IPFSNODEID} /ip4/127.0.0.1/tcp/$PORT /p2p/${IPFSNODEID}
+echo '#!/bin/bash
+if [[ ! $(ipfs p2p ls | grep x/ssh-'${IPFSNODEID}') ]]; then
+ ipfs --timeout=10s ping -n 4 /p2p/'${IPFSNODEID}'
+ [[ $? == 0 ]] \
+ && ipfs p2p forward /x/ssh-'${IPFSNODEID}' /ip4/127.0.0.1/tcp/'${PORT}' /p2p/'${IPFSNODEID}' \
+ && ssh '${USER}'@127.0.0.1 -p '${PORT}' \
+ || echo "CONTACT IPFSNODEID FAILED - ERROR -"
fi
-ssh ${USER}@127.0.0.1 -p $PORT
-" > ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
+' > ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
cat ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
+echo "
+
+ /| /\\
+ /^^^/ |^\Z / |
+ | \Z / |
+ / @ \Z / / \_______
+ ( \ _ / \Z / / /
+ ( ---- /G |\ |Z / / /
+ ( / ---- \ /---'/\ |Z / / /
+ \/--' /--/ /Z / /
+ | /--/ |Z / / \_______
+ / /--/ |Z \ / /
+ --/ /--/ \Z | / /
+ / /--/ \Z / /
+ |--| \Z/ /
+ |---| / /----'
+ \---| /^^^^^^^^^^^^\Z
+ \-/ \Z
+ / / | \Z
+ \---' |\________| |_______ |Z
+ \--' /\/ \|_|_|_|| |_|_|_|_|\_ |Z
+ '------' / / / |_ /Z
+ \---' | / `````` /Z
+ \--' /\/ \ _____________/Z
+ '------' \
+
+"
+
############################################
-echo
+echo "CONNECT WITH THIS COMMAND"
echo "ipfs cat /ipns/${IPFSNODEID}/x_ssh.sh | bash"
############################################
diff --git a/RUNTIME/G1PalPay.sh b/RUNTIME/G1PalPay.sh
index e29014c3..7f88c2b6 100755
--- a/RUNTIME/G1PalPay.sh
+++ b/RUNTIME/G1PalPay.sh
@@ -115,7 +115,6 @@ cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json |
## GET @ in JSON INLINE
while read LINE; do
- echo "MATCHING IN COMMENT"
echo "${LINE}"
JSON=${LINE}
TXIDATE=$(echo $JSON | jq -r .date)
@@ -124,7 +123,6 @@ while read LINE; do
TXIAMOUNTUD=$(echo $JSON | jq -r .amountUD)
COMMENT=$(echo $JSON | jq -r .comment)
- echo ">>> TODO CHECK TX HAPPENS LAST 24H (WHAT IS TXIDATE=$TXIDATE FORMAT ??)"
[[ $(cat ~/.zen/game/players/${PLAYER}/.atdate) -ge $TXIDATE ]] \
&& echo "PalPay $TXIDATE from $TXIPUBKEY ALREADY TREATED - continue" \
&& continue
@@ -132,18 +130,26 @@ while read LINE; do
## GET EMAILS FROM COMMENT
TXIMAILS=($(echo "$COMMENT" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
+ echo "$TXIDATE $TXIPUBKEY $TXIAMOUNT [$TXIAMOUNTUD] $TXIMAILS % $SHARE %"
+ [[ $(echo "$TXIAMOUNT < 0" | bc) ]] \
+ && echo "TX-OUT" \
+ && echo "$TXIDATE" > ~/.zen/game/players/${PLAYER}/.atdate \
+ && continue
+
## DIVIDE INCOMING AMOUNT TO SHARE
echo "N=${#TXIMAILS[@]}"
N=${#TXIMAILS[@]}
- SHARE=$(echo "scale=2; $TXIAMOUNT / $N" | bc)
+ SHAREE=$(echo "scale=2; $TXIAMOUNT / $N" | bc)
+ SHARE=$(makecoord ${SHAREE})
## SHARE is received AMOUT divided by numbers of EMAILS in comment
- echo "$TXIDATE $TXIPUBKEY $TXIAMOUNT [$TXIAMOUNTUD] $TXIMAILS % $SHARE %"
-
# let's loop over TXIMAILS
for EMAIL in "${TXIMAILS[@]}"; do
- [[ ${EMAIL} == $PLAYER ]] && echo "ME MYSELF" && continue
+ [[ ${EMAIL} == $PLAYER ]] \
+ && echo "ME MYSELF" \
+ && echo "$TXIDATE" > ~/.zen/game/players/${PLAYER}/.atdate \
+ && continue
echo "EMAIL : ${EMAIL}"
ASTROTW="" STAMP="" ASTROG1="" ASTROIPFS="" ASTROFEED="" # RESET VAR
@@ -183,7 +189,9 @@ while read LINE; do
fi
## DONE STAMP IT
- [[ $STAMP == 0 ]] && echo "STAMP DONE" && echo "$TXIDATE" > ~/.zen/game/players/${PLAYER}/.atdate ## MEMORIZE LAST TXIDATE
+ [[ $STAMP == 0 ]] \
+ && echo "STAMP DONE" \
+ && echo "$TXIDATE" > ~/.zen/game/players/${PLAYER}/.atdate ## MEMORIZE LAST TXIDATE
done
diff --git a/RUNTIME/G1Voeu.sh b/RUNTIME/G1Voeu.sh
index a62d0c68..cc516452 100755
--- a/RUNTIME/G1Voeu.sh
+++ b/RUNTIME/G1Voeu.sh
@@ -42,75 +42,75 @@ mkdir -p ~/.zen/tmp/${MOATS}
#####################################################
# CREATION DE LA CLEF DERIVEE "G1VOEU"
#####################################################
- source ~/.zen/game/players/${PLAYER}/secret.june ## LE PEPPER DU PLAYER DEVIENT LE SALT DU G1VOEU
- [[ ${PEPPER} ]] && echo "Using PLAYER PEPPER AS WISH SALT" && SECRET1=${PEPPER} ##
- [[ ! ${SECRET1} ]] && SECRET1=$(${MY_PATH}/../tools/diceware.sh 3 | xargs)
+source ~/.zen/game/players/${PLAYER}/secret.june ## LE PEPPER DU PLAYER DEVIENT LE SALT DU G1VOEU
+[[ ${PEPPER} ]] && echo "Using PLAYER PEPPER AS WISH SALT" && SECRET1=${PEPPER} ##
+[[ ! ${SECRET1} ]] && SECRET1=$(${MY_PATH}/../tools/diceware.sh 3 | xargs)
- #~ echo "${SECRET1}"
+#~ echo "${SECRET1}"
- echo "## TITRE DU G1VOEU ? CapitalGluedWords please"
- [[ ! ${TITRE} ]] && read TITRE
- VoeuName=$(echo "${TITRE}" | sed -r 's/\<./\U&/g' | sed 's/ //g') # VoeuName EST LE TITRE DU VOEU : CapitalGluedWords + EMAIL
+echo "## TITRE DU G1VOEU ? CapitalGluedWords please"
+[[ ! ${TITRE} ]] && read TITRE
+VoeuName=$(echo "${TITRE}" | sed -r 's/\<./\U&/g' | sed 's/ //g') # VoeuName EST LE TITRE DU VOEU : CapitalGluedWords + EMAIL
- SECRET2="${VoeuName} ${PLAYER}" ## SECRET2 est "TitreDuVoeu PLAYER"
+SECRET2="${VoeuName} ${PLAYER}" ## SECRET2 est "TitreDuVoeu PLAYER"
- echo "${SECRET2}" && [[ ! ${SECRET2} ]] && echo "EMPTY SECRET2 - ERROR" && exit 1
+echo "${SECRET2}" && [[ ! ${SECRET2} ]] && echo "EMPTY SECRET2 - ERROR" && exit 1
- echo "## keygen PLAYER DERIVATE WISH KEY"
- ${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/wish.dunikey "${SECRET1}" "${SECRET2}"
- WISHG1PUB=$(cat ~/.zen/tmp/${MOATS}/wish.dunikey | grep "pub:" | cut -d ' ' -f 2)
- echo "WISHG1PUB (G1PUB) = ${WISHG1PUB}"
- [[ ${WISHG1PUB} == "" ]] && echo "EMPTY WISHG1PUB G1PUB - ERROR" && exit 1
- mkdir -p ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
- mv ~/.zen/tmp/${MOATS}/wish.dunikey ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/wish.dunikey
+echo "## keygen PLAYER DERIVATE WISH KEY"
+${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/wish.dunikey "${SECRET1}" "${SECRET2}"
+WISHG1PUB=$(cat ~/.zen/tmp/${MOATS}/wish.dunikey | grep "pub:" | cut -d ' ' -f 2)
+echo "WISHG1PUB (G1PUB) = ${WISHG1PUB}"
+[[ ${WISHG1PUB} == "" ]] && echo "EMPTY WISHG1PUB G1PUB - ERROR" && exit 1
+mkdir -p ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
+mv ~/.zen/tmp/${MOATS}/wish.dunikey ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/wish.dunikey
- echo "# NOUVEAU VOEU"
- mkdir -p ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
- ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/qrtw.ipfskey "${SECRET1}" "${SECRET2}"
- ipfs key import ${WISHG1PUB} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/qrtw.ipfskey
- VOEUNS=$(ipfs key list -l | grep -w "${WISHG1PUB}" | cut -d ' ' -f 1 )
- echo "/ipns/${VOEUNS}"
+echo "# NOUVEAU VOEU"
+mkdir -p ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
+${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/qrtw.ipfskey "${SECRET1}" "${SECRET2}"
+ipfs key import ${WISHG1PUB} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/qrtw.ipfskey
+VOEUNS=$(ipfs key list -l | grep -w "${WISHG1PUB}" | cut -d ' ' -f 1 )
+echo "/ipns/${VOEUNS}"
- ## NATOOLS ENCRYPT
- echo "# NATOOLS ENCODING qrtw.ipfskey "
- ${MY_PATH}/../tools/natools.py encrypt -p $G1PUB -i $HOME/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/qrtw.ipfskey -o $HOME/.zen/tmp/${MOATS}/qrtw.ipfskey.$G1PUB.enc
- ENCODING=$(cat $HOME/.zen/tmp/${MOATS}/qrtw.ipfskey.$G1PUB.enc | base16)
- #~ echo $ENCODING
+## NATOOLS ENCRYPT
+echo "# NATOOLS ENCODING qrtw.ipfskey "
+${MY_PATH}/../tools/natools.py encrypt -p $G1PUB -i $HOME/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/qrtw.ipfskey -o $HOME/.zen/tmp/${MOATS}/qrtw.ipfskey.$G1PUB.enc
+ENCODING=$(cat $HOME/.zen/tmp/${MOATS}/qrtw.ipfskey.$G1PUB.enc | base16)
+#~ echo $ENCODING
- ## TEST IPFS
- #~ ipfs --timeout=30s cat /ipns/${VOEUNS} > ~/.zen/tmp/${VOEUNS}.json
- #~ [[ -s ~/.zen/tmp/${VOEUNS}.json ]] \
- #~ && echo "HEY !!! UN CHANNEL EXISTE DEJA POUR CE VOEU ! ~/.zen/tmp/${VOEUNS}.json - EXIT -" \
- #~ && exit 1
+## TEST IPFS
+#~ ipfs --timeout=30s cat /ipns/${VOEUNS} > ~/.zen/tmp/${VOEUNS}.json
+#~ [[ -s ~/.zen/tmp/${VOEUNS}.json ]] \
+#~ && echo "HEY !!! UN CHANNEL EXISTE DEJA POUR CE VOEU ! ~/.zen/tmp/${VOEUNS}.json - EXIT -" \
+#~ && exit 1
- echo "# UPGRADING WORLD WHISHKEY DATABASE"
+echo "# UPGRADING WORLD WHISHKEY DATABASE"
- mkdir -p ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/
- ## A la fois Titre du tag et Pepper construction de clef
- echo ${VoeuName} > ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/.pepper
- echo ${WISHG1PUB} > ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/.wish
+mkdir -p ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/
+## A la fois Titre du tag et Pepper construction de clef
+echo ${VoeuName} > ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/.pepper
+echo ${WISHG1PUB} > ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/.wish
- echo "# CREATION QR CODE"
+echo "# CREATION QR CODE"
- LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
+LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
- qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.WISHLINK.png" "$LIBRA/ipns/${VOEUNS}"
+qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.WISHLINK.png" "$LIBRA/ipns/${VOEUNS}"
- #################################################################
- ## MAKING SPECIAL amrzqr => G1Milgram TICKET
- ## LE QRCODE CORRESPOND A LA CLEF DERIVE "${PLAYER} :: G1${VoeuName} ${PLAYERG1PUB}" avec PASS=YYYYMM
- IMAGIC=$(${MY_PATH}/../tools/VOEUX.print.sh "${PLAYER}" "${VoeuName}" "${MOATS}" "${G1PUB}" | tail -n 1)
- cp ~/.zen/tmp/${MOATS}/START.png ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/
+#################################################################
+## MAKING SPECIAL amrzqr => G1Milgram TICKET
+## LE QRCODE CORRESPOND A LA CLEF DERIVE "${PLAYER} :: G1${VoeuName} ${PLAYERG1PUB}" avec PASS=YYYYMM
+IMAGIC=$(${MY_PATH}/../tools/VOEUX.print.sh "${PLAYER}" "${VoeuName}" "${MOATS}" "${G1PUB}" | tail -n 1)
+cp ~/.zen/tmp/${MOATS}/START.png ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/
- qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.ASTROLINK.png" "$LIBRA/ipns/$ASTRONAUTENS"
- qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.G1ASTRO.png" "${G1PUB}"
- qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.G1WISH.png" "${WISHG1PUB}:ZEN"
- qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.IPNS.png" "/ipns/${VOEUNS}"
+qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.ASTROLINK.png" "$LIBRA/ipns/$ASTRONAUTENS"
+qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.G1ASTRO.png" "${G1PUB}"
+qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.G1WISH.png" "${WISHG1PUB}:ZEN"
+qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.IPNS.png" "/ipns/${VOEUNS}"
#################################
- # PREMIER TYPE ~/.zen/tmp/player.png
- convert $HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.WISHLINK.png -resize 300 ~/.zen/tmp/QRWISHLINK.png
- convert ${MY_PATH}/../images/logoastro.png -resize 220 ~/.zen/tmp/ASTROLOGO.png
+# PREMIER TYPE ~/.zen/tmp/player.png
+convert $HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.WISHLINK.png -resize 300 ~/.zen/tmp/QRWISHLINK.png
+convert ${MY_PATH}/../images/logoastro.png -resize 220 ~/.zen/tmp/ASTROLOGO.png
composite -compose Over -gravity NorthWest -geometry +350+10 ~/.zen/tmp/ASTROLOGO.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/QRWISHLINK.png ~/.zen/tmp/astroport.png ~/.zen/tmp/one.png
@@ -120,9 +120,9 @@ convert -gravity northwest -pointsize 30 -fill black -draw "text 320,300 \"*****
convert -gravity northwest -pointsize 33 -fill black -draw "text 320,350 \"${VoeuName}\"" ~/.zen/tmp/salt.png ~/.zen/tmp/player.png
#################################
- # SECOND TYPE ~/.zen/tmp/voeu.png
- convert $HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.G1WISH.png -resize 300 ~/.zen/tmp/G1WISH.png
- convert ${MY_PATH}/../images/logojeu.png -resize 260 ~/.zen/tmp/MIZLOGO.png
+# SECOND TYPE ~/.zen/tmp/voeu.png
+convert $HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.G1WISH.png -resize 300 ~/.zen/tmp/G1WISH.png
+convert ${MY_PATH}/../images/logojeu.png -resize 260 ~/.zen/tmp/MIZLOGO.png
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/G1WISH.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +300+0 ~/.zen/tmp/QRWISHLINK.png ~/.zen/tmp/astroport.png ~/.zen/tmp/one.png
@@ -131,136 +131,134 @@ composite -compose Over -gravity NorthWest -geometry +320+280 ~/.zen/tmp/MIZLOGO
convert -gravity northwest -pointsize 28 -fill black -draw "text 32,350 \"Ğ1 VOEU\"" ~/.zen/tmp/two.png ~/.zen/tmp/pep.png
convert -gravity northwest -pointsize 50 -fill black -draw "text 30,300 \"${VoeuName}\"" ~/.zen/tmp/pep.png ~/.zen/tmp/voeu.png
- # IMAGE DANS IPFS
- IVOEUPLAY=$(ipfs add -Hq ~/.zen/tmp/player.png | tail -n 1)
- IVOEU=$(ipfs add -Hq ~/.zen/tmp/voeu.png | tail -n 1)
-
- ### G1VOEU LIGHTBEAM :: ${PLAYER}_${VoeuName} :: /ipns/${VOEUNS}
- echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_${VoeuName}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
- echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key-'${VoeuName}'","text":"'${VOEUNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
- echo '[{"title":"$:/plugins/astroport/lightbeams/saver/g1/lightbeam-key-'${VoeuName}'","text":"'${WISHG1PUB}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-g1.json
- echo '[{"title":"$:/plugins/astroport/lightbeams/saver/g1/lightbeam-natools-'${VoeuName}'","text":"'${ENCODING}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-natools.json
-
+# IMAGE DANS IPFS
+IVOEUPLAY=$(ipfs add -Hq ~/.zen/tmp/player.png | tail -n 1)
+IVOEU=$(ipfs add -Hq ~/.zen/tmp/voeu.png | tail -n 1)
+### G1VOEU LIGHTBEAM :: ${PLAYER}_${VoeuName} :: /ipns/${VOEUNS}
+echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_${VoeuName}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
+echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key-'${VoeuName}'","text":"'${VOEUNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
+echo '[{"title":"$:/plugins/astroport/lightbeams/saver/g1/lightbeam-key-'${VoeuName}'","text":"'${WISHG1PUB}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-g1.json
+echo '[{"title":"$:/plugins/astroport/lightbeams/saver/g1/lightbeam-natools-'${VoeuName}'","text":"'${ENCODING}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-natools.json
# TEXT="
"${VoeuName}""
#:[tag[G1CopierYoutube]] [tag[pdf]]
- # Contains QRCode linked to G1VoeuTW and BUTTON listing G1Voeux
- #
- TEXT="
- TW G1Voeu "${PLAYER}"
- <\$button class='tc-tiddlylink'>
- <\$list filter='[tag[G1"${VoeuName}"]]'>
- <\$action-navigate \$to=<> \$scroll=no/>
- \$list>
- Afficher tous vos G1"${VoeuName}"
- \$button>"
+# Contains QRCode linked to G1VoeuTW and BUTTON listing G1Voeux
+#
+TEXT="
\n
+TW G1Voeu "${PLAYER}"
\n\n
+<\$button class='tc-tiddlylink'>\n
+<\$list filter='[tag[G1"${VoeuName}"]]'>\n
+<\$action-navigate \$to=<> \$scroll=no/>\n
+\$list>\n
+SHOW G1"${VoeuName}"\n
+\$button>"
- # NEW IVEU TIDDLER
- echo "## Creation json tiddler : G1${VoeuName} /ipfs/${IVOEU}"
- echo '[
- {
- "created": "'${MOATS}'",
- "title": "'${VoeuName}'",
- "type": "'text/vnd.tiddlywiki'",
- "astronautens": "'/ipns/${ASTRONAUTENS}'",
- "wishns": "'/ipns/${VOEUNS}'",
- "qrcode": "'/ipfs/${IVOEUPLAY}'",
- "decode": "'/ipfs/${IVOEU}'",
- "wish": "'${WISHG1PUB}'",
- "g1pub": "'${G1PUB}'",
- "text": "'${TEXT}'",
- "tags": "'G1Voeu G1${VoeuName} ${PLAYER}'",
- "asksalt": "'${HPass}'",
- "junesec" : "'${ENCODING}'"
- }
+# NEW IVEU TIDDLER
+echo "## Creation json tiddler : G1${VoeuName} /ipfs/${IVOEU}"
+echo '[
+{
+"created": "'${MOATS}'",
+"title": "'${VoeuName}'",
+"type": "'text/vnd.tiddlywiki'",
+"astronautens": "'/ipns/${ASTRONAUTENS}'",
+"wishns": "'/ipns/${VOEUNS}'",
+"qrcode": "'/ipfs/${IVOEUPLAY}'",
+"decode": "'/ipfs/${IVOEU}'",
+"wish": "'${WISHG1PUB}'",
+"g1pub": "'${G1PUB}'",
+"text": "'${TEXT}'",
+"tags": "'G1Voeu G1${VoeuName} ${PLAYER}'",
+"asksalt": "'${HPass}'",
+"junesec" : "'${ENCODING}'"
+}
]
' > ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/${VoeuName}.voeu.json
- rm -f ~/.zen/tmp/newindex.html
+rm -f ~/.zen/tmp/newindex.html
- echo "Nouveau Voeu ${VoeuName} dans MOA $PSEUDO : http://127.0.0.1:8080/ipns/$ASTRONAUTENS"
- tiddlywiki --load $INDEX \
- --deletetiddlers '[tag[voeu]]' \
- --import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/lightbeam-g1.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/lightbeam-natools.json "application/json" \
- --import ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/${VoeuName}.voeu.json "application/json" \
- --output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
+echo "Nouveau Voeu ${VoeuName} dans MOA $PSEUDO : http://127.0.0.1:8080/ipns/$ASTRONAUTENS"
+tiddlywiki --load $INDEX \
+ --deletetiddlers '[tag[voeu]]' \
+ --import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/lightbeam-g1.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/lightbeam-natools.json "application/json" \
+ --import ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/${VoeuName}.voeu.json "application/json" \
+ --output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
- echo "PLAYER TW Update..."
- if [[ -s ~/.zen/tmp/newindex.html ]]; then
- echo "___ Mise à jour $INDEX"
- cp -f ~/.zen/tmp/newindex.html $INDEX
- else
- echo "ERROR INTO ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/${VoeuName}.voeu.json"
- fi
+echo "PLAYER TW Update..."
+if [[ -s ~/.zen/tmp/newindex.html ]]; then
+ echo "___ Mise à jour $INDEX"
+ cp -f ~/.zen/tmp/newindex.html $INDEX
+else
+ echo "ERROR INTO ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/${VoeuName}.voeu.json"
+fi
- # PRINTING
- LP=$(ls /dev/usb/lp* | head -n1)
- if [[ ! $LP ]]; then
- echo "NO PRINTER FOUND - Plug a Brother QL700 or Add your printer"
- else
- echo "IMPRESSION VOEU"
- brother_ql_create --model QL-700 --label-size 62 ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/result.png > ~/.zen/tmp/toprint.bin 2>/dev/null
- sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
- brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/player.png > ~/.zen/tmp/toprint.bin 2>/dev/null
- sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
- brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/voeu.png > ~/.zen/tmp/toprint.bin 2>/dev/null
- sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
- fi
+# PRINTING
+LP=$(ls /dev/usb/lp* | head -n1)
+if [[ ! $LP ]]; then
+ echo "NO PRINTER FOUND - Plug a Brother QL700 or Add your printer"
+else
+ echo "IMPRESSION VOEU"
+ brother_ql_create --model QL-700 --label-size 62 ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/result.png > ~/.zen/tmp/toprint.bin 2>/dev/null
+ sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
+ brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/player.png > ~/.zen/tmp/toprint.bin 2>/dev/null
+ sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
+ brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/voeu.png > ~/.zen/tmp/toprint.bin 2>/dev/null
+ sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
+fi
- # COPY QR CODE TO PLAYER ZONE
- cp ~/.zen/tmp/player.png ~/.zen/tmp/voeu.png ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
- echo "${SECRET1}" > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.salt
- echo "${VoeuName}" > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.title
+# COPY QR CODE TO PLAYER ZONE
+cp ~/.zen/tmp/player.png ~/.zen/tmp/voeu.png ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
+echo "${SECRET1}" > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.salt
+echo "${VoeuName}" > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.title
- echo "$LIBRA/ipns/${VOEUNS}" > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.link
- cp ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.link ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/
- cp ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/*.png ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
+echo "$LIBRA/ipns/${VOEUNS}" > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.link
+cp ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.link ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/
+cp ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/*.png ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
- # PUBLISHING
- echo "ipfs name publish --key=${WISHG1PUB}"
- banner="## ${PLAYER} G1WISH READY :: G1${VoeuName}
-
- G1Voeu Astronaute (TW) : $LIBRA/ipns/$ASTRONAUTENS
- ${VoeuName} FLUX Ŋ1
- G1${VoeuName} : $LIBRA/ipns/${VOEUNS}
- WISH G1PUB : ${WISHG1PUB}"
+# PUBLISHING
+echo "ipfs name publish --key=${WISHG1PUB}"
+banner="## ${PLAYER} G1WISH READY :: G1${VoeuName}
+
+G1Voeu Astronaute (TW) : $LIBRA/ipns/$ASTRONAUTENS
+${VoeuName} FLUX Ŋ1
+G1${VoeuName} : $LIBRA/ipns/${VOEUNS}
+WISH G1PUB : ${WISHG1PUB}"
- IPUSH=$(echo "$banner" | ipfs add -q | tail -n 1)
- ipfs name publish --key=${WISHG1PUB} /ipfs/$IPUSH 2>/dev/null
+IPUSH=$(echo "$banner" | ipfs add -q | tail -n 1)
+ipfs name publish --key=${WISHG1PUB} /ipfs/$IPUSH 2>/dev/null
- echo $IPUSH > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.chain.${MOATS}
+echo $IPUSH > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.chain.${MOATS}
- echo $banner > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/banner
- cat ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/banner
+echo $banner > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/banner
+cat ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/banner
- #~ echo "## TO RECEIVE G1RONDS Creating Cesium+ Profil #### timeout long ... patience ...."
- #~ ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/wish.dunikey set --name "G1Voeu ${VoeuName}" --avatar "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/result_qrcode.png" --site "$LIBRA/ipns/${VOEUNS}" #CESIUM+
- #~ [[ ! $? == 0 ]] && echo "G1VOEU CESIUM WALLET PROFILE CREATION FAILED !!!!"
+#~ echo "## TO RECEIVE G1RONDS Creating Cesium+ Profil #### timeout long ... patience ...."
+#~ ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/wish.dunikey set --name "G1Voeu ${VoeuName}" --avatar "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/result_qrcode.png" --site "$LIBRA/ipns/${VOEUNS}" #CESIUM+
+#~ [[ ! $? == 0 ]] && echo "G1VOEU CESIUM WALLET PROFILE CREATION FAILED !!!!"
- echo "************************************************************"
- #~ echo "COULD LIMIT ON JUNE pour le Voeu ${VoeuName}"
- #~ echo ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a 1 -p ${WISHG1PUB} -c \'"${VOEUNS} G1Voeu ${VoeuName}"\' -m
- #~ echo "************************************************************"
- #~ echo "************************************************************"
+echo "************************************************************"
+#~ echo "COULD LIMIT ON JUNE pour le Voeu ${VoeuName}"
+#~ echo ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a 1 -p ${WISHG1PUB} -c \'"${VOEUNS} G1Voeu ${VoeuName}"\' -m
+#~ echo "************************************************************"
+#~ echo "************************************************************"
- #~ ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a 1 -p ${WISHG1PUB} -c "$VOEUXNS G1Voeu ${VoeuName}" -m
- #~ [[ ! $? == 0 ]] \
- #~ && echo "SOOOOOOOOOOOORRRRRRRY GUY. YOU CANNOT PAY A G1 A NEW WISH - THIS IS FREE TO CHANGE -"
- #~ && rm -Rf ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB} \
- #~ && rm -Rf ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/ \
- #~ && ipfs key rm ${WISHG1PUB} \
- #~ && tiddlywiki --load ${INDEX} \
- #~ --deletetiddlers '${VoeuName}' \
- #~ --output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain" \
- #~ && cp -f ~/.zen/tmp/newindex.html $INDEX \
- #~ && echo "G1${VoeuName} FLUX REMOVED"
+#~ ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a 1 -p ${WISHG1PUB} -c "$VOEUXNS G1Voeu ${VoeuName}" -m
+#~ [[ ! $? == 0 ]] \
+#~ && echo "SOOOOOOOOOOOORRRRRRRY GUY. YOU CANNOT PAY A G1 A NEW WISH - THIS IS FREE TO CHANGE -"
+#~ && rm -Rf ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB} \
+#~ && rm -Rf ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/ \
+#~ && ipfs key rm ${WISHG1PUB} \
+#~ && tiddlywiki --load ${INDEX} \
+ #~ --deletetiddlers '${VoeuName}' \
+ #~ --output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain" \
+#~ && cp -f ~/.zen/tmp/newindex.html $INDEX \
+#~ && echo "G1${VoeuName} FLUX REMOVED"
- echo "************************************************************"
+echo "************************************************************"
exit 0
diff --git a/RUNTIME/UPlanetKEYS_refresh.sh b/RUNTIME/GEOKEYS_refresh.sh
similarity index 69%
rename from RUNTIME/UPlanetKEYS_refresh.sh
rename to RUNTIME/GEOKEYS_refresh.sh
index 0ac3edcd..77a22be3 100755
--- a/RUNTIME/UPlanetKEYS_refresh.sh
+++ b/RUNTIME/GEOKEYS_refresh.sh
@@ -14,6 +14,11 @@ exec 2>&1 >> ~/.zen/tmp/_12345.log
echo "=========================="
echo "(◕‿◕ ) ${ME} (◕‿◕ ) "
+#~ ## CHECK IF ALREADY MErunning
+countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l)
+[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0
+
+echo "(◕‿◕ ) ${ME} starting UPlanet Key Scan _______________________________"
## LOCAL
LWKEYS=($(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
@@ -31,26 +36,19 @@ echo ${#SKEYS[@]} " swarm SECTORS"
RKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/REGIONS/_*_*/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#RKEYS[@]} " swarm 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 _______________________________"
-
## COMBINE & SHUFFLE KEYS
combined=("${LWKEYS[@]}" "${LSKEYS[@]}" "${LRKEYS[@]}" "${WKEYS[@]}" "${SKEYS[@]}" "${RKEYS[@]}")
UKEYS=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
-echo ${#UKEYS[@]} " JOBS..."
+echo "SYNC ${#UKEYS[@]} GEOKEYS..."
## STORAGE FOR IPFS GET UplanetKeyS
mkdir -p ~/.zen/tmp/flashmem
## Remove flashmem/UplanetKey older than 3 hours
-find ~/.zen/tmp/flashmem -mmin +180 -exec rm -r {} +
+find ~/.zen/tmp/flashmem -mmin +180 -exec rm -rf {} +
floop=0
medo=0
-
for key in ${UKEYS[@]}; do
[[ -d ~/.zen/tmp/flashmem/$key ]] \
@@ -69,7 +67,33 @@ for key in ${UKEYS[@]}; do
done
echo "=========================="
-echo "(◕‿◕ ) ${ME} :: $medo SUCCESS missing $floop KEYS from ${#UKEYS[@]} JOBS"
+echo "(◕‿◕ ) ${ME} :: $medo SUCCESS missing $floop KEYS from ${#UKEYS[@]} GEOKEYS"
+echo "=========================="
+
+## Search for TW /ipfs/ and refresh
+TWS=($(cat ~/.zen/tmp/flashmem/*/TWz/*/_index.html | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf))
+echo "SYNC ${#TWS[@]} TWs..."
+floop=0
+medo=0
+for tw in ${TWS[@]}; do
+
+ [[ -d ~/.zen/tmp/flashmem/tw/$tw ]] \
+ && echo "$key already copied" && medo=$((medo +1)) && continue
+
+ floop=$((floop +1))
+ mkdir -p ~/.zen/tmp/flashmem/tw/$tw
+
+ ipfs --timeout 180s get -o ~/.zen/tmp/flashmem/tw/$tw/index.html /ipns/$tw
+ [[ $? == 0 ]] \
+ && medo=$((medo +1)) && floop=$((floop -1)) \
+ || rm -Rf ~/.zen/tmp/flashmem/tw/$tw
+
+ [ $floop -gt 33 ] && break
+
+done
+
+echo "=========================="
+echo "(✜‿‿✜) ${ME} :: $medo SUCCESS missing $floop KEYS from ${#TWS[@]} TWS"
echo "=========================="
exit 0
diff --git a/RUNTIME/NODE.refresh.sh b/RUNTIME/NODE.refresh.sh
index 8ba33bd3..63381e28 100755
--- a/RUNTIME/NODE.refresh.sh
+++ b/RUNTIME/NODE.refresh.sh
@@ -73,7 +73,7 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
fi
-## CLEANING SWARM 3 DAYS OLD
+echo "## CLEANING SWARM 3 DAYS OLD"
find ~/.zen/tmp/swarm/ -mtime +3 -type d -exec rm -Rf '{}' \;
exit 0
diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh
index cb4f322c..efd0153d 100755
--- a/RUNTIME/PLAYER.refresh.sh
+++ b/RUNTIME/PLAYER.refresh.sh
@@ -18,12 +18,13 @@ PLAYERONE="$1"
[[ ! ${PLAYERONE} ]] && PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
echo "FOUND : ${PLAYERONE[@]}"
+CURRENT=$(readlink ~/.zen/game/players/.current | rev | cut -d '/' -f 1 | rev)
-echo "RENEWING UPLANET NODE CACHE
+echo "RENEWING LOCAL UPLANET REPOSITORY (ADMIN=${CURRENT})
~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??"
rm -Rf ~/.zen/tmp/${IPFSNODEID}/UPLANET
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET
-echo "CLEANING TW NODE CACHE ~/.zen/tmp/${IPFSNODEID}/TW/"
+echo "CLEANING IPFSNODEID TW CACHE ~/.zen/tmp/${IPFSNODEID}/TW/"
rm -Rf ~/.zen/tmp/${IPFSNODEID}/TW/
## RUNING FOR ALL LOCAL PLAYERS
@@ -31,12 +32,15 @@ for PLAYER in ${PLAYERONE[@]}; do
[[ ! -d ~/.zen/game/players/${PLAYER:-undefined} ]] && echo "BAD ${PLAYERONE}" && continue
[[ ! $(echo "${PLAYER}" | grep '@') ]] && continue
+ start=`date +%s`
# CLEAN LOST ACCOUNT
[[ ! -s ~/.zen/game/players/${PLAYER}/secret.dunikey ]] \
&& rm -Rf ~/.zen/game/players/${PLAYER} \
- && echo "${PLAYER} WAS BADLY PLUGGED" \
+ && echo "WARNING - ERASE ${PLAYER} - BADLY PLUGGED" \
&& continue
+ YOUSER=$($MY_PATH/../tools/clyuseryomail.sh "${PLAYER}")
+
### UPGRADE PLAYER for myos IPFS API ### DOUBLON WITH VISA.new (TO REMOVE)
mkdir -p ~/.zen/game/players/${PLAYER}/.ipfs # Prepare PLAYER datastructure
echo "/ip4/127.0.0.1/tcp/5001" > ~/.zen/game/players/${PLAYER}/.ipfs/api
@@ -44,30 +48,30 @@ for PLAYER in ${PLAYERONE[@]}; do
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}
+ echo "############################################ ~/.zen/tmp/${MOATS}"
echo "##################################################################"
- echo "##################################################################"
- echo ">>>>> PLAYER : ${PLAYER} >>>>>>>>>>>>> REFRESHING TW STATION"
- echo "##################################################################"
+ echo ">>>>> PLAYER : ${PLAYER} >>>>>>>>>>>>> REFRESHING TW "
+ echo "################################################ $(date)"
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
# Get PLAYER wallet amount
- $MY_PATH/../tools/COINScheck.sh $G1PUB > ~/.zen/tmp/g1reveal
- cat ~/.zen/tmp/g1reveal ###DEBUG MODE
- COINS=$(cat ~/.zen/tmp/g1reveal | tail -n 1)
+ $MY_PATH/../tools/COINScheck.sh ${G1PUB} > ~/.zen/tmp/${MOATS}/${PLAYER}.COINScheck
+ 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 ZEN /"
- #~ ## ZENCARD ARE ACTIVATED WITH 1 G1 + 10 ZEN (= 1 €OC) ?
- echo "##>>>>>>>>>>>>>>>> REFRESH ASTRONAUTE TW"
-
+ #~ ## 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)
+ ############### CANNOT FIND PLAYER KEY ###########
if [[ ! ${ASTRONAUTENS} ]]; then
echo "${PLAYER} TW IS DISCONNECTED... RECREATING IPNS KEYS"
-
+ ## TODO : EXTRACT & DECRYPT secret.june FROM TW
ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player
ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player
@@ -89,234 +93,423 @@ for PLAYER in ${PLAYERONE[@]}; do
################### GET LATEST TW
echo "GETTING TW..."
-
+ ####################################################################################################
ipfs --timeout 480s get -o ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html /ipns/${ASTRONAUTENS}
-
+ ####################################################################################################
## PLAYER TW IS ONLINE ?
if [ ! -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ]; then
NOWCHAIN=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain)
LASTCHAIN=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.* | tail -n 1)
- echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"
- echo "TW REFRESH FAILED"
- echo ">> %%% WARNING %%%"
+ try=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.try 2>/dev/null) || try=3
+ echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+ echo "$myIPFS/ipns/${ASTRONAUTENS}'>TW REFRESH FAILED"
+ echo ">> %%% WARNING TRY LEFT : $try %%%"
echo "------------------------------------------------"
echo " * LAST"
- echo " *NOW"
+ echo " * NOW"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
- ## SEND AN EMAIL ALERT TO PLAYER
- echo "TW REFRESH FAILED" > ~/.zen/tmp/result
- echo "
------------------------------------------------" >> ~/.zen/tmp/result
- echo "" >> ~/.zen/tmp/result
- echo "
ANCIENT" >> ~/.zen/tmp/result
- echo "
NEW" >> ~/.zen/tmp/result
- echo "" >> ~/.zen/tmp/result
- echo "
%%% WARNING %%%" >> ~/.zen/tmp/result
- echo "
------------------------------------------------" >> ~/.zen/tmp/result
- echo "
PLEASE REPAIR BY SAVING ONLINE" >> ~/.zen/tmp/result
- echo "OR RUNNING CLI COMMAND : ipfs name publish --key=${PLAYER} /ipfs/${NOWCHAIN}" >> ~/.zen/tmp/result
- try=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.try 2>/dev/null) || try=3
+ ## SEND AN EMAIL ALERT TO PLAYER
+ echo "
+TW LOADING TIMEOUT" > ~/.zen/tmp/result
+ echo "
------------------------------------------------" >> ~/.zen/tmp/result
+ echo "
" >> ~/.zen/tmp/result
+ echo "
TW[-1]: /ipfs/${LASTCHAIN}" >> ~/.zen/tmp/result
+ echo "
TW[0]: /ipfs/${NOWCHAIN}" >> ~/.zen/tmp/result
+ echo "
" >> ~/.zen/tmp/result
+ echo "
%%% WARNING %%% $try TRY LEFT %%%" >> ~/.zen/tmp/result
+ echo "
------------------------------------------------" >> ~/.zen/tmp/result
+ echo "
ipfs name publish --key=${PLAYER} /ipfs/${NOWCHAIN}" >> ~/.zen/tmp/result
+ echo "" >> ~/.zen/tmp/result
+
[[ $try == 0 ]] \
&& echo "PLAYER ${PLAYER} UNPLUG" \
- && ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} \
+ && ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} "ALL" \
&& continue
try=$((try-1))
echo "$try" > ~/.zen/game/players/${PLAYER}/ipfs/moa/.try
- echo " %%% WARNING %%% ${PLAYER} STATION UNPLUG IN $try DAY(S)." >> ~/.zen/tmp/result
- $MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/result "UNPLUG WARNING"
+
+ $MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/result "TW LOADING TIMEOUT"
continue
- else
- ## FOUND TW
- #############################################################
- ## CHECK WHO IS ACTUAL OFFICIAL GATEWAY
- tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
- --output ~/.zen/tmp/${MOATS} \
- --render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion' ## MadeInZion Tiddler
-
- [[ ! -s ~/.zen/tmp/${MOATS}/MadeInZion.json ]] && echo "${PLAYER} MadeInZion : BAD TW (☓‿‿☓) " && continue
-
- player=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].player)
-
- [[ ${player} != ${PLAYER} ]] \
- && echo "> BAD PLAYER=$player in TW" \
- && continue \
- || echo "${PLAYER} OFFICIAL TW - (⌐■_■) -"
-
- ## GET "Astroport" TIDDLER
- tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
- --output ~/.zen/tmp/${MOATS} \
- --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport' ## Astroport Tiddler
- BIRTHDATE=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].birthdate)
- ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport) ## Raccorded G1Station IPNS address
- CURCHAIN=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].chain | rev | cut -f 1 -d '/' | rev) # Remove "/ipfs/" part
- [[ ${CURCHAIN} == "" || ${CURCHAIN} == "null" ]] \
- && CURCHAIN="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" # AVOID EMPTY
-
- echo "CURCHAIN=${CURCHAIN}"
- IPNSTAIL=$(echo ${ASTROPORT} | rev | cut -f 1 -d '/' | rev) # Remove "/ipns/" part
- echo "TW ASTROPORT GATEWAY : ${ASTROPORT}"
-
- ######################################
- #### UPLANET GEO COORD EXTRACTION
- ## GET "GPS" TIDDLER - 0.00 0.00 (if empty: null)
- tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
- --output ~/.zen/tmp/${MOATS} \
- --render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
- UMAPNS=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].umap)
- [[ $UMAPNS == "null" || $UMAPNS == "" ]] && UMAPNS="/ipns/k51qzi5uqu5djg1gqzujq5p60w25mi235gdg0lgkk5qztkfrpi5c22oolrriyu"
- LAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
- [[ $LAT == "null" || $LAT == "" ]] && LAT="0.00"
- LON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
- [[ $LON == "null" || $LON == "" ]] && LON="0.00"
-
- echo "LAT=${LAT}; LON=${LON}; UMAPNS=${UMAPNS}"
-
- ## UMAP TODATENS ################
- ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/todate.ipfskey "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}"
- ipfs key rm "_todate" 2>/dev/null
- TODATENS=$(ipfs key import "_todate" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/todate.ipfskey)
- ipfs key rm "_todate" 2>/dev/null
-
- echo "GPS UMAP LINK UPDATE
- ${YESTERDATE} : ${myIPFS}${UMAPNS}
- ${TODATE} : ${myIPFS}/ipns/${TODATENS}"
- ## UPDATE TW GPS Tiddler #############
- sed -i "s~${UMAPNS}~/ipns/${TODATENS}~g" ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
-
- ## STORE IN PLAYER CACHE
- echo "_${LAT}_${LON}" > ~/.zen/game/players/${PLAYER}/.umap
- cp ~/.zen/tmp/${MOATS}/GPS.json ~/.zen/game/players/${PLAYER}/
-
- ########### ASTROPORT is not IPFSNODEID => EJECT TW
- ## MOVED PLAYER (KEY IS KEPT ON LAST CONNECTED ASTROPORT)
- ## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ## TODO UNPLUG PLAYER
- ## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- if [[ ${IPNSTAIL} != ${IPFSNODEID} || ${IPNSTAIL} == "_ASTROPORT_" ]]; then
- echo "> I AM ${IPFSNODEID} : PLAYER MOVED TO ${IPNSTAIL} : EJECTION "
- echo "UNPLUG PLAYER"
- ${MY_PATH}/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ONE"
- echo ">>>> ASTRONAUT ${PLAYER} TW CAPSULE EJECTION TERMINATED"
- continue
- fi
fi
#############################################################
- ## GWIP == myIP or TUBE !!
+ ## FOUND TW
#############################################################
- # Connect_PLAYER_To_Gchange.sh : Sync FRIENDS TW
+ ## CHECK "GPS" Tiddler
+ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
+ [[ ! -s ~/.zen/tmp/${MOATS}/GPS.json || $(cat ~/.zen/tmp/${MOATS}/GPS.json) == "[]" ]] \
+ && echo "${PLAYER} GPS : BAD TW (☓‿‿☓) " && continue
+
+ #############################################################
+ ## CHECK MadeInZion
+ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion' ## MadeInZion Tiddler
+
+ [[ ! -s ~/.zen/tmp/${MOATS}/MadeInZion.json || $(cat ~/.zen/tmp/${MOATS}/MadeInZion.json) == "[]" ]] \
+ && echo "${PLAYER} MadeInZion : BAD TW (☓‿‿☓) " && continue
+
+ player=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].player)
+ #############################################################
+ ## CHECK "AstroID" Tiddler
+ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'AstroID.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'AstroID' ## AstroID Tiddler
+ [[ $(cat ~/.zen/tmp/${MOATS}/AstroID.json 2>/dev/null) == "[]" ]] && rm ~/.zen/tmp/${MOATS}/AstroID.json
+ ########################################## used by Astroport :: Lasertag :: TW plugin ##
+ ## CHECK "$:/config/NewTiddler/Tags"
+ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'TWsign.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '$:/config/NewTiddler/Tags' ## $:/config/NewTiddler/Tags Tiddler
+ signature=$(cat ~/.zen/tmp/${MOATS}/TWsign.json | jq -r .[].text)
+ echo "${player} SIGNATURE = $signature"
+ ############################################################ BAD TW SIGNATURE
+ [[ ${player} != ${PLAYER} || ${PLAYER} != ${signature} ]] \
+ && echo "> (☓‿‿☓) BAD PLAYER=$player in TW (☓‿‿☓)" \
+ && ${MY_PATH}/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ALL" \
+ && continue \
+ || echo "${PLAYER} OFFICIAL TW - (⌐■_■) -"
+
+ #############################################################
+ ## CHECK "Astroport" TIDDLER
+ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport' ## Astroport Tiddler
+ [[ ! -s ~/.zen/tmp/${MOATS}/Astroport.json || $(cat ~/.zen/tmp/${MOATS}/Astroport.json) == "[]" ]] \
+ && echo "${PLAYER} Astroport : BAD TW (☓‿‿☓) " && continue
+
+ BIRTHDATE=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].birthdate)
+ ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport) ## ZenStation IPNS address
+ CURCHAIN=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].chain | rev | cut -f 1 -d '/' | rev) # Remove "/ipfs/" part
+ [[ ${CURCHAIN} == "" || ${CURCHAIN} == "null" ]] \
+ && CURCHAIN="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" # AVOID EMPTY
+
+ SBIRTH=$(${MY_PATH}/../tools/MOATS2seconds.sh ${BIRTHDATE})
+ SNOW=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
+ DIFF_SECONDS=$(( SNOW - SBIRTH ))
+ days=$((DIFF_SECONDS / 60 / 60 / 24))
+
+################################################## +7 DAYS AstroID !!
+ ## REMOVE TW OLDER THAN 7 DAYS WITH AstroID
+ [[ -s ~/.zen/tmp/${MOATS}/AstroID.json && $days -gt 7 ]] \
+ && ${MY_PATH}/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ALL" \
+ && echo "(#__#) AstroID +7 DAYS = SECURITY ERROR (#__#)" && continue
+
+################################################## ANOTHER ASTROPORT !!
+ IPNSTAIL=$(echo ${ASTROPORT} | rev | cut -f 1 -d '/' | rev) # Remove "/ipns/" part
+ ########### ASTROPORT is not IPFSNODEID => EJECT TW
+ if [[ ${IPNSTAIL} != ${IPFSNODEID} || ${IPNSTAIL} == "_ASTROPORT_" ]]; then
+ echo "> PLAYER MOVED TO ${IPNSTAIL} : UNPLUG "
+ ${MY_PATH}/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ONE"
+ echo ">>>> CIAO ${PLAYER}"
+ continue
+ fi
+
+ ################ VERIFICATIONS DONE ######################
+ echo "ASTROPORT ZenStation : ${ASTROPORT}"
+ echo "CURCHAIN=${CURCHAIN}"
+ echo "================================== TW $days days old"
+
+ ######################################
+ #### UPLANET GEO COORD EXTRACTION
+ ## GET "GPS" TIDDLER - 0.00 0.00 (if empty: null)
+ ZLAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
+ [[ $ZLAT == "null" || $ZLAT == "" ]] && ZLAT="0.00"
+ ZLON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
+ [[ $ZLON == "null" || $ZLON == "" ]] && ZLON="0.00"
+
+ LAT=$(makecoord ${ZLAT})
+ LON=$(makecoord ${ZLON})
+ SLAT="${LAT::-1}"
+ SLON="${LON::-1}"
+ RLAT="$(echo ${LAT} | cut -d '.' -f 1)"
+ RLON="$(echo ${LON} | cut -d '.' -f 1)"
+ ## SEARCH for TODATENS in SWARM then LOCAL
+ ## ZEN STATION
+ MYNS=$(cat ~/.zen/tmp/swarm/12D*/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/TODATENS)
+ UMAPG1PUB=$(cat ~/.zen/tmp/swarm/12D*/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/G1PUB)
+ ## BOOSTRAP SCENARIO
+ [[ $MYNS == "" ]] \
+ && MYNS=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/TODATENS) \
+ && UMAPG1PUB=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/G1PUB)
+ # Search in flashmem
+ if [[ ${MYNS} != "" ]]; then
+ echo "UMAP NEXTNS"
+ UMAPNS=$(cat ~/.zen/tmp/flashmem/${MYNS}/_next.umapns | cut -d ':' -f 3)
+ cat ~/.zen/tmp/flashmem/${MYNS}/_next.umapns
+ echo "SECTOR NEXTNS"
+ SECTORNS=$(cat ~/.zen/tmp/flashmem/${MYNS}/_next.sectorns | cut -d ':' -f 3)
+ cat ~/.zen/tmp/flashmem/${MYNS}/_next.sector
+ echo "REGION NEXTNS"
+ REGIONNS=$(cat ~/.zen/tmp/flashmem/${MYNS}/_next.regionns | cut -d ':' -f 3)
+ cat ~/.zen/tmp/flashmem/${MYNS}/_next.region
+ fi
+
+ UMAPG1PUB=$(${MY_PATH}/../tools/keygen "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
+
+ ## CALCULATE UMAP TODATENS ################
+ ######################################
+ ipfs key rm "temp" >/dev/null 2>&1
+ ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/todate.ipfskey "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}"
+ UMAPNS=$(ipfs key import "temp" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/todate.ipfskey)
+
+ echo "UMAP _${LAT}_${LON} UMAPNS=/ipns/${UMAPNS}"
+
+ SECTOR="_${LAT::-1}_${LON::-1}"
+ ## CALCULATE SECTOR TODATENS ################
+ ipfs key rm "temp" >/dev/null 2>&1
+ ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/sectodate.ipfskey "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}"
+ TODATESECTORNS=$(ipfs key import "temp" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/sectodate.ipfskey)
+ ipfs key rm "temp" >/dev/null 2>&1
+ #############################################
+ # MAKE TODATE "GPS" TIDDLER
+ cat ${MY_PATH}/../templates/data/GPS.json \
+ | sed -e "s~_MOATS_~${MOATS}~g" \
+ -e "s~_PLAYER_~${PLAYER}~g" \
+ -e "s~_LAT_~${LAT}~g" \
+ -e "s~_LON_~${LON}~g" \
+ -e "s~_UMAPNS_~${UMAPNS}~g" \
+ -e "s~_SECTORTW_~/ipns/${TODATESECTORNS}/TW~g" \
+ > ~/.zen/tmp/${MOATS}/GPS.json
+
+ ################# PERSONAL VDO.NINJA ADDRESS)
+ PHONEBOOTH=${PLAYER/@/_}
+ PHONEBOOTH=${PHONEBOOTH/\./_}
+ PHONEBOOTH=${PHONEBOOTH/-/_}
+
+ # MAKE "ALLO" TIDDLER
+ cat ${MY_PATH}/../templates/data/VISIO.json \
+ | sed -e "s~_IPFSNINJA_~${VDONINJA}~g" \
+ -e "s~_MOATS_~${MOATS}~g" \
+ -e "s~_PLAYER_~${PLAYER}~g" \
+ -e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
+ > ~/.zen/tmp/${MOATS}/VISIO.json
+
+ ## UPDATE PLAYER CACHE
+ echo "_${LAT}_${LON}" > ~/.zen/game/players/${PLAYER}/.umap
+ cp ~/.zen/tmp/${MOATS}/GPS.json ~/.zen/game/players/${PLAYER}/
+
+ #####################################################################
+ # (RE)MAKE "CESIUM" TIDDLER
+ echo "Create CESIUM Tiddler"
+ cat ${MY_PATH}/../templates/data/CESIUM.json \
+ | sed -e "s~_G1PUB_~${G1PUB}~g" \
+ -e "s~_MOATS_~${MOATS}~g" \
+ -e "s~_CESIUMIPFS_~${CESIUMIPFS}~g" \
+ -e "s~_PLAYER_~${PLAYER}~g" \
+ > ~/.zen/tmp/${MOATS}/CESIUM.json
+
+ #####################################################################
+ ########## $:/moa picture ## lightbeams replacement ###############
+ ## GET $:/moa Tiddlers ####################################### START
+ echo "GET $:/moa Tiddlers"
+ ###################################################### [tag[$:/moa]]
+ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'FRIENDS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[$:/moa]]' ## $:/moa EMAIL Tiddlers
+ #####################################################################
+ fplayers=($(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq -rc .[].title))
+ echo "${fplayers[@]}"
+ UPLAYERSTIDS=()
+ for fp in ${fplayers[@]}; do
+
+ [[ ! "${fp}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] && echo "BAD ${fp} FORMAT" && continue
+ [[ "${fp}" == "${PLAYER}" ]] && echo "IT'S ME - CONTINUE" && continue
+
+ FPLAYER=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .player')
+ [[ $FPLAYER == 'null' || $FPLAYER == '' ]] && echo "FPLAYER null - CONTINUE" && continue
+
+ FTW=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .tw')
+ [[ ${FTW} == "/ipns/" || ${FTW} == "null" || ${FTW} == "" ]] && echo "WEIRD FTW ${FTW} - CONTINUE" && continue
+
+ FG1PUB=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .g1pub')
+ [[ $FG1PUB == 'null' || $FG1PUB == '' ]] && echo "FG1PUB null - CONTINUE" && continue
+
+ IHASH=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .text' | sha256sum | cut -d ' ' -f 1)
+
+ echo ":: coucou :: $FPLAYER :: (ᵔ◡◡ᵔ) ::"
+ echo "TW: $FTW"
+ echo "G1: $FG1PUB"
+ echo "IHASH: $IHASH"
+ UPLAYERSTIDS=("${UPLAYERSTIDS[@]}" "[[${FPLAYER^^}|${FPLAYER^^}]]")
+
+ ## 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 ${FTW} > ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html
+ ) &
+
+ ## CHECK ALREADY IN ${FPLAYER^^} IHASH
+ rm -f ~/.zen/tmp/${MOATS}/finside.json
+ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'finside.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${FPLAYER^^}" ## ${FPLAYER^^} autoload Tiddlers
+
+ INSIDEH=$(cat ~/.zen/tmp/${MOATS}/finside.json | jq -rc '.[].ihash')
+ echo "INSIDEH: $INSIDEH"
+
+ ## UPDATE IF IHASH CHANGED -> New drawing => Friend get informed
+ if [[ -z $INSIDEH || $INSIDEH != $IHASH || $ORIGINH != $INSIDEH ]]; then
+ cat ${MY_PATH}/../templates/data/_UPPERFPLAYER_.json \
+ | sed -e "s~_UPPERFPLAYER_~${FPLAYER^^}~g" \
+ -e "s~_FPLAYER_~${FPLAYER}~g" \
+ -e "s~_MOATS_~${MOATS}~g" \
+ -e "s~_IHASH_~${IHASH}~g" \
+ -e "s~_FRIENDTW_~${FTW}~g" \
+ -e "s~_PLAYER_~${PLAYER}~g" \
+ > ~/.zen/tmp/${MOATS}/${FPLAYER^^}.json
+
+ echo "Insert New ${FPLAYER^^}.json"
+ #~ cat ~/.zen/tmp/${MOATS}/${FPLAYER^^}.json | jq
+
+ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
+ --import ${HOME}/.zen/tmp/${MOATS}/${FPLAYER^^}.json 'application/json' \
+ --output ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} \
+ --render "$:/core/save/all" "newindex.html" "text/plain"
+ [[ -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"
+
+ if [[ $ORIGINH != $INSIDEH ]]; then
+ echo "ORIGINH Update"
+ rm -f ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html
+ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
+ --import ${HOME}/.zen/tmp/${MOATS}/${FPLAYER}.json 'application/json' \
+ --output ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} \
+ --render "$:/core/save/all" "newindex.html" "text/plain"
+ [[ -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"
+ fi
+
+ fi
+
+ done
+ ## GET $:/moa Tiddlers ####################################### END
+
+ #####################################################################
+ echo "${UPLAYERSTIDS[@]}"
+ UPLAYERSTIDS_STR=""
+ for item in "${UPLAYERSTIDS[@]}"; do
+ UPLAYERSTIDS_STR+=" $item"
+ done
+ # Trim leading space
+ UPLAYERSTIDS_STR="${UPLAYERSTIDS_STR# }"
+ ######################################
+ # (RE)MAKE "SECTORTW_NEWS" TIDDLER
+ cat ${MY_PATH}/../templates/data/SECTORTW_NEWS.json \
+ | sed -e "s~_SECTOR_~${SECTOR}~g" \
+ -e "s~_MOATS_~${MOATS}~g" \
+ -e "s~_UPLANET_~${myUPLANET}~g" \
+ -e "s~_UPLAYERSTIDS_~${UPLAYERSTIDS_STR}~g" \
+ -e "s~_SECTORTW_~/ipns/${TODATESECTORNS}/TW~g" \
+ > ~/.zen/tmp/${MOATS}/SECTORTW_NEWS.json
+
+ echo "SECTOR $SECTOR SECTORTW=/ipns/${TODATESECTORNS}/TW"
+
+ #############################################################
+ # Connect_PLAYER_To_Gchange.sh : Sync FRIENDS TW - TODO : REWRITE
##############################################################
- echo "##################################################################"
+ #~ echo "##################################################################"
- [[ $(echo "$COINS >= 2" | bc -l) -eq 1 ]] \
- && echo "## Connect_PLAYER_To_Gchange.sh" \
- && ${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "${PLAYER}" \
- || echo "$COINS <= 1 G1 + 10 ẑen : stars exchange (★★★★★) level"
+ #~ [[ $(echo "$COINS >= 500" | bc -l) -eq 1 ]] \
+ #~ && echo "## Connect_PLAYER_To_Gchange.sh" \
+ #~ && ${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "${PLAYER}" \
+ #~ || echo "$COINS <= 1 G1 + 10 ẑen : bypass Gchange stars exchange (★★★★★)"
- # G1PalPay - 1 G1 mini -> Check for G1 TX incoming comments #
- if [[ $(echo "$COINS >= 1" | bc -l) -eq 1 ]]; then
- ###########
+ ##############################################################
+ # G1PalPay - 2 G1 mini -> Check for G1 TX incoming comments #
+ ##############################################################
+ if [[ $(echo "$COINS >= 2" | bc -l) -eq 1 ]]; then
+ ##############################################################
# G1PalPay.sh #
##############################################################
echo "## RUNNING G1PalPay Wallet Monitoring "
${MY_PATH}/G1PalPay.sh ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}"
- ###############
+ ##############################################################
# VOEUX.create.sh #
##############################################################
${MY_PATH}/VOEUX.create.sh ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}" "${G1PUB}"
- ###############
+ ##############################################################
# VOEUX.refresh.sh #
##############################################################
${MY_PATH}/VOEUX.refresh.sh "${PLAYER}" "${MOATS}" ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
else
- echo "> ZenCard is not activated ($ZEN)"
+ echo "> ZenCard not activated ($ZEN ZEN)"
fi
- ### CHECK FOR pending (TODO! In case PAY4SURE have abandonned pendings)
-
-
- ###################
- # REFRESH PLAYER_feed #
##################################
- echo "# TW : GW API + LightBeam Feed + Friends"
- TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 3)
-
- FEEDNS=$(ipfs key list -l | grep -w "${PLAYER}_feed" | cut -d ' ' -f 1)
- [[ ! ${FEEDNS} ]] && echo ">>>>> ERROR ${PLAYER}_feed IPNS KEY NOT FOUND - ERROR" && continue
-
- # WRITE lightbeam params
- echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_feed'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
- echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key","text":"'${FEEDNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
-
- ###########################
- # Tiddlers controling GW & API
- #~ echo '[{"title":"$:/ipfs/saver/api/http/localhost/5001","tags":"$:/ipfs/core $:/ipfs/saver/api","text":"'$(myPlayerApiGw)'"}]' > ~/.zen/tmp/${MOATS}/5001.json
- #~ echo '[{"title":"$:/ipfs/saver/gateway/http/localhost","tags":"$:/ipfs/core $:/ipfs/saver/gateway","text":"'$myIPFS'"}]' > ~/.zen/tmp/${MOATS}/8080.json
-
- ## COPY DATA PRODUCED BY GCHANGE STAR EXTRACTION
- FRIENDSFEEDS=$(cat ~/.zen/tmp/${IPFSNODEID}/RSS/${PLAYER}/FRIENDSFEEDS 2>/dev/null)
- echo "★★★★★ FRIENDS FEEDS : "${FRIENDSFEEDS}
- ASTRONAUTES=$(cat ~/.zen/tmp/${IPFSNODEID}/RSS/${PLAYER}/ASTRONAUTES 2>/dev/null)
- echo "★★★★★ FRIENDS TW : "${ASTRONAUTES}
-
- ## Change TW FRIENDFEED ie PLAYER RSS IPNS (must fix TW plugin to work)
- #~ echo '[{"title":"$:/plugins/astroport/lightbeams/state/subscriptions","text":"'${FRIENDSFEEDS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/friends.json
- #~ ## ADD --import "$HOME/.zen/tmp/${MOATS}/friends.json" "application/json" \ ## MANUAL TW RSS REGISTRATION
-
- ## WRITE TIDDLERS IN TW
+ ## PATCH : RESTORE PLAYER GPS.json (protect cache erased by WISH treatment)
+ cp -f ~/.zen/game/players/${PLAYER}/GPS.json ~/.zen/tmp/${MOATS}/
+ ## WRITE TIDDLERS IN TW SECTORTW_NEWS.json
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
- --import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/GPS.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/VISIO.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/CESIUM.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/SECTORTW_NEWS.json "application/json" \
--output ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} --render "$:/core/save/all" "newindex.html" "text/plain"
## CHECK IT IS OK
[[ -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
+ && rm ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html \
+ || echo "ERROR - CANNOT CREATE TW NEWINDEX - ERROR"
###########################
####################
-
- ## ANY CHANGES ?
+ ## TW NEWINDEX .... #####
##############################################################
- DIFF=$(diff ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html)
- if [[ $DIFF ]]; then
- echo "DIFFERENCE DETECTED !! "
- echo "Backup & Upgrade TW local copy..."
- cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+ echo "LOCAL BACKUP + MICROLEDGER TW"
+ cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- [[ -s ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain ]] \
- && ZCHAIN=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain) \
- && echo "# CHAIN : ${CURCHAIN} -> ${ZCHAIN}" \
- && [[ ${CURCHAIN} != "" && ${ZCHAIN} != "" ]] \
- && sed -i "s~${CURCHAIN}~${ZCHAIN}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- else
- ## COUNT NO CHANGE
- try=$(cat ~/.zen/game/players/${PLAYER}/ipfs/_nochange 2>/dev/null) || try=0
- ((try++)) && echo $try > ~/.zen/game/players/${PLAYER}/ipfs/_nochange
- echo "NO CHANGE $try TIMES"
- fi
- ##############################################################
+ [[ -s ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain ]] \
+ && ZCHAIN=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain) \
+ && echo "# CHAIN : ${CURCHAIN} -> ${ZCHAIN}" \
+ && [[ ${CURCHAIN} != "" && ${ZCHAIN} != "" ]] \
+ && sed -i "s~${CURCHAIN}~${ZCHAIN}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
##################################################
- ############################### LOCAL "MICRO LEDGER"
- ################## UPDATING ${PLAYER}/ipfs/moa
- [[ $DIFF ]] && cp ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain \
- ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats)
+ ######## UPDATING ${PLAYER}/ipfs/moa/.chain
+ cp ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain \
+ ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats)
+ ##########################################
+ ## TW IPFS ADD & PUBLISH
+ ##########################################
TW=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html | tail -n 1)
- ipfs name publish --key=${PLAYER} /ipfs/${TW}
-
- [[ $DIFF ]] && echo ${TW} > ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain
+ ipfs --timeout 720s name publish --key=${PLAYER} /ipfs/${TW}
+ ## LOCAL PLAYER CACHING
+ echo ${TW} > ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain
echo ${MOATS} > ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats
echo "================================================"
@@ -324,51 +517,62 @@ for PLAYER in ${PLAYERONE[@]}; do
echo " $myIPFSGW/ipns/${ASTRONAUTENS}"
echo "================================================"
+ ###################
+ # REFRESH PLAYER_feed KEY
echo "(☉_☉ ) (☉_☉ ) (☉_☉ ) RSS"
+
## CREATING 30 DAYS JSON RSS STREAM
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
- --output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${PLAYER}.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]]'
+ --output ~/.zen/game/players/${PLAYER}/ipfs \
+ --render '.' "${PLAYER}.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]!externalTiddler[yes]!tag[load-external]]'
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json ]] \
&& echo "NO ${PLAYER} RSS - BAD "
echo "~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json"
- ## TODO CREATING 30 DAYS XML RSS STREAM
+ ########################################################
+ #### PLAYER ACCOUNT HAVE NEW TIDDLER or NOT #########
+ if [[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" ]]; then
+ echo "ALERT -- RSS IS EMPTY -- COINS=$COINS / ZEN=$ZEN --"
+ ## DEAD PLAYER ??
+ if [[ ${DIFF_SECONDS} -eq $(( 27 * 24 * 60 * 60 )) ]]; then
+ echo "WARNING.
Your TW will be UNPLUGGED and stop being published..." > ~/.zen/tmp/alert
+ echo "
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"
+ fi
+ if [[ ${DIFF_SECONDS} -gt $(( 29 * 24 * 60 * 60 )) ]]; then
+ #################################### UNPLUG ACCOUNT
+ echo ">>>> PLAYER TW UNPLUG >>>>> ${days} days => BYE BYE ${PLAYER} ZEN=$ZEN"
+ ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} "ALL"
+ continue
+ fi
+
+ ## PAY 1 ZEN TO UMAPG1PUB
+ ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "0.1" "${UMAPG1PUB}" "UPLANET:TW:${YOUSER}:/ipfs/${TW}"
+
+ else
+
+ ### PLAYER ALIVE PUBLISH RSS &
+ FEEDNS=$(ipfs key list -l | grep -w "${PLAYER}_feed" | cut -d ' ' -f 1)
+ [[ ${FEEDNS} ]] \
+ && IRSS=$(ipfs add -q ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json | tail -n 1) \
+ && echo "Publishing ${PLAYER}_feed: /ipns/${FEEDNS} => /ipfs/${IRSS}" \
+ && ipfs --timeout 300s name publish --key="${PLAYER}_feed" /ipfs/${IRSS} \
+ || echo ">>>>> ERROR ${PLAYER}_feed IPNS KEY NOT FOUND - ERROR"
+
+ fi
+
+
+ ## TODO CREATING 30 DAYS XML RSS STREAM ???
## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/26
# tiddlywiki.js --load my-wiki.html --render "[[$:/plugins/sq/feeds/templates/rss]]" "feed.xml" "text/plain" "$:/core/templates/wikified-tiddler"
### $:/plugins/sycom/atom-feed/atom.xml
#~ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
- #~ --output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${PLAYER}.rss.xml" 'text/plain' "$:/core/templates/wikified-tiddler" 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]]'
+ #~ --output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${PLAYER}.rss.xml" 'text/plain' "$:/core/templates/wikified-tiddler" 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]]'
- SBIRTH=$(${MY_PATH}/../tools/MOATS2seconds.sh ${BIRTHDATE})
- SNOW=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
- DIFF_SECONDS=$(( SNOW - SBIRTH ))
- days=$((DIFF_SECONDS / 60 / 60 / 24))
- echo "PLAYER TW was created $days days ago"
-
- ##################################
- #### PLAYER ACCOUNT CLEANING #########
- ## IF ZEN < 11
- ## && EMPTY RSS + 30 DAYS BIRTHDATE
- ## only for less 90 days TW ? && ${DIFF_SECONDS} -lt $(( 90 * 24 * 60 * 60 )) ????
- ## ==> UNPLUG
- [[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" ]] \
- && echo "RSS IS EMPTY -- COINS=$COINS / ZEN=$ZEN --" \
- && [[ $(echo "$COINS < 2.1" | bc -l) -eq 1 ]] \
- && [[ ${DIFF_SECONDS} -gt $(( 27 * 24 * 60 * 60 )) ]] \
- && echo "WARNING.
Your TW will be UNPLUGGED and stop being published..." > ~/.zen/tmp/alert \
- && echo "
ZEN=$ZEN " >> ~/.zen/tmp/alert \
- && ${MY_PATH}/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/alert "TW ALERT" \
- && echo "<<<< PLAYER TW WARNING <<<< ${DIFF_SECONDS} > ${days} days" \
- && [[ ${DIFF_SECONDS} -gt $(( 30 * 24 * 60 * 60 )) ]] \
- && echo ">>>> PLAYER TW UNPLUG >>>>> ${days} days => BYE BYE ${PLAYER} ZEN=$ZEN" \
- && ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} \
- && continue
- #################################### UNPLUG ACCOUNT
-
- IRSS=$(ipfs add -q ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json | tail -n 1) \
- && ipfs name publish --key="${PLAYER}_feed" /ipfs/${IRSS}
######################### REPLACE TW with REDIRECT to latest IPFS or IPNS (reduce 12345 cache size)
[[ ! -z ${TW} ]] && TWLNK="/ipfs/${TW}" || TWLNK="/ipns/${ASTRONAUTENS}"
@@ -381,32 +585,46 @@ for PLAYER in ${PLAYERONE[@]}; do
#################################################
################### COPY DATA TO UP LEVEL GRIDS
#################################################
- if [[ ${LAT} && ${LON} ]]; then
- ## SECTOR BANK COORD
- SECLAT="${LAT::-1}"
- SECLON="${LON::-1}"
- ## REGION
- REGLAT=$(echo ${LAT} | cut -d '.' -f 1)
- REGLON=$(echo ${LON} | cut -d '.' -f 1)
+ ## SECTOR BANK COORD
+ SECLAT="${LAT::-1}"
+ SECLON="${LON::-1}"
+ ## REGION
+ REGLAT=$(echo ${LAT} | cut -d '.' -f 1)
+ REGLON=$(echo ${LON} | cut -d '.' -f 1)
- echo "/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}"
- ## IPFSNODEID 12345 CACHE UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
- mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
+ echo "/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}"
+ ## IPFSNODEID 12345 CACHE UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
+ mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
- cp ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json \
- ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
+ cp ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json \
+ ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
+ #### CREATE ALL JSON COMPILATION
+ ${MY_PATH}/../tools/json_dir.all.sh \
+ ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
- ${MY_PATH}/../tools/json_dir.all.sh ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/RSS/
- mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}
- cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}/
-
- echo "" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/_index.html
-
- fi
+ ## IPFS PLAYER TW #
+ mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}
+ # /ipfs/${TW} = /TW/${PLAYER}/index.html
+ echo "${TODATE}:${PLAYER}" \
+ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}/index.html
+ # /ipns/${ASTRONAUTENS} = /TW/${PLAYER}/_index.html
+ echo "${PLAYER}" \
+ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}/_index.html
+ ## IPNS UMAP _index.html ##
+ echo "${TODATE}:_${LAT}_${LON}" \
+ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/_index.html
ls -al ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON} 2>/dev/null
echo "(☉_☉ ) (☉_☉ ) (☉_☉ )"
+ #####################################################################
+ ## DAY=7 : SEND 3.1 G1 to PLAYER + 3.1 G1 to UMAP
+ [[ ${days} -eq 7 && "${CURRENT}" != "${PLAYER}" && "${CURRENT}" != "" ]] \
+ && echo "7 DAY. PLAYER STEP ONE SUCCEED." \
+ && MIUSER=$(${MY_PATH}/../tools/clyuseryomail.sh "${CURRENT}") \
+ && ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/.current/secret.dunikey" "3.1" "${G1PUB}" "UPLANET:WELCOME:${MIUSER}:${YOUSER}" \
+ && echo "UPLANET:WELCOME:${MIUSER}:${YOUSER}" && echo "(⌐■_■) ~~~ OFFICIAL ~~ _${LAT}_${LON} ~~~ $ASTRONAUTENS"
+
## MAINTAIN R/RW TW STATE
[[ ${ASTRONS} == "" ]] \
&& echo "${PLAYER} DISCONNECT" \
@@ -418,6 +636,10 @@ for PLAYER in ${PLAYERONE[@]}; do
rm -Rf ~/.zen/tmp/${MOATS}
echo
+ end=`date +%s`
+ dur=`expr $end - $start`
+ echo "${PLAYER} refreshing took $dur seconds (${MOATS})"
+
done
echo "============================================ PLAYER.refresh DONE."
diff --git a/RUNTIME/PLAYER.unplug.sh b/RUNTIME/PLAYER.unplug.sh
index d75fe782..35aabe26 100755
--- a/RUNTIME/PLAYER.unplug.sh
+++ b/RUNTIME/PLAYER.unplug.sh
@@ -30,7 +30,9 @@ mkdir -p ~/.zen/tmp/${MOATS}
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
TWMAPNS=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].umap)
LAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
+ [[ $LAT == "null" || $LAT == "" ]] && LAT="0.00"
LON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
+ [[ $LON == "null" || $LON == "" ]] && LON="0.00"
echo "LAT=${LAT}; LON=${LON}; UMAPNS=${TWMAPNS}"
rm ~/.zen/tmp/${MOATS}/GPS.json
@@ -57,22 +59,23 @@ mkdir -p ~/.zen/tmp/${MOATS}
ALL="ALL"
[[ $ONE == "ONE" ]] && ALL=1
- [[ $ALL == "ALL" ]] && SECTORG1PUB=${WORLDG1PUB} && echo "DEST = WORLDG1PUB"
+ [[ $ALL == "ALL" ]] && SECTORG1PUB=${WORLDG1PUB} && echo "DEST = WORLDG1PUB: ${WORLDG1PUB}"
[[ ! -z ${SECTORG1PUB} ]] \
&& echo "> PAY4SURE ZEN:${ALL} WALLET MOVE" \
&& ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${ALL}" "${SECTORG1PUB}" "UNPLUG:${ALL}"
## REMOVING PLAYER from ASTROPORT
+ G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
ipfs key rm ${PLAYER}; ipfs key rm ${PLAYER}_feed; ipfs key rm ${G1PUB};
for vk in $(ls -d ~/.zen/game/players/${PLAYER}/voeux/*/* 2>/dev/null | rev | cut -d / -f 1 | rev); do
echo "removing wish ${vk}"
- ipfs key rm ${vk}
+ [[ ${vk} != "" ]] && ipfs key rm ${vk}
done
## SEND PLAYER LAST KNOW TW
TW=$(ipfs add -Hq ${INDEX} | tail -n 1)
-${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "Ciao ${PLAYER},
Your TW is unplugged from Astroport : TW ARCHIVE.
$(cat ~/.zen/game/players/${PLAYER}/secret.june)
May the force be with you.
" "BYE BYE MESSAGE"
+${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "Ciao ${PLAYER},
Your TW is unplugged from Astroport : TW (${TW}).
$(cat ~/.zen/game/players/${PLAYER}/secret.june)
May the force be with you.
" "BYE BYE MESSAGE"
echo "PLAYER IPNS KEYS UNPLUGED"
echo "#######################"
diff --git a/RUNTIME/REGION.refresh.sh b/RUNTIME/REGION.refresh.sh
index e9bed14f..b8031c9d 100755
--- a/RUNTIME/REGION.refresh.sh
+++ b/RUNTIME/REGION.refresh.sh
@@ -31,9 +31,15 @@ for i in $*; do
UMAPS=("$i" ${UMAPS[@]})
done
-[[ ${#UMAPS[@]} == 0 ]] && UMAPS="_0.00_0.00"
+## NO $i PARAMETERS - GET ALL UMAPS
+if [[ ${#UMAPS[@]} == 0 ]]; then
+ MEMAPS=($(ls -td ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
+ SWARMMAPS=($(ls -Gd ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
+ combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
+ UMAPS=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
+fi
-######## INIT REGIONS ########################
+######## DETERMINE REGIONS FOR ALL UMAPS ################
for UMAP in ${UMAPS[@]}; do
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
@@ -57,8 +63,8 @@ REGIONS=($(echo "${MYREGIONS[@]}" | tr ' ' '\n' | sort -u))
echo "ACTIVATED REGIONS : ${REGIONS[@]}"
for REGION in ${REGIONS[@]}; do
-
- echo "_____REGION ${REGION}"
+ echo "-------------------------------------------------------------------"
+ echo "_____REGION ${REGION} $(date)"
mkdir -p ~/.zen/tmp/${MOATS}/${REGION}
REGLAT=$(echo ${REGION} | cut -d '_' -f 2)
REGLON=$(echo ${REGION} | cut -d '_' -f 3)
@@ -94,7 +100,8 @@ for REGION in ${REGIONS[@]}; do
## GET from IPNS
ipfs --timeout 240s get -o ~/.zen/tmp/${MOATS}/${REGION}/ /ipns/${YESTERDATEREGIONNS}/
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
+ ## SHOULD NEED 12 SIGNATURES
+ ## FULL REFRESH DEMO... ZEN CHAINING COMING LATER
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
mkdir -p ~/.zen/tmp/${MOATS}/${REGION}/RSS
rm -f ~/.zen/tmp/${MOATS}/${REGION}/RSS/_${REGLAT}_${REGLON}.week.rss.json
@@ -137,7 +144,7 @@ for REGION in ${REGIONS[@]}; do
###################################
## NODE PUBLISH REGION TODATENS LINK
- echo "" \
+ echo "/_${REGLAT}_${REGLON}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${REGLAT}_${REGLON}/_index.html
#~ ## DEMO : PREPARE Ask.IA link - PROD will be launched during RUNTIME.
@@ -148,7 +155,7 @@ for REGION in ${REGIONS[@]}; do
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo "Numbers of REGION WEEK RSS : ${NL} + ${NS} : "${TOTL}
- rm ~/.zen/tmp/${MOATS}/${REGION}/N_*
+ rm ~/.zen/tmp/${MOATS}/${REGION}/N_* 2>/dev/null
echo ${TOTL} > ~/.zen/tmp/${MOATS}/${REGION}/N_${TOTL}
@@ -162,7 +169,7 @@ for REGION in ${REGIONS[@]}; do
fi
IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${REGION}/* | tail -n 1)
- ipfs name publish -k ${TODATE}${REGIONG1PUB} /ipfs/${IPFSPOP}
+ ipfs --timeout 180s name publish -k ${TODATE}${REGIONG1PUB} /ipfs/${IPFSPOP}
ipfs key rm ${REGIONG1PUB} ${YESTERDATE}${REGIONG1PUB} > /dev/null 2>&1
diff --git a/RUNTIME/RSS2UPlanetSECTORTW.sh b/RUNTIME/RSS2UPlanetSECTORTW.sh
index 3feac280..e10a766e 100755
--- a/RUNTIME/RSS2UPlanetSECTORTW.sh
+++ b/RUNTIME/RSS2UPlanetSECTORTW.sh
@@ -18,14 +18,16 @@ SECTOR=$2 ## Sector identifier _0.0_0.0
MOATS=$3 ## temp cache access
INDEX=$4 ## SECTOR TW index file
+echo
+
[[ ! -s ${RSS} ]] && echo "BAD RSS INPUT" && exit 1
+[[ "$(cat ${RSS})" == "[]" ]] && echo "EMPTY RSS " && exit 0
+
[[ ! -d ~/.zen/tmp/${MOATS}/${SECTOR}/ ]] && echo "BAD UPLANET CONTEXT" && exit 1
[[ ! -s ${INDEX} ]] \
&& sed "s~_SECTOR_~${SECTOR}~g" ${MY_PATH}/../templates/twsector.html > ${INDEX} \
&& echo "REFRESHING SECTOR FROM empty TEMPLATE *****"
-echo
-echo
## EXTRACT PLAYER FROM RSS FILE NAME
PLAYER=$(echo ${RSS} | rev | cut -d '/' -f 1 | rev | sed "s~.rss.json~~g")
## GET PLAYER INFORMATION
@@ -43,10 +45,10 @@ signatures=0
while read title; do
- [[ ${floop} -gt 2 ]] && echo "0lder Tiddlers are similaR... BREAK" && break
+ [[ ${floop} -gt 1 ]] && echo "0lder Tiddlers are similaR... BREAK LOOP" && break
- # FILTER Astroport and les than 4 characters title Tiddlers (ex: GPS, ...). extend to allow personnal Tiddlers
- [[ ${title} == "GettingStarted" || ${title::4} == ${title} || ${title} == "AstroID" || ${title} == "Voeu1.png" || ${title} == "Astroport" || ${title} == "MadeInZion" || ${title} == "G1Visa" || ${title} == "ZenCard" || ${title::5} == "Draft" ]] \
+ # FILTER "UPPERCASE" + Astroport Tid, less than 4 characters title Tiddlers (ex: GPS, ...).
+ [[ ${title} == "GettingStarted" || "${title^^}" == "${title}" || "${title::3}" == '$:/' || ${title::4} == ${title} || ${title} == "AstroID" || ${title} == "Voeu1.png" || ${title} == "Astroport" || ${title} == "MadeInZion" || ${title} == "G1Visa" || ${title} == "ZenCard" || ${title::5} == "Draft" ]] \
&& echo "FILTERED TITLE ${title}" && continue
## CHECK FOR TIDDLER WITH SAME TITTLE IN SECTOR TW
@@ -59,7 +61,7 @@ while read title; do
TMPTAGS=$(cat ~/.zen/tmp/${MOATS}/TMP.json | jq -r .[].tags)
TMPEMAILS=($(echo "$TMPTAGS" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
TMPSIGN=${#TMPEMAILS[@]}
- echo "INSIDE TIDDLER HAVE ${TMPSIGN} SIGNATURE(S)"
+ #~ echo "INSIDE TIDDLER HAVE ${TMPSIGN} SIGNATURE(S)"
if [[ "${ISHERE}" != "${title}" || ${TMPSIGN} == 0 ]]; then
@@ -79,32 +81,34 @@ while read title; do
&& rm ${INDEX} \
&& mv ~/.zen/tmp/${MOATS}/${SECTOR}/${SECTOR}.html ${INDEX} \
&& ((gloops++)) \
- && echo "SECTOR (${gloops}) : ${title}" \
+ && echo "GLOOPS (${gloops}) : ${title}" \
&& signatures=$((signatures + TMPSIGN))
- [[ ! -s ${INDEX} ]] && echo "ERROR. TW did not ingest ~/.zen/tmp/${MOATS}/NEW.json" && exit 1
+ [[ ! -s ${INDEX} ]] && echo "ERROR. TW could not ingest ~/.zen/tmp/${MOATS}/NEW.json" && exit 1
else
## SAME TIDDLER
- echo "TIDDLER WITH TITLE $title and more than 1 signature ALREADY EXISTS..."
+ echo "TIDDLER : $title (${TMPSIGN} signature(s)) ... ALREADY EXISTS..."
- cat ~/.zen/tmp/${MOATS}/TMP.json | jq .[] > ~/.zen/tmp/${MOATS}/INSIDE.json
+ ## Remove [] and put inline to compare
+ cat ~/.zen/tmp/${MOATS}/TMP.json | jq -rc .[] > ~/.zen/tmp/${MOATS}/INSIDE.json
cat "${RSS}" | jq -rc ".[] | select(.title == \"$title\")" > ~/.zen/tmp/${MOATS}/NEW.json
- if [[ ! $(diff ~/.zen/tmp/${MOATS}/NEW.json ~/.zen/tmp/${MOATS}/INSIDE.json) ]]; then
+ if [[ $(diff ~/.zen/tmp/${MOATS}/NEW.json ~/.zen/tmp/${MOATS}/INSIDE.json) == "" ]]; then
echo "... Tiddlers are similar ..."
((floop++))
continue
fi
floop=1
- echo
- echo "=========== INSIDE.json"
- cat ~/.zen/tmp/${MOATS}/INSIDE.json | jq -c
- echo
- echo "=========== NEW.json"
- cat ~/.zen/tmp/${MOATS}/NEW.json | jq -c
- echo
+ ## LOG TIDDLERS
+ #~ echo
+ #~ echo "=========== INSIDE.json"
+ #~ cat ~/.zen/tmp/${MOATS}/INSIDE.json | jq -c
+ #~ echo
+ #~ echo "=========== NEW.json"
+ #~ cat ~/.zen/tmp/${MOATS}/NEW.json | jq -c
+ #~ echo
## TODO EXTEND CONTROL TO text & ipfs & _canonical_url
## NEED SIGNATURES & TIDDLER SIMILARITY TO COME UP
@@ -119,6 +123,12 @@ while read title; do
ISIGN=${#IEMAILS[@]}
echo "Inside Tiddler $ISIGN signatures : ${IEMAILS[*]}"
+ ## New should have more signatures than Inside
+ [[ ${NSIGN} -le ${ISIGN} ]] && echo "Most signed already in..." && continue
+ ## UPLANET GRID COLLISION PARAM ###
+ # [[ ${NSIGN} -le 3 ]] && update TW OR continue
+ # https://www.copylaradio.com/blog/blog-1/post/decentralized-information-ecosystem-51
+
if [[ "${NEMAILS[*]}" != "${IEMAILS[*]}" ]]; then
## SEARCH FOR DIFFERENCE IN EMAIL SIGNATURES TAGS
@@ -150,6 +160,9 @@ while read title; do
NEWTID=$(ipfs add -q ~/.zen/tmp/${MOATS}/NEW.json | tail -n 1)
INSIDETID=$(ipfs add -q ~/.zen/tmp/${MOATS}/INSIDE.json | tail -n 1)
+ ###############################
+ ## TODO : check STAR level and activate auto merge
+
for email in "${unique_combined[@]}"; do
echo "
@@ -163,35 +176,43 @@ echo "
}
-(ᵔ◡◡ᵔ)
+$(date)
-Tiddler with same title is existing in ${unique_combined[*]} TW(s)
+$title
+Tiddler appears in ${unique_combined[*]} TW(s)
-To Accept
- ${COMMON[*]} have to copy NEW Tiddler in their TW
+MERGE :
+ ${COMMON[*]} import NEW Tiddler in your TW
-To Refuse
- ${NUNIQUE[*]} must fork by deleting or modifying New Tiddler title.
+or FORK :
+ ${NUNIQUE[*]} by deleting or modifying New Tiddler title.
-Actual TiddlerEngage discussion about it...
+
" > ~/.zen/tmp/${MOATS}/g1message
- ${MY_PATH}/../tools/mailjet.sh "$email" ~/.zen/tmp/${MOATS}/g1message "TIDDLER COLLISION"
+ ${MY_PATH}/../tools/mailjet.sh "$email" ~/.zen/tmp/${MOATS}/g1message "COLLISION ${title} : ${unique_combined[*]}"
done
- ## TITLE FORK TO BE SOLVED. NEED "SAME EMAILS SIGNATURES"
- continue
+ ## TITLE FORK TO BE SOLVED. NEED "SAME EMAILS SIGNATURES"
+ continue
+
+ else
+
+ echo "SIGNATURES ARE THE SAME : ${NEMAILS[*]}"
fi
- ## CHECK DIFFERENCE
+ echo "______________________"
+ echo "CHECKING DIFFERENCES"
+ diff ~/.zen/tmp/${MOATS}/NEW.json ~/.zen/tmp/${MOATS}/INSIDE.json
+
+ ## TODO CHECK MORE DIFFERENCE
DATENEW=$(cat ~/.zen/tmp/${MOATS}/NEW.json | jq -r .modified)
TEXTNEW=$(cat ~/.zen/tmp/${MOATS}/NEW.json | jq -r .text)
TAGSNEW=$(cat ~/.zen/tmp/${MOATS}/NEW.json | jq -r .tags)
@@ -205,7 +226,7 @@ To Refuse
if [ ${DATENEW} -gt ${DATEINSIDE} ]; then
- echo "Newer Tiddler version... Updating TW"
+ echo "Newer Tiddler version... Updating SECTOR TW"
tiddlywiki --load ${INDEX} \
--import ~/.zen/tmp/${MOATS}/NEW.json "application/json" \
diff --git a/RUNTIME/SECTOR.refresh.sh b/RUNTIME/SECTOR.refresh.sh
index 502f2b03..8aae7975 100755
--- a/RUNTIME/SECTOR.refresh.sh
+++ b/RUNTIME/SECTOR.refresh.sh
@@ -60,8 +60,9 @@ SECTORS=($(echo "${MYSECTORS[@]}" | tr ' ' '\n' | sort -u))
echo "ACTIVATED SECTORS : ${SECTORS[@]}"
for SECTOR in ${SECTORS[@]}; do
-
+ echo "############################################"
echo "_____SECTOR ${SECTOR}"
+ echo "################################ $(date)"
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/
SLAT=$(echo ${SECTOR} | cut -d '_' -f 2)
SLON=$(echo ${SECTOR} | cut -d '_' -f 3)
@@ -74,6 +75,7 @@ for SECTOR in ${SECTORS[@]}; do
COINS=$($MY_PATH/../tools/COINScheck.sh ${G1PUB} | tail -n 1)
ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1)
+ ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${SECTOR}.priv "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}"
ipfs key rm ${G1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
SECTORNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${SECTOR}.priv)
@@ -97,22 +99,21 @@ for SECTOR in ${SECTORS[@]}; do
start=`date +%s`
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#~ ## IPFS GET ONLINE YESTERDATE SECTORNS
- ipfs --timeout 240s get -o ~/.zen/tmp/${MOATS}/${SECTOR}/ /ipns/${YESTERDATENS}/
+ ipfs --timeout 180s get -o ~/.zen/tmp/${MOATS}/${SECTOR}/ /ipns/${YESTERDATENS}/
if [[ $? != 0 ]]; then
echo "(╥☁╥ ) swarm memory empty (╥☁╥ )"
# Try retieve memory from UPlanet Zen Memory
[[ ${ZEN} -gt 0 ]] \
&& echo "INTERCOM Refreshing from ZEN MEMORY" \
- && ${MY_PATH}/../RUNTIME/ZEN.SECTOR.memory.sh "${SECTOR}" "${MOATS}"
+ && ${MY_PATH}/../RUNTIME/ZEN.SECTOR.memory.sh "${SECTOR}" "${MOATS}" "${G1PUB}"
fi
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end=`date +%s`
echo "_____SECTOR${SECTOR} GET time was "`expr $end - $start` seconds.
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- ### ZEN
-
-
+ ### SHOW ${SECTOR}
+ mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/${SECTOR}
## CONTROL CHAIN TIME
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain | rev | cut -d ':' -f 1 | rev 2>/dev/null)
ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_moats 2>/dev/null)
@@ -169,6 +170,15 @@ for SECTOR in ${SECTORS[@]}; do
mv ${UREFRESH}.shuf ${UREFRESH}
echo "SETTING NEXT REFRESHER : $(cat ${UREFRESH} | head -n 1)"
+
+ ############ 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:${SECTOR}:${MIUSER}" \
+ && echo "UPLANET:101:${SECTOR}:${MIUSER}" && echo " ~~~ (♥‿‿♥) ~~ ${SECTOR} ~~ (♥‿‿♥) ~~~ "
+
##############################################################
## FEED SECTOR TW WITH UMAPS RSS
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/TW
@@ -183,6 +193,15 @@ for SECTOR in ${SECTORS[@]}; do
## SET SECTOR
sed -i "s~_SECTOR_~${SECTOR}~g" ${INDEX}
+ ## REFRESH ALL TWs in that SECTOR
+ rm -Rf ~/.zen/tmp/${MOATS}/${SECTOR}/TWz
+ mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/TWz
+
+ cp -rf ~/.zen/tmp/swarm/12D*/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/TW/* \
+ ~/.zen/tmp/${MOATS}/${SECTOR}/TWz
+ cp -rf ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/TW/* \
+ ~/.zen/tmp/${MOATS}/${SECTOR}/TWz 2>/dev/null
+
## GET ALL RSS json's AND Feed SECTOR TW with it
RSSNODE=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/RSS/*.rss.json 2>/dev/null))
NL=${#RSSNODE[@]}
@@ -216,7 +235,6 @@ for SECTOR in ${SECTORS[@]}; do
echo ${ZEN} > ~/.zen/tmp/${MOATS}/${SECTOR}/ZEN
echo "Number of RSS : "${TOTL}
- rm ~/.zen/tmp/${MOATS}/${SECTOR}/N_RSS* ## TODO REMOVE
echo ${TOTL} > ~/.zen/tmp/${MOATS}/${SECTOR}/N
###########################################################################################
@@ -230,8 +248,8 @@ for SECTOR in ${SECTORS[@]}; do
" > ~/.zen/tmp/world.js
floop=1
- SWARMTW=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_${SLAT}*_${SLON}*/TW/*/index.html 2>/dev/null))
- NODETW=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}*_${SLON}*/TW/*/index.html 2>/dev/null))
+ SWARMTW=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/TW/*/index.html 2>/dev/null))
+ NODETW=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/TW/*/index.html 2>/dev/null))
TWFILES=("${SWARMTW[@]}" "${NODETW[@]}")
for TWRED in ${TWFILES[@]}; do
@@ -272,7 +290,7 @@ for SECTOR in ${SECTORS[@]}; do
## ADD SECTOR ZENPUB.png & INFO.png
convert -font 'Liberation-Sans' \
-pointsize 80 -fill purple -draw 'text 50,120 "'"${ZEN} Zen"'"' \
- -pointsize 30 -fill purple -draw 'text 40, 180 "'"${SECTOR}"'"' \
+ -pointsize 30 -fill purple -draw 'text 40, 180 "'"${SECTOR}:${YESTERDATE}"'"' \
$MY_PATH/../images/G1WorldMap.png "${HOME}/.zen/tmp/${MOATS}/${SECTOR}.png"
# CREATE G1PUB AMZQR
amzqr ${G1PUB} -l H -p "$MY_PATH/../images/zenticket.png" -c -n ZENPUB.png -d ~/.zen/tmp/${MOATS}/${SECTOR}/
@@ -338,7 +356,7 @@ for SECTOR in ${SECTORS[@]}; do
###############################
echo "% PUBLISHING ${SECTOR} ${myIPFS}/ipns/${TODATENS}"
start=`date +%s`
- ipfs name publish -k ${TODATE}${G1PUB} /ipfs/${IPFSPOP}
+ ipfs --timeout 240s name publish -k ${TODATE}${G1PUB} /ipfs/${IPFSPOP}
ipfs key rm ${YESTERDATE}${G1PUB} ${G1PUB} > /dev/null 2>&1
######################################################
@@ -356,7 +374,7 @@ for SECTOR in ${SECTORS[@]}; do
###################################
## NODE CACHE SECTOR TODATENS
- echo "" \
+ echo "_${SLAT}_${SLON}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${REGLAT}_${REGLON}/_${SLAT}_${SLON}/_index.html
## TODO FILTER INFORMATION WITH MULTIPLE SIGNATURES (DONE in REGION.refresh.sh)
diff --git a/RUNTIME/UPLANET.refresh.sh b/RUNTIME/UPLANET.refresh.sh
index a4fc9354..97d73238 100755
--- a/RUNTIME/UPLANET.refresh.sh
+++ b/RUNTIME/UPLANET.refresh.sh
@@ -18,7 +18,7 @@ echo "
-------------------------
\ ^__^
\ (oo)\_______
- (__)\ )\/\
+ (__)\ )\\/\\
||----w |
|| ||
@@ -49,7 +49,8 @@ for UMAP in ${unique_combined[@]}; do
start=`date +%s`
echo
- echo "____________REFRESHING ${UMAP}__________"
+ echo "-------------------------------------------------------------------"
+ echo "____________REFRESHING ${UMAP}__________ $(date)"
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
LON=$(echo ${UMAP} | cut -d '_' -f 3)
@@ -77,37 +78,40 @@ for UMAP in ${unique_combined[@]}; do
## ORIGIN ##########################################################
## CALCULATE INITIAL UMAP GEOSPACIAL IPNS KEY
- ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${UMAP}.priv "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}"
+ ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${UMAP}.priv "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}"
ipfs key rm ${G1PUB} > /dev/null 2>&1
UMAPNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${UMAP}.priv)
echo "ORIGIN : ${myIPFS}/ipns/${UMAPNS}"
###################### SPATIO TEMPORAL KEYS
## TODATE #########################################
- ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}"
+ ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}"
ipfs key rm ${TODATE}${G1PUB} > /dev/null 2>&1
TODATENS=$(ipfs key import ${TODATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${TODATE}.priv)
echo "TODAY : ${myIPFS}/ipns/${TODATENS}"
## YESTERDATE ###############
- ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${LAT}" "${YESTERDATE}${UPLANETNAME}${LON}"
+ ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${LAT}" "${YESTERDATE}${UPLANETNAME}${LON}"
ipfs key rm ${YESTERDATE}${G1PUB} > /dev/null 2>&1
YESTERDATENS=$(ipfs key import ${YESTERDATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv)
echo "YESTERDAY : ${myIPFS}/ipns/${YESTERDATENS}"
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ start=`date +%s`
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- echo "## IPFS GET YESTERDATENS"
mkdir ~/.zen/tmp/${MOATS}/${UMAP}
- ipfs --timeout 240s get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/
+ echo "## IPFS GET YESTERDATENS"
+ ipfs --timeout 300s get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/
if [[ $? != 0 ]]; then
- echo "(╥☁╥ ) swarm memory empty (╥☁╥ )"
+ echo "(╥☁╥ ) swarm online memory empty (╥☁╥ )"
# Try retieve memory from UPlanet Zen Memory
[[ ${ZEN} -gt 0 ]] \
&& echo "INTERCOM Refreshing from ZEN MEMORY" \
- && ${MY_PATH}/../RUNTIME/ZEN.UMAP.memory.sh "${UMAP}" "${MOATS}"
+ && ${MY_PATH}/../RUNTIME/ZEN.UMAP.memory.sh "${UMAP}" "${MOATS}" "${G1PUB}"
fi
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+ end=`date +%s`
+ echo "_____UMAP${UMAP} GET time was "`expr $end - $start` seconds.
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
## FORMAT CONTROL WARNING
@@ -147,15 +151,15 @@ for UMAP in ${unique_combined[@]}; do
[[ ! $(echo ${STRAPS[@]} | grep ${ACTINGNODE}) ]] && ACTINGNODE=${STRAPS[0]}
# ++++++++++++++++++++ - - - - FIND LAST TREATMENT TIME
- ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats 2>/dev/null) || ZMOATS=${MOATS}
- # ZMOATS SHOULD BE MORE THAT 5 HOURS.
- MOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
- ZMOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${ZMOATS})
- DIFF_SECONDS=$((MOATS_SECONDS - ZMOATS_SECONDS))
- hours=$((DIFF_SECONDS / 3600))
- minutes=$(( (DIFF_SECONDS % 3600) / 60 ))
- seconds=$((DIFF_SECONDS % 60))
- echo "UMAP DATA is ${hours} hours ${minutes} minutes ${seconds} seconds "
+ ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats 2>/dev/null) || ZMOATS=${MOATS}
+ # ZMOATS SHOULD BE MORE THAT 5 HOURS.
+ MOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
+ ZMOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${ZMOATS})
+ DIFF_SECONDS=$((MOATS_SECONDS - ZMOATS_SECONDS))
+ hours=$((DIFF_SECONDS / 3600))
+ minutes=$(( (DIFF_SECONDS % 3600) / 60 ))
+ seconds=$((DIFF_SECONDS % 60))
+ echo "UMAP DATA is ${hours} hours ${minutes} minutes ${seconds} seconds "
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## IF NOT UPDATED FOR TOO LONG
@@ -171,12 +175,12 @@ for UMAP in ${unique_combined[@]}; do
echo "------8<-------------8<------------------8<-----------------8<-----------------8<"
continue
fi
- ########################################
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PASSING THERE MAKE IPFSNODEID UMAP REFRESHER
-
+ ################################################################################
+ # ~~~~~~~~~~~~~ GOING FURTHER ~~~ MEANS IPFSNODEID IS UMAP REFRESHER ~~~~~~~~~~~
+ ################################################################################
## NEXT REFRESHER
# TODO: INTRODUCE NODE BALANCE AND CHOOSE THE MOST CONFIDENT ONE
- rm ${UREFRESH}
+ rm ${UREFRESH}
for STRAP in ${STRAPS[@]}; do
echo ${STRAP} >> ${UREFRESH} ## FILL UMAP.refresher file with all STRAPS
done
@@ -187,6 +191,14 @@ for UMAP in ${unique_combined[@]}; do
echo ">> NEXT REFRESHER WILL BE $(cat ${UREFRESH} | head -n 1)"
######################################################## # NODE SELECTION in UMAP.refresher
+ ############ 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} ~~ (♥‿‿♥) ~~~ "
+
# %%%%%%%%%% ##################################################
## SECTOR LINKING >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${SLAT}_${SLON}
# %%%%%%%%%% ##################################################
@@ -229,6 +241,70 @@ for UMAP in ${unique_combined[@]}; do
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${RLAT}_${RLON}
echo "" > ~/.zen/tmp/${MOATS}/${UMAP}/${RLAT}_${RLON}/index.html
+ ####################################################################################
+ ######################## NEXTNS : UMAP, SECTOR, REGION ## BOOSTRAP TO SWARM ##
+ mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/
+ ####################################################################################
+ #################################################################################
+ ## DEMAIN DATA
+ ####################################################################################
+ ## UMAP NEXTNS ############### INFORM "PLAYER.refresh.sh" WITH _next.umap
+ ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/next.priv "${DEMAINDATE}${UPLANETNAME}${LAT}" "${DEMAINDATE}${UPLANETNAME}${LON}"
+ ipfs key rm "next" > /dev/null 2>&1
+ NEXTNS=$(ipfs key import "next" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/next.priv)
+ echo "UMAP NEXTNS : ${myIPFS}/ipns/${NEXTNS}"
+ ipfs key rm "next" > /dev/null 2>&1
+ 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}/
+ ## 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
+ NEXTNS=$(ipfs key import "next" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/next.priv)
+ echo "SECTOR NEXTNS : ${myIPFS}/ipns/${NEXTNS}"
+ ipfs key rm "next" > /dev/null 2>&1
+ 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}/
+ ## 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
+ NEXTNS=$(ipfs key import "next" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/next.priv)
+ echo "REGION NEXTNS : ${myIPFS}/ipns/${NEXTNS}"
+ ipfs key rm "next" > /dev/null 2>&1
+ 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}/
+ ####################################################################################
+ ## TODATE DATA
+ ####################################################################################
+ echo "${TODATENS}" \
+ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/TODATENS
+ echo "${SECTORNS}" \
+ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/SECTORNS
+ echo "${TODATEREGIONNS}" \
+ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/REGIONNS
+ echo "${G1PUB}" \
+ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/G1PUB
+ echo "${SECTORG1PUB}" \
+ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/SECTORG1PUB
+ echo "${REGIONG1PUB}" \
+ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/REGIONG1PUB
+
+ ####################################################################################
+
# %%%%%%%%%% ##################################################
## COLLECT RSS FROM ALL PLAYERS WITH SAME UMAP IN SWARM MEMORY /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
# %%%%%%%%%% ##################################################
@@ -400,6 +476,8 @@ for UMAP in ${unique_combined[@]}; do
-e "s~_UPUPZONE_~REGION ${REGION}~g" \
-e "s~_UPUPZONENS_~${TODATEREGIONNS}~g" \
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
+ -e "s~_CESIUMIPFS_~${CESIUMIPFS}~g" \
+ -e "s~_G1PUB_~${G1PUB}~g" \
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${LAT}\&southWestLon=${LON}\°=0.01~g" \
-e "s~http://127.0.0.1:8080~~g" \
@@ -430,7 +508,7 @@ for UMAP in ${unique_combined[@]}; do
## ZEN CHAINING
# Send 1 Zen to UPlanet SECTORG1PUB Wallet containing REGION TW HASH
INTERCOM="UPLANET:${UMAP}:${TODATE}:/ipfs/${UMAPROOT}"
- echo "> INTERCOM ${INTERCOM} (${ZEN} ZEN)"
+ echo "> INTERCOM ${INTERCOM} (${ZEN} ZEN > 11 ?)"
if [[ ${ZEN} -gt 11 ]]; then
echo "---ZZZ-- UMAP 2 SECTOR ZEN CHAINING ---ZZZ------ZZZ----"
${MY_PATH}/../tools/PAY4SURE.sh ~/.zen/tmp/${MOATS}/${UMAP}.dunikey "0.1" "${SECTORG1PUB}" "${INTERCOM}"
@@ -444,7 +522,7 @@ for UMAP in ${unique_combined[@]}; do
echo "PUBLISHING ${TODATE} UMAPROOT : ${myIPFS}/ipfs/${UMAPROOT}"
- ipfs name publish --key=${TODATE}${G1PUB} /ipfs/${UMAPROOT}
+ ipfs --timeout 300s name publish --key=${TODATE}${G1PUB} /ipfs/${UMAPROOT}
end=`date +%s`
echo "(UMAP) ${UMAP} ${TODATE} PUBLISH time was "`expr $end - $start` seconds.
diff --git a/RUNTIME/VISA.new.sh b/RUNTIME/VISA.new.sh
index 4b7eea77..e1f39707 100755
--- a/RUNTIME/VISA.new.sh
+++ b/RUNTIME/VISA.new.sh
@@ -19,29 +19,33 @@ SALT="$1"
PEPPER="$2"
PLAYER="$3"
PSEUDO="$4"
+[[ $PSEUDO == "" ]] && PSEUDO="Anonymous"
## Fill UP TW with VIDEO URL or UMAP NS
URL="$5"
+[[ $URL == "" ]] && URL="_URL_"
-## UPLANET SECTOR
+## UPLANET UMAP
LAT="$6"
+[[ $LAT == "" ]] && LAT="0.00"
LON="$7"
+[[ $LON == "" ]] && LON="0.00"
################################################################################
YOU=$(myIpfsApi);
-LIBRA=$(head -n 2 ${MY_PATH}/../A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
################################################################################
## LIST TW MODELS
################################################################################
-TWMODEL="/ipfs/bafybeiewwxkmiojbskcqhbj2gbkde3czkeqftn6fgvwoa7ez5n5whido3q"
-# ipfs cat $TWMODEL > templates/twdefault.html
-MINIMAL="/ipfs/bafybeifnlpnvpxxnblgwefoflmdnt2vhckmnu22orsi43zilh2v4sbegjy"
-# ipfs cat $MINIMAL > templates/twuplanet.html
+#~ TWMODEL="/ipfs/bafybeid7xwuqkgyiffehs77x3wky3dghjncxepr5ln6dewapgvbwrqi7n4"
+#~ # ipfs cat $TWMODEL > templates/twdefault.html
+TWUPLANET="/ipfs/bafybeigpwapdih24vnakummoyj6vodxiem4i6ezp5hxa35yt3paxpqz53y" ## WITH LIGHTBEAMS SAVER
+TWUPLANET="/ipfs/bafybeicquhlstbogaxgx2bwqjra5zlmfg33ciengwwy62w5myucaxksuli" ## WITH IPFS SAVER
+# ipfs cat $TWUPLANET > templates/twuplanet.html
################################################################################
mkdir -p ~/.zen/tmp/${MOATS}/TW
-## Chargement TW !!!
+## TEST chargement ONLINE TW !!!
if [[ $SALT != "" && PEPPER != "" ]]; then
## Creating SALT/PEPPER IPNS KEY
@@ -57,22 +61,22 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
[[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]] \
&& [[ -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
&& echo "TW FOUND ENTER 'yes' TO RESET TW. HIT ENTER TO KEEP IT." \
- && read ENTER \
- && [[ $ENTER != "" ]] && rm ~/.zen/tmp/${MOATS}/TW/index.html
+ && read ENTER
- # EXTEND SEARCH IN WEB2.0
- #~ [[ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
- #~ && echo "Trying curl on $LIBRA" \
- #~ && curl -m 30 -so ~/.zen/tmp/${MOATS}/TW/index.html "$LIBRA/ipns/${ASTRONAUTENS}"
+ if [[ $ENTER != "" ]]; then
+
+ # BACKUP tiddlers
+ tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp \
+ --render '.' 'backup.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[!is[system]]'
+ rm ~/.zen/tmp/${MOATS}/TW/index.html
+ echo ">> Tiddlers Backup : ~/.zen/tmp/backup.json"
+ fi
#############################################
## AUCUN RESULTAT
if [ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]; then
- # COPY TW TEMPLATE
- [[ ${LON} && ${LAT} ]] \
- && cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html \
- || cp ${MY_PATH}/../templates/twdefault.html ~/.zen/tmp/${MOATS}/TW/index.html
+ cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html
else
#############################################
@@ -80,10 +84,11 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
rm -f ~/.zen/tmp/${MOATS}/Astroport.json
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
+ HPass=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].HPASS)
echo "ASTROPORT=${ASTROPORT}"
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'AstroID.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'AstroID'
- AstroID=$(cat ~/.zen/tmp/${MOATS}/AstroID.json | jq -r .[]._canonical_uri)
- HPass=$(cat ~/.zen/tmp/${MOATS}/AstroID.json | jq -r .[].HPASS)
+ AstroID=$(cat ~/.zen/tmp/${MOATS}/AstroID.json | jq -r .[]._canonical_uri) ## Can be deleted
+ [[ -z $HPass ]] && HPass=$(cat ~/.zen/tmp/${MOATS}/AstroID.json | jq -r .[].HPASS) ## Double HPASS
echo "AstroID=$AstroID ($HPass)"
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'ZenCard.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'ZenCard'
ZenCard=$(cat ~/.zen/tmp/${MOATS}/ZenCard.json | jq -r .[]._canonical_uri)
@@ -98,7 +103,7 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
else
echo ">> NO ACTIVE TW - CREATING FRESH NEW ONE"
- cp ${MY_PATH}/../templates/twdefault.html ~/.zen/tmp/${MOATS}/TW/index.html
+ cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html
fi
@@ -124,7 +129,7 @@ fi
[[ $SALT == "" ]] && SALT=$(${MY_PATH}/../tools/diceware.sh 4 | xargs)
#~ echo "-> ID : $SALT"
-[[ $PEPPER == "" ]] && PEPPER=$(${MY_PATH}/../tools/diceware.sh 2 | xargs)
+[[ $PEPPER == "" ]] && PEPPER=$(${MY_PATH}/../tools/diceware.sh 4 | xargs)
#~ echo "-> PASS : $PEPPER"
[[ ! $PSEUDO ]] && PSEUDO=${PLAYER%%[0-9]*}
@@ -132,8 +137,9 @@ fi
[[ $(ls ~/.zen/game/players/$PSEUDO 2>/dev/null) ]] && echo "$PSEUDO EST DEJA UN PLAYER. EXIT" && exit 1
# PSEUDO=${PSEUDO,,} #lowercase
-[[ ! ${PLAYER} ]] && PLAYER=${PSEUDO}${RANDOM:0:3}@$(${MY_PATH}/../tools/diceware.sh 1 | xargs).${RANDOM:0:3} \
- && echo "ADRESSE EMAIL ?" && read OPLAYER && [[ $OPLAYER ]] && PLAYER=$OPLAYER
+[[ ! ${PLAYER} ]] \
+ && PLAYER=${PSEUDO}${RANDOM:0:3}@$(${MY_PATH}/../tools/diceware.sh 1 | xargs).${RANDOM:0:3} \
+ && echo "ADRESSE EMAIL ?" && read OPLAYER && [[ $OPLAYER ]] && PLAYER=$OPLAYER ## CLI MODE
PLAYER=${PLAYER,,}
@@ -141,341 +147,324 @@ PLAYER=${PLAYER,,}
PASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-5)
############################################################
-######### TODO Ajouter d'autres clefs IPNS, GPG ?
-# MOANS=$(ipfs key gen moa_${PLAYER})
-# MOAKEYFILE=$(${MY_PATH}/give_me_keystore_filename.py "moa_${PLAYER}")
-# echo "Coffre personnel multimedia journalisé dans votre 'Astroport' (amis de niveau 3)"
-# echo "Votre clef moa_${PLAYER} <=> $MOANS ($MOAKEYFILE)"; sleep 2
-############################################################
-
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/secret.dunikey "$SALT" "$PEPPER"
G1PUB=$(cat ~/.zen/tmp/${MOATS}/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
[[ ! $G1PUB ]] && echo "Désolé. clef Cesium absente. ERROR" && exit 1
- ## CREATE Player personnal files storage and IPFS publish directory
- mkdir -p ~/.zen/game/players/${PLAYER}/.ipfs # Prepare PLAYER datastructure
- echo "/ip4/127.0.0.1/tcp/5001" > ~/.zen/game/players/${PLAYER}/.ipfs/api
+## CREATE Player personnal files storage and IPFS publish directory
+mkdir -p ~/.zen/game/players/${PLAYER}/.ipfs # Prepare PLAYER datastructure
+echo "/ip4/127.0.0.1/tcp/5001" > ~/.zen/game/players/${PLAYER}/.ipfs/api
- # PLAYER=geg-la_debrouille@super.chez-moi.com
-YUSER=$(echo ${PLAYER} | cut -d '@' -f1) # YUSER=geg-la_debrouille
-LYUSER=($(echo "$YUSER" | sed 's/[^a-zA-Z0-9]/\ /g')) # LYUSER=(geg la debrouille)
-CLYUSER=$(printf '%s\n' "${LYUSER[@]}" | tac | tr '\n' '.' ) # CLYUSER=debrouille.la.geg.
-YOMAIN=$(echo ${PLAYER} | cut -d '@' -f 2) # YOMAIN=super.chez-moi.com
-# echo "NEXT STYLE GW : https://ipfs.$CLYUSER$YOMAIN.$(myHostName)"
-# echo "MY PLAYER API GW : $(myPlayerApiGw)"
+## secret.june = SALT PEPPER CREDENTIALS
+echo "SALT=\"$SALT\"" > ~/.zen/game/players/${PLAYER}/secret.june
+echo "PEPPER=\"$PEPPER\"" >> ~/.zen/game/players/${PLAYER}/secret.june
+####
+## MOVE ${MOATS} secret.dunikey IN PLAYER DIRECTORY
+mv ~/.zen/tmp/${MOATS}/secret.dunikey ~/.zen/game/players/${PLAYER}/
NID="${myIPFS}"
-WID="https://ipfs.$CLYUSER$YOMAIN.$(myHostName)/api" ## Next Generation API # TODO PLAYER IPFS Docker entrance
-WID="https://ipfs.$(myHostName)/api"
-WID="https://ipfs.$(myHostName)/api"
WID="${myAPI}" ## https://ipfs.libra.copylaradio.com
-# WID="http://ipfs.$(myHostName):5001"
+[[ $isLAN ]] && NID="http://ipfs.localhost:8080" \
+ && WID="http://ipfs.localhost:5001"
+
+# Create ${PLAYER} "IPNS Key"
+ipfs key rm ${PLAYER} >/dev/null 2>&1
+ipfs key rm ${G1PUB} >/dev/null 2>&1
+${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/game/players/${PLAYER}/secret.player "$SALT" "$PEPPER"
+TWNS=$(ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player)
+ASTRONAUTENS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player)
+
+## TODO MAKE CLEANER
+mkdir -p ~/.zen/game/players/${PLAYER}/ipfs/G1SSB # Prepare astrXbian sub-datastructure "old scarf code"
+qrencode -s 12 -o ~/.zen/game/players/${PLAYER}/QR.png "$G1PUB" ## Check by VISA.print.sh
+cp ~/.zen/game/players/${PLAYER}/QR.png ~/.zen/game/players/${PLAYER}/ipfs/QR.png
+echo "$G1PUB" > ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.pubkey # G1SSB NOTATION (astrXbian compatible)
+qrencode -s 12 -o ~/.zen/game/players/${PLAYER}/QR.ASTRONAUTENS.png "$myLIBRA/ipns/${ASTRONAUTENS}"
+
+############################################################################
+## SEC PASS PROTECTED QRCODE : base58 secret.june / openssl(pass)
+#~ secFromDunikey=$(cat ~/.zen/game/players/${PLAYER}/secret.dunikey | grep "sec" | cut -d ' ' -f2)
+#~ echo "$secFromDunikey" > ~/.zen/tmp/${MOATS}/${PSEUDO}.sec
+
USALT=$(echo "$SALT" | jq -Rr @uri)
UPEPPER=$(echo "$PEPPER" | jq -Rr @uri)
DISCO="/?salt=${USALT}&pepper=${UPEPPER}"
-[[ $isLAN ]] && NID="http://ipfs.localhost:8080" \
- && WID="http://ipfs.localhost:5001"
+## PGP ENCODING SALT/PEPPER API ACCESS
+echo "${DISCO}" > ~/.zen/tmp/${MOATS}/topgp
+cat ~/.zen/tmp/${MOATS}/topgp | gpg --symmetric --armor --batch --passphrase "$PASS" -o ~/.zen/tmp/${MOATS}/gpg.${PSEUDO}.asc
+rm ~/.zen/tmp/${MOATS}/topgp
+#~ openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 100000 -salt -in ~/.zen/game/players/${PLAYER}/secret.june -out "$HOME/.zen/tmp/${MOATS}/enc.${PSEUDO}.sec" -k "$PASS"
+#~ PASsec=$(cat ~/.zen/tmp/${MOATS}/enc.${PSEUDO}.sec | base64 -w 0 | jq -sRr '@uri' )
+#~ HPass=$(echo "$PASS" | sha512sum | cut -d ' ' -f 1)
+#~ qrencode -s 12 -o $HOME/.zen/game/players/${PLAYER}/QRsec.png $PASsec
-####
+## Add logo to QRCode
+cp ${MY_PATH}/../images/astrologo_nb.png ~/.zen/tmp/${MOATS}/fond.png
- mv ~/.zen/tmp/${MOATS}/secret.dunikey ~/.zen/game/players/${PLAYER}/
+## ASTROID ~~~~~
+ASTROIDQR="$(cat ~/.zen/tmp/${MOATS}/gpg.${PSEUDO}.asc | tr '-' '~' | tr '\n' '-' | tr '+' '_' | jq -Rr @uri )"
+## MAKE amzqr ASTROID PGP QRCODE
+amzqr "${ASTROIDQR}" \
+ -d ~/.zen/tmp/${MOATS} \
+ -l H \
+ -p ~/.zen/tmp/${MOATS}/fond.png 1>/dev/null
- # Create Player "IPNS Key" (key import)
- ipfs key rm ${PLAYER}
- ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/game/players/${PLAYER}/secret.player "$SALT" "$PEPPER"
- TWNS=$(ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player)
- ASTRONAUTENS=$(ipfs key import $G1PUB -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player)
+## ADD PLAYER EMAIL
+convert -gravity northwest -pointsize 28 -fill black -draw "text 5,5 \"$PLAYER\"" ~/.zen/tmp/${MOATS}/fond_qrcode.png ~/.zen/game/players/${PLAYER}/result_qrcode.png
+convert ~/.zen/game/players/${PLAYER}/result_qrcode.png -resize 480 ~/.zen/game/players/${PLAYER}/AstroID.png
- mkdir -p ~/.zen/game/players/${PLAYER}/ipfs/G1SSB # Prepare astrXbian sub-datastructure "old scarf code"
-
- qrencode -s 12 -o ~/.zen/game/players/${PLAYER}/QR.png "$G1PUB"
- cp ~/.zen/game/players/${PLAYER}/QR.png ~/.zen/game/players/${PLAYER}/ipfs/QR.png
- echo "$G1PUB" > ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.pubkey # G1SSB NOTATION (astrXbian compatible)
-
- qrencode -s 12 -o ~/.zen/game/players/${PLAYER}/QR.ASTRONAUTENS.png "$myLIBRA/ipns/${ASTRONAUTENS}"
-
-############################################################################
- ## SEC PASS PROTECTED QRCODE : base58 secret.june / openssl(pass)
- #~ secFromDunikey=$(cat ~/.zen/game/players/${PLAYER}/secret.dunikey | grep "sec" | cut -d ' ' -f2)
- #~ echo "$secFromDunikey" > ~/.zen/tmp/${MOATS}/${PSEUDO}.sec
-
- ## PGP ENCODING SALT/PEPPER API ACCESS
- echo "${DISCO}" > ~/.zen/tmp/${MOATS}/topgp
- cat ~/.zen/tmp/${MOATS}/topgp | gpg --symmetric --armor --batch --passphrase "$PASS" -o ~/.zen/tmp/${MOATS}/gpg.${PSEUDO}.asc
- rm ~/.zen/tmp/${MOATS}/topgp
- #~ openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 100000 -salt -in ~/.zen/game/players/${PLAYER}/secret.june -out "$HOME/.zen/tmp/${MOATS}/enc.${PSEUDO}.sec" -k "$PASS"
- #~ PASsec=$(cat ~/.zen/tmp/${MOATS}/enc.${PSEUDO}.sec | base64 -w 0 | jq -sRr '@uri' )
- #~ HPass=$(echo "$PASS" | sha512sum | cut -d ' ' -f 1)
- #~ qrencode -s 12 -o $HOME/.zen/game/players/${PLAYER}/QRsec.png $PASsec
-
- ## Add logo to QRCode
- cp ${MY_PATH}/../images/astrologo_nb.png ~/.zen/tmp/${MOATS}/fond.png
-
- ## ASTROID ~~~~~ || &&&&&
- ASTROIDQR="$(cat ~/.zen/tmp/${MOATS}/gpg.${PSEUDO}.asc | tr '-' '~' | tr '\n' '-' | tr '+' '_' | jq -Rr @uri )"
- [[ ${PSEUDO} == "UPlanet" ]] && ASTROIDQR="$(cat ~/.zen/tmp/${MOATS}/gpg.${PSEUDO}.asc | tr '-' '&' | tr '\n' '-' | tr '+' '_' | jq -Rr @uri )"
- ## MAKE amzqr ASTROID PGP QRCODE
- amzqr "${ASTROIDQR}" \
- -d ~/.zen/tmp/${MOATS} \
- -l H \
- -p ~/.zen/tmp/${MOATS}/fond.png 1>/dev/null
-
- ## ADD PLAYER EMAIL
- convert -gravity northwest -pointsize 28 -fill black -draw "text 5,5 \"$PLAYER\"" ~/.zen/tmp/${MOATS}/fond_qrcode.png ~/.zen/game/players/${PLAYER}/result_qrcode.png
- convert ~/.zen/game/players/${PLAYER}/result_qrcode.png -resize 480 ~/.zen/game/players/${PLAYER}/AstroID.png
-
- ASTROQR="/ipfs/$(ipfs add -q $HOME/.zen/game/players/${PLAYER}/AstroID.png | tail -n 1)"
+ASTROQR="/ipfs/$(ipfs add -q $HOME/.zen/game/players/${PLAYER}/AstroID.png | tail -n 1)"
############################################################################ TW
- ### INITALISATION WIKI dans leurs répertoires de publication IPFS
- mkdir -p ~/.zen/game/players/${PLAYER}/ipfs/moa/
+### INITALISATION WIKI dans leurs répertoires de publication IPFS
+mkdir -p ~/.zen/game/players/${PLAYER}/ipfs/moa/
- [[ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]] && cp ${MY_PATH}/../templates/twdefault.html ~/.zen/tmp/${MOATS}/TW/index.html
- sed "s~_BIRTHDATE_~${MOATS}~g" ~/.zen/tmp/${MOATS}/TW/index.html > ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+[[ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
+ && cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html
- # INSERT ASTROPORT ADDRESS
- tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
- ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
- sed -i "s~${ASTROPORT}~/ipns/${IPFSNODEID}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+sed "s~_BIRTHDATE_~${MOATS}~g" ~/.zen/tmp/${MOATS}/TW/index.html \
+ > ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- # TW CHAIN INIT WITH TWMODEL
- sed -i "s~_MOATS_~${MOATS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~_CHAIN_~${TWMODEL}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~_TWMODEL_~${TWMODEL}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~_TW_~/ipns/${ASTRONAUTENS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+# INSERT ASTROPORT ADDRESS
+tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
+ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
+sed -i "s~${ASTROPORT}~/ipns/${IPFSNODEID}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- ## AND HACK QRCODE.sh FOR _PGP KEY_ TO VERIFY LAST HASH OF PROVIDED PASS
- HPASS=$(echo $PASS | sha512sum | cut -d ' ' -f 1)
- [[ ${HPass} != "" ]] && SRCPASS=${HPass} || SRCPASS="_HPASS_"
- sed -i "s~${SRCPASS}~${HPASS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+# TW CHAIN INIT WITH TWMODEL
+sed -i "s~_MOATS_~${MOATS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+sed -i "s~_CHAIN_~${TWUPLANET}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+sed -i "s~_TWMODEL_~${TWUPLANET}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+sed -i "s~_ASTRONAUTENS_~/ipns/${ASTRONAUTENS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- ## RESET WISHES TO DEPLOY DERIVATED KEYS ON HOST AGAIN ( DONE IN PLAYER_REFRESH )
- #~ sed -i "s~G1Voeu~voeu~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+## AND HACK QRCODE.sh FOR _PGP KEY_ TO VERIFY LAST HASH OF PROVIDED PASS
+HPASS=$(echo $PASS | sha512sum | cut -d ' ' -f 1)
+[[ ${HPass} != "" ]] && SRCPASS=${HPass} || SRCPASS="_HPASS_"
+sed -i "s~${SRCPASS}~${HPASS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- ## Fill LNK - Tiddler - escape \&
- sed -i "s~_URL_~$(echo "${URL}" | sed 's/[&/]/\\&/g')~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+## RESET WISHES TO DEPLOY DERIVATED KEYS ON HOST AGAIN ( DONE IN PLAYER_REFRESH )
+#~ sed -i "s~G1Voeu~voeu~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- # INSERT PLAYER DATA
- sed -i "s~_PLAYER_~${PLAYER}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~_PSEUDO_~${PSEUDO}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~_WISHKEY_~${G1PUB}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+## Fill LNK - Tiddler - escape \&
+sed -i "s~_URL_~$(echo "${URL}" | sed 's/[&/]/\\&/g')~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- #~ sed -i "s~_QRSEC_~${PASsec}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+# INSERT PLAYER DATA
+sed -i "s~_PLAYER_~${PLAYER}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+sed -i "s~_PSEUDO_~${PSEUDO}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+#~ sed -i "s~_QRSEC_~${PASsec}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
- # La Clef IPNS porte comme nom G1PUB et ${PLAYER}
- sed -i "s~_MEDIAKEY_~${PLAYER}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~k2k4r8kxfnknsdf7tpyc46ks2jb3s9uvd3lqtcv9xlq9rsoem7jajd75~${ASTRONAUTENS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+# La Clef IPNS porte comme nom G1PUB et ${PLAYER}
+sed -i "s~_MEDIAKEY_~${PLAYER}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+sed -i "s~k2k4r8kxfnknsdf7tpyc46ks2jb3s9uvd3lqtcv9xlq9rsoem7jajd75~${ASTRONAUTENS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~_ASTRONAUTENS_~/ipns/${ASTRONAUTENS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- ## AstroID Tiddler UPGRADE
- cat ${MY_PATH}/../templates/data/AstroID.json \
- | sed -e "s~/ipfs/bafybeifbebc3ewnzrzbm44arddedbralegnxklhua5d5ymzaqtf2kaub7i~${ASTROQR}~g" \
- -e "s~_PLAYER_~${PLAYER}~g" \
- -e "s~_G1PUB_~${G1PUB}~g" \
- -e "s~_ASTRONAUTENS_~${ASTRONAUTENS}~g" \
- -e "s~_HPASS_~${HPASS}~g" \
- > ~/.zen/tmp/${MOATS}/AstroID.json
+## AstroID Tiddler UPGRADE
+cat ${MY_PATH}/../templates/data/AstroID.json \
+ | sed -e "s~/ipfs/bafybeifbebc3ewnzrzbm44arddedbralegnxklhua5d5ymzaqtf2kaub7i~${ASTROQR}~g" \
+ -e "s~_PLAYER_~${PLAYER}~g" \
+ -e "s~_MOATS_~${MOATS}~g" \
+ -e "s~_G1PUB_~${G1PUB}~g" \
+ -e "s~_ASTRONAUTENS_~${ASTRONAUTENS}~g" \
+ -e "s~_HPASS_~${HPASS}~g" \
+ > ~/.zen/tmp/${MOATS}/AstroID.json
- sed -i "s~${AstroID}~${ASTROQR}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ## NOT CYPHERED AstroID
+sed -i "s~tube.copylaradio.com~$myTUBE~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+sed -i "s~ipfs.copylaradio.com~$myTUBE~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~tube.copylaradio.com~$myTUBE~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- sed -i "s~ipfs.copylaradio.com~$myTUBE~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+## PREPARE UMAP LAT LON replacement
+[[ ! ${LAT} ]] && LAT="0.00"
+[[ ! ${LON} ]] && LON="0.00"
- ## PREPARE UMAP LAT LON replacement
- [[ ! ${LAT} ]] && LAT="0.00"
- [[ ! ${LON} ]] && LON="0.00"
- UMAP=${URL}
- [[ ! $(echo ${UMAP} | grep "/ipns/") ]] && UMAP="/ipns/k51qzi5uqu5djg1gqzujq5p60w25mi235gdg0lgkk5qztkfrpi5c22oolrriyu" ## DEFAULT = 0.00
+SECTOR="_${LAT::-1}_${LON::-1}" ### SECTOR = 0.1° Planet Slice in MadeInZion Tiddler
+echo "UPlanet 0.1° SECTOR : ${SECTOR}"
+sed -i "s~_SECTOR_~${SECTOR}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- if [[ ${LAT} && ${LON} ]]; then
- # GET ACTUAL GPS VALUES
- tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS'
- OLAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
- OLON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
- OUMAP=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].umap)
- # REPLACE WITH NEW LAT LON UMAP
- sed -i "s~${OLAT}~${LAT}~g" ~/.zen/tmp/${MOATS}/GPS.json
- sed -i "s~${OLON}~${LON}~g" ~/.zen/tmp/${MOATS}/GPS.json
- sed -i "s~${OUMAP}~${UMAP}~g" ~/.zen/tmp/${MOATS}/GPS.json
- fi
+# GET ACTUAL GPS VALUES
+tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS'
- SECTOR="_${LAT::-1}_${LON::-1}" ### SECTOR = 0.1° Planet Slice in MadeInZion Tiddler
- echo "UPlanet 0.1° SECTOR : ${SECTOR}"
- sed -i "s~_SECTOR_~${SECTOR}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- ## Change myIP
- #~ sed -i "s~127.0.0.1~$myIP~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html # 8080 & 5001 BEING THE RECORDING GATEWAY (WAN or ipfs.localhost)
-
- ## TODATE #########################################
- TODATESECTORNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}")
- DEMAINSECTORNS=$(${MY_PATH}/../tools/keygen -t ipfs "${DEMAINDATE}${UPLANETNAME}${SECTOR}" "${DEMAINDATE}${UPLANETNAME}${SECTOR}")
+OLAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
+OLON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
+# REPLACE WITH NEW LAT LON UMAP
+sed -i "s~${OLAT}~${LAT}~g" ~/.zen/tmp/${MOATS}/GPS.json
+sed -i "s~${OLON}~${LON}~g" ~/.zen/tmp/${MOATS}/GPS.json
+## Add _SECTORTW_
+cat ~/.zen/tmp/${MOATS}/GPS.json | jq '.[0] + {"sectortw": "_SECTORTW_"}' \
+ > ~/.zen/tmp/${MOATS}/GPStw.json \
+ && mv ~/.zen/tmp/${MOATS}/GPStw.json ~/.zen/tmp/${MOATS}/GPS.json
###########
- ## GET OLD16
- tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'MIZ.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
- OLD16=$(cat ~/.zen/tmp/${MOATS}/MIZ.json | jq -r ".[].secret")
- [[ ${OLD16} == "" || ${OLD16} == "null" ]] && OLD16="_SECRET_"
+## GET OLD16
+tiddlywiki \
+ --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'MIZ.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
+OLD16=$(cat ~/.zen/tmp/${MOATS}/MIZ.json | jq -r ".[].secret")
+[[ ${OLD16} == "" || ${OLD16} == "null" ]] && OLD16="_SECRET_"
+echo "${OLD16}"
- ## USING SWARMKEY (derivated from IPFSNODE "/proc/cpuinfo" key made by _12345.sh) ## HARDWARE SPECIFIC KEY ##
- # TODO : NODE COULD FORGET PASS THEN DECODE ${PLAYER}/secret.dunikey FROM TW # PROD #
- MACHINEPUB=$(cat $HOME/.zen/game/myswarm_secret.dunikey | grep pub | cut -d ' ' -f 2)
- #~ echo "# CRYPTO ENCODING _SECRET_ "
- ${MY_PATH}/../tools/natools.py encrypt -p ${MACHINEPUB} -i $HOME/.zen/game/players/${PLAYER}/secret.dunikey -o $HOME/.zen/tmp/${MOATS}/secret.dunikey.$G1PUB.enc
- ENCODING=$(cat ~/.zen/tmp/${MOATS}/bafybeiewwxkmiojbskcqhbj2gbkde3czkeqftn6fgvwoa7ez5n5whido3qsecret.dunikey.$G1PUB.enc | base16)
- sed -i "s~${OLD16}~${ENCODING}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- # IN CASE ORIGINAL STATION NEEDS ACCESS # COULD BE REMOVED ?
-###########
- #~ echo "# CRYPTO DECODING TESTING..."
- tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
- cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r ".[].secret" | base16 -d > ~/.zen/tmp/${MOATS}/crypto.$G1PUB.enc.2
- ${MY_PATH}/../tools/natools.py decrypt -f pubsec -k $HOME/.zen/game/myswarm_secret.dunikey -i $HOME/.zen/tmp/${MOATS}/crypto.$G1PUB.enc.2 -o $HOME/.zen/tmp/${MOATS}/crypto.2
- #~ echo "DEBUG : $(cat $HOME/.zen/tmp/${MOATS}/crypto.2)"
-###########
- ## CRYPTO PROCESS VALIDATED
- [[ -s ~/.zen/tmp/${MOATS}/crypto.2 ]] && echo "NATOOLS LOADED STATION TW KEY " \
- || echo "NATOOLS ERRORS - CHECK STATION" # MACHINEPUB CRYPTO ERROR
+# TODO : MAKE NODE FORGET PASS THEN DECODE ${PLAYER}/secret.june FROM TW # PROD #
+MACHINEPUB=$(cat $HOME/.zen/game/myswarm_secret.dunikey | grep pub | cut -d ' ' -f 2)
+if [[ "${MACHINEPUB}" != "" ]]; then
+ #~ echo "# CRYPTO ENCODING PLAYER KEY WITH MACHINEPUB
+ ${MY_PATH}/../tools/natools.py encrypt \
+ -p ${MACHINEPUB} \
+ -i $HOME/.zen/game/players/${PLAYER}/secret.june \
+ -o $HOME/.zen/tmp/${MOATS}/secret.june.${G1PUB}.enc
+ ENCODING=$(cat ~/.zen/tmp/${MOATS}/secret.june.$G1PUB.enc | base16)
+ sed -i "s~${OLD16}~${ENCODING}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+ echo "ENCODING: ${ENCODING}"
+
+ # IN CASE ORIGINAL STATION NEEDS ACCESS # COULD BE REMOVED ?
+###########
+ #~ echo "# CRYPTO DECODING TESTING..."
+ tiddlywiki \
+ --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
+ --output ~/.zen/tmp/${MOATS} \
+ --render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
+
+ cat ~/.zen/tmp/${MOATS}/MadeInZion.json \
+ | jq -r ".[].secret" | base16 -d \
+ > ~/.zen/tmp/${MOATS}/crypto.$G1PUB.enc.2
+
+ ${MY_PATH}/../tools/natools.py decrypt \
+ -f pubsec \
+ -k $HOME/.zen/game/myswarm_secret.dunikey \
+ -i $HOME/.zen/tmp/${MOATS}/crypto.$G1PUB.enc.2 \
+ -o $HOME/.zen/tmp/${MOATS}/crypto.2
+ #~ echo "DEBUG : $(cat $HOME/.zen/tmp/${MOATS}/crypto.2)"
+###########
+ ## CRYPTO PROCESS VALIDATED
+ [[ -s ~/.zen/tmp/${MOATS}/crypto.2 ]] \
+ && echo "NATOOLS LOADED STATION TW KEY " \
+ || echo "NATOOLS ERRORS - CHECK STATION" # MACHINEPUB CRYPTO ERROR
+
+else
+ echo " - WARNING - MISSING ~/.zen/game/myswarm_secret.dunikey - WARNING -"
+fi
########### SECTOR = 0.1° UPLANET SLICE
- OSECTOR=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].sector)
- [[ ${OSECTOR} != "null" ]] && sed -i "s~${OSECTOR}~${SECTOR}~g" ~/.zen/tmp/${MOATS}/MadeInZion.json
+OSECTOR=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].sector)
+[[ ${OSECTOR} != "null" ]] && sed -i "s~${OSECTOR}~${SECTOR}~g" ~/.zen/tmp/${MOATS}/MadeInZion.json
- ### CREATE ${NID} ADDRESS FOR API & ROUND ROBIN FOR GW
- cat ${MY_PATH}/../templates/data/local.api.json | sed "s~_NID_~${WID}~g" > ~/.zen/tmp/${MOATS}/local.api.json
- cat ${MY_PATH}/../templates/data/local.gw.json | sed "s~_NID_~${NID}~g" > ~/.zen/tmp/${MOATS}/local.gw.json
+### CREATE ${NID} ADDRESS FOR API & ROUND ROBIN FOR GW
+cat ${MY_PATH}/../templates/data/local.api.json | sed "s~_NID_~${WID}~g" > ~/.zen/tmp/${MOATS}/local.api.json
+cat ${MY_PATH}/../templates/data/local.gw.json | sed "s~_NID_~${NID}~g" > ~/.zen/tmp/${MOATS}/local.gw.json
- # Create"${PLAYER}_feed" Key ! DERIVATED ! "$SALT" "$PEPPER $G1PUB"
- ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/feed.ipfskey "$SALT" "$PEPPER $G1PUB"
- FEEDNS=$(ipfs key import "${PLAYER}_feed" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/feed.ipfskey)
+# Create"${PLAYER}_feed" Key ! DERIVATED ! "$SALT" "$PEPPER $G1PUB"
+ipfs key rm "${PLAYER}_feed" 2>/dev/null
+${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/feed.ipfskey "$SALT" "$PEPPER $G1PUB"
+FEEDNS=$(ipfs key import "${PLAYER}_feed" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/feed.ipfskey)
- ## MAKE LightBeam Plugin Tiddler ${PLAYER}_feed
- # $:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key
- echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_feed'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
- echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key","text":"'${FEEDNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
+## MAKE LightBeam Plugin Tiddler ${PLAYER}_feed
+# $:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key
+echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_feed'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
+echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key","text":"'${FEEDNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
- ## NATOOLS ENCRYPT
- #~ echo "# NATOOLS ENCODING MYSELF feed.ipfskey (TODO: could be decoded to compare with G1lib.js) "
- ${MY_PATH}/../tools/natools.py encrypt -p $G1PUB -i $HOME/.zen/tmp/${MOATS}/feed.ipfskey -o $HOME/.zen/tmp/${MOATS}/feed.ipfskey.$G1PUB.enc
- ENCODING=$(cat $HOME/.zen/tmp/${MOATS}/feed.ipfskey.$G1PUB.enc | base16)
- #~ echo ${ENCODING}
- echo '[{"title":"$:/plugins/astroport/lightbeams/saver/g1/lightbeam-natools-feed","text":"'${ENCODING}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-natools.json
+ ## ADD SYSTEM TW
+tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
+ --import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/local.api.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/local.gw.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/GPS.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/AstroID.json "application/json" \
+ --import ~/.zen/tmp/${MOATS}/MadeInZion.json "application/json" \
+--import "${MY_PATH}/../templates/tw/\$ _ipfs_saver_api.json" "application/json" \
+--import "${MY_PATH}/../templates/tw/\$ _ipfs_saver_gateway.json" "application/json" \
+ --output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "tw.html" "text/plain"
- #~ echo
- #~ echo "IPFS GATEWAY : ${NID}"
- # cat ~/.zen/tmp/${MOATS}/local.gw.json | jq -r
- #~ echo "IPFS API : ${WID}"
- # cat ~/.zen/tmp/${MOATS}/local.api.json | jq -r
- #~ echo ">>> RSS FEED : ${myIPFS}/ipns/${FEEDNS}"
- #~ ## CHANGE SELECTED GW & API
-
- ## ADD SYSTEM TW
- tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
- --import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/lightbeam-natools.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/local.api.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/local.gw.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/GPS.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/AstroID.json "application/json" \
- --import ~/.zen/tmp/${MOATS}/MadeInZion.json "application/json" \
- --import "${MY_PATH}/../templates/tw/\$ _ipfs_saver_api.json" "application/json" \
- --import "${MY_PATH}/../templates/tw/\$ _ipfs_saver_gateway.json" "application/json" \
- --output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "tw.html" "text/plain"
-
- ## COPY TO LOCAL & 12345 IPFSNODEID MAP
- [[ -s ~/.zen/tmp/${MOATS}/tw.html ]] \
- && cp -f ~/.zen/tmp/${MOATS}/tw.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
- && mkdir -p ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} \
- && cp ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/ \
- || ( echo "Problem with TW - EXIT" && exit 1 )
+ ## COPY TO LOCAL & 12345 IPFSNODEID MAP
+ [[ -s ~/.zen/tmp/${MOATS}/tw.html ]] \
+ && cp -f ~/.zen/tmp/${MOATS}/tw.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
+ && mkdir -p ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} \
+ && cp ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/ \
+ || ( echo "Problem with TW - EXIT" && exit 1 )
############################################################################ G1TW
#### MAKE G1TW
- [[ -s ~/.zen/G1BILLET/MAKE_G1BILLET.sh ]] && \
- ~/.zen/G1BILLET/MAKE_G1BILLET.sh "$SALT" "$PEPPER" "___" "$G1PUB" "${PASS}" "${PSEUDO-xastro}" "$ASTRONAUTENS" "$PLAYER"
+ [[ -s ~/.zen/G1BILLET/MAKE_G1BILLET.sh ]] && \
+ ~/.zen/G1BILLET/MAKE_G1BILLET.sh "$SALT" "$PEPPER" "___" "$G1PUB" "${PASS}" "${PSEUDO-xastro}" "$ASTRONAUTENS" "$PLAYER"
#### MADE # BILLETNAME=$(echo "$SALT" | sed 's/ /_/g') ##
# IMAGE ~/.zen/G1BILLET/tmp/g1billet/${PASS}/${BILLETNAME}.BILLET.jpg
############################################################################
- ## MAKE IMAGE AVATAR WITH G1PUB QRCODE
- if [[ $(which amzqr) ]]; then
+ ## MAKE IMAGE AVATAR WITH G1PUB QRCODE
+ if [[ $(which amzqr) ]]; then
- GIMG="${MY_PATH}/../images/moa_net.png"
- CIMG="${MY_PATH}/../images/zenticket.png"
+ GIMG="${MY_PATH}/../images/moa_net.png"
+ CIMG="${MY_PATH}/../images/zenticket.png"
- # QRG1avatar.png
- [[ ! -s ~/.zen/game/players/${PLAYER}/QRG1avatar.png ]] && amzqr "${G1PUB}" -l H -p "$CIMG" -c -n QRG1avatar.png -d ~/.zen/game/players/${PLAYER}/ 1>/dev/null
- # QRTWavatar.png
- [[ ! -s ~/.zen/game/players/${PLAYER}/QRTWavatar.png ]] && amzqr "${myIPFSGW}/ipns/${ASTRONAUTENS}" -l H -p "$GIMG" -c -n QRTWavatar.png -d ~/.zen/game/players/${PLAYER}/ 1>/dev/null
+ # QRG1avatar.png
+ [[ ! -s ~/.zen/game/players/${PLAYER}/QRG1avatar.png ]] && amzqr "${G1PUB}" -l H -p "$CIMG" -c -n QRG1avatar.png -d ~/.zen/game/players/${PLAYER}/ 1>/dev/null
+ # QRTWavatar.png
+ [[ ! -s ~/.zen/game/players/${PLAYER}/QRTWavatar.png ]] && amzqr "${myIPFSGW}/ipns/${ASTRONAUTENS}" -l H -p "$GIMG" -c -n QRTWavatar.png -d ~/.zen/game/players/${PLAYER}/ 1>/dev/null
- else
+ else
- [[ ! -s ~/.zen/game/players/${PLAYER}/QRG1avatar.png ]] \
- && cp ~/.zen/game/players/${PLAYER}/QR.png ~/.zen/game/players/${PLAYER}/QRG1avatar.png
+ [[ ! -s ~/.zen/game/players/${PLAYER}/QRG1avatar.png ]] \
+ && cp ~/.zen/game/players/${PLAYER}/QR.png ~/.zen/game/players/${PLAYER}/QRG1avatar.png
- [[ ! -s ~/.zen/game/players/${PLAYER}/QRTWavatar.png ]] \
- && cp ~/.zen/game/players/${PLAYER}/QR.ASTRONAUTENS.png ~/.zen/game/players/${PLAYER}/QRTWavatar.png
+ [[ ! -s ~/.zen/game/players/${PLAYER}/QRTWavatar.png ]] \
+ && cp ~/.zen/game/players/${PLAYER}/QR.ASTRONAUTENS.png ~/.zen/game/players/${PLAYER}/QRTWavatar.png
- fi
+ fi
- ## ID CARD & QRCODE
- convert ~/.zen/game/players/${PLAYER}/QRG1avatar.png -resize 300 ~/.zen/tmp/${MOATS}/QR.png 2>/dev/null
- convert ~/.zen/game/players/${PLAYER}/QRTWavatar.png -resize 240 ~/.zen/tmp/${MOATS}/TW.png 2>/dev/null
- convert ${MY_PATH}/../images/astroport.jpg -resize 240 ~/.zen/tmp/${MOATS}/ASTROPORT.png 2>/dev/null
+ ## ID CARD & QRCODE
+ convert ~/.zen/game/players/${PLAYER}/QRG1avatar.png -resize 300 ~/.zen/tmp/${MOATS}/QR.png 2>/dev/null
+ convert ~/.zen/game/players/${PLAYER}/QRTWavatar.png -resize 240 ~/.zen/tmp/${MOATS}/TW.png 2>/dev/null
+ convert ${MY_PATH}/../images/astroport.jpg -resize 240 ~/.zen/tmp/${MOATS}/ASTROPORT.png 2>/dev/null
- composite -compose Over -gravity SouthEast -geometry +5+5 ~/.zen/tmp/${MOATS}/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/${MOATS}/astroport.png 2>/dev/null
- composite -compose Over -gravity NorthEast -geometry +10+55 ~/.zen/tmp/${MOATS}/TW.png ~/.zen/tmp/${MOATS}/astroport.png ~/.zen/tmp/${MOATS}/astroport2.png 2>/dev/null
- composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/${MOATS}/QR.png ~/.zen/tmp/${MOATS}/astroport2.png ~/.zen/tmp/${MOATS}/one.png 2>/dev/null
- convert -gravity SouthWest -pointsize 12 -fill black -draw "text 5,3 \"$G1PUB\"" ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/txt.png
+ composite -compose Over -gravity SouthEast -geometry +5+5 ~/.zen/tmp/${MOATS}/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/${MOATS}/astroport.png 2>/dev/null
+ composite -compose Over -gravity NorthEast -geometry +10+55 ~/.zen/tmp/${MOATS}/TW.png ~/.zen/tmp/${MOATS}/astroport.png ~/.zen/tmp/${MOATS}/astroport2.png 2>/dev/null
+ composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/${MOATS}/QR.png ~/.zen/tmp/${MOATS}/astroport2.png ~/.zen/tmp/${MOATS}/one.png 2>/dev/null
+ convert -gravity SouthWest -pointsize 12 -fill black -draw "text 5,3 \"$G1PUB\"" ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/txt.png
- # composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/image.png
+ # composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/image.png
- convert -gravity northwest -pointsize 25 -fill black -draw "text 50,300 \"$PSEUDO\"" ~/.zen/tmp/${MOATS}/txt.png ~/.zen/tmp/${MOATS}/image.png
- convert -gravity northwest -pointsize 20 -fill black -draw "text 300,40 \"${PLAYER}\"" ~/.zen/tmp/${MOATS}/image.png ~/.zen/tmp/${MOATS}/pseudo.png
+ convert -gravity northwest -pointsize 25 -fill black -draw "text 50,300 \"$PSEUDO\"" ~/.zen/tmp/${MOATS}/txt.png ~/.zen/tmp/${MOATS}/image.png
+ convert -gravity northwest -pointsize 20 -fill black -draw "text 300,40 \"${PLAYER}\"" ~/.zen/tmp/${MOATS}/image.png ~/.zen/tmp/${MOATS}/pseudo.png
- ## WITH CONFIDENTIAL (LOCAL PRINT)
- convert -gravity northeast -pointsize 25 -fill black -draw "text 20,180 \"$PASS\"" ~/.zen/tmp/${MOATS}/pseudo.png ~/.zen/tmp/${MOATS}/pass.png
- convert -gravity northwest -pointsize 25 -fill black -draw "text 300,100 \"$SALT\"" ~/.zen/tmp/${MOATS}/pass.png ~/.zen/tmp/${MOATS}/salt.png
- convert -gravity northwest -pointsize 25 -fill black -draw "text 300,140 \"$PEPPER\"" ~/.zen/tmp/${MOATS}/salt.png ~/.zen/game/players/${PLAYER}/ID.png
+ ## WITH CONFIDENTIAL (LOCAL PRINT)
+ convert -gravity northeast -pointsize 25 -fill black -draw "text 20,180 \"$PASS\"" ~/.zen/tmp/${MOATS}/pseudo.png ~/.zen/tmp/${MOATS}/pass.png
+ convert -gravity northwest -pointsize 25 -fill black -draw "text 300,100 \"$SALT\"" ~/.zen/tmp/${MOATS}/pass.png ~/.zen/tmp/${MOATS}/salt.png
+ convert -gravity northwest -pointsize 25 -fill black -draw "text 300,140 \"$PEPPER\"" ~/.zen/tmp/${MOATS}/salt.png ~/.zen/game/players/${PLAYER}/ID.png
- # INSERTED IMAGE IPFS
- # IASTRO=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ID.png | tail -n 1) ## ZENCARD PUBLIC / PRIVATE
- IASTRO="/ipfs/$(ipfs add -Hq ~/.zen/tmp/${MOATS}/pseudo.png | tail -n 1)" ## ZENCARD PUBLIC ONLY
+ # INSERTED IMAGE IPFS
+ # IASTRO=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ID.png | tail -n 1) ## ZENCARD PUBLIC / PRIVATE
+ IASTRO="/ipfs/$(ipfs add -Hq ~/.zen/tmp/${MOATS}/pseudo.png | tail -n 1)" ## ZENCARD PUBLIC ONLY
- ## Update ZenCard
- [[ ! $ZenCard ]] && ZenCard="/ipfs/bafybeidhghlcx3zdzdah2pzddhoicywmydintj4mosgtygr6f2dlfwmg7a"
- sed -i "s~${ZenCard}~${IASTRO}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
+ ## Update ZenCard
+ [[ ! $ZenCard ]] && ZenCard="/ipfs/bafybeidhghlcx3zdzdah2pzddhoicywmydintj4mosgtygr6f2dlfwmg7a"
+ sed -i "s~${ZenCard}~${IASTRO}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
- echo
- echo "♥ IPFS Ŋ1 TW INIT ♥"
- echo "TW ${NID}/ipns/${ASTRONAUTENS}/"
- IPUSH=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html | tail -n 1)
- echo $IPUSH > ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain # Contains last IPFS backup PLAYER KEY
- echo $MOATS > ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats
+echo
+echo "♥ IPFS Ŋ1 TW INIT ♥"
+echo "TW ${NID}/ipns/${ASTRONAUTENS}/"
+IPUSH=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html | tail -n 1)
+echo $IPUSH > ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain # Contains last IPFS backup PLAYER KEY
+echo $MOATS > ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats
- (
- #~ echo "$MOATS :: /ipfs/$IPUSH"
- ipfs name publish --key=${PLAYER} /ipfs/$IPUSH
- #~ echo "TW PUBLISHING DONE"
- ) &
+(
+ #~ echo "$MOATS :: /ipfs/$IPUSH"
+ ipfs name publish --key=${PLAYER} /ipfs/$IPUSH
+ #~ echo "TW PUBLISHING DONE"
+) &
- ## MEMORISE PLAYER Ŋ1 ZONE
- echo "${PLAYER}" > ~/.zen/game/players/${PLAYER}/.player
- echo "$PSEUDO" > ~/.zen/game/players/${PLAYER}/.pseudo
- echo "$G1PUB" > ~/.zen/game/players/${PLAYER}/.g1pub
+## MEMORISE PLAYER Ŋ1 ZONE
+echo "${PLAYER}" > ~/.zen/game/players/${PLAYER}/.player
+echo "$PSEUDO" > ~/.zen/game/players/${PLAYER}/.pseudo
+echo "$G1PUB" > ~/.zen/game/players/${PLAYER}/.g1pub
- echo "${ASTRONAUTENS}" > ~/.zen/game/players/${PLAYER}/.playerns
-
- echo "SALT=\"$SALT\"" > ~/.zen/game/players/${PLAYER}/secret.june
- echo "PEPPER=\"$PEPPER\"" >> ~/.zen/game/players/${PLAYER}/secret.june
+echo "${ASTRONAUTENS}" > ~/.zen/game/players/${PLAYER}/.playerns
#~ echo; echo "Création Clefs et QR codes pour accès au niveau Astroport Ŋ1"; sleep 1
@@ -484,9 +473,10 @@ echo "--- PLAYER : ${PLAYER} - DATA PROTOCOL LAYER LOADED";
[[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]] && xdg-open "${myIPFS}/ipns/${ASTRONAUTENS}" && espeak "YOUR PASS IS $PASS"
-################# PREPARE DOCKERIZATION
-#~ [[ -l ~/.zen/game/players/.current ]] \
-#~ && ln -s ~/.zen/game/players/${PLAYER} ~/.zen/game/players/.current
+####### NO CURRENT ? PLAYER = .current
+[[ ! -e ~/.zen/game/players/.current ]] \
+ && rm ~/.zen/game/players/.current 2>/dev/null \
+ && ln -s ~/.zen/game/players/${PLAYER} ~/.zen/game/players/.current
. "${MY_PATH}/../tools/my.sh"
@@ -528,8 +518,7 @@ echo " "
echo "* AstroID : with PASS : $PASS"
echo "${NID}/ipns/${ASTRONAUTENS}#AstroID"
echo
-echo "* UMap : registration at ${LAT}, ${LON}
-${myIPFS}${URL}"
+echo "* UMap : registration at ${LAT}, ${LON}"
echo
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo ""
@@ -550,7 +539,11 @@ echo "
}
-UPlanet : ZenCard + TW
" > ~/.zen/tmp/${MOATS}/ZenCard.html
+UPlanet : TW
" > ~/.zen/tmp/${MOATS}/ZenCard.html
+
+echo "
+
" >> ~/.zen/tmp/${MOATS}/ZenCard.html
+
asciiart="${MY_PATH}/../images/astroport.art"
while IFS= read -r line
do
@@ -558,9 +551,7 @@ do
echo "
" >> ~/.zen/tmp/${MOATS}/ZenCard.html
done <"$asciiart"
-echo "
-
-" >> ~/.zen/tmp/${MOATS}/ZenCard.html
+echo "