Merge branch 'papiche:master' into master

This commit is contained in:
Jean-bouger 2024-03-01 16:29:57 +01:00 committed by GitHub
commit 8d5bb0de98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
100 changed files with 241266 additions and 499 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -86,12 +86,15 @@ while true; do
myHtml >> ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http
## REPLACE RESPONSE PORT
sed -i -e "s~http://127.0.0.1:12345~http://${myIP}:${PORT}~g" \
sed -i -e "s~http://127.0.0.1:12345~http://127.0.0.1:${PORT}~g" \
~/.zen/tmp/${MOATS}/${PORT}.myHOST.http
## WAN REDIRECT TO HTTPS:// + /${PORT}
[ -z "$isLAN" ] \
&& sed -i -e "s~http://${myIP}:${PORT}~${myASTROPORT}/${PORT}~g" ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http
&& sed -i -e "s~http://127.0.0.1:${PORT}~${myASTROPORT}/${PORT}~g" ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http
[ -n "$(zIp)" ]\
&& sed -i -e "s~http://127.0.0.1:${PORT}~$(zIp):${PORT}~g" ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http
## UPLANET HOME LINK REPLACEMENT
sed -i -e "s~https://qo-op.com~${myUPLANET}~g" ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http

View File

@ -27,9 +27,6 @@ while [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]]; do
&& exit 1
done
## PING BOOSTRAP & SWARM NODES
${MY_PATH}/ping_bootstrap.sh
# show ZONE.sh cache of the day
echo "TODAY UPlanet landings"
ls ~/.zen/tmp/ZONE_* 2>/dev/null
@ -57,8 +54,12 @@ git pull
${MY_PATH}/youtube-dl.sh
sudo youtube-dl -U
## DRAGON SSH WOT
echo "DRAGONS WOT OFF"
${MY_PATH}/RUNTIME/DRAGON_p2p_ssh.sh off
## PING BOOSTRAP & SWARM NODES
${MY_PATH}/ping_bootstrap.sh
${MY_PATH}/ping_bootstrap.sh > /dev/null 2>&1
#####################################
# espeak "Players refresh" > /dev/null 2>&1
@ -99,16 +100,14 @@ seconds=$((dur % 60))
echo "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds"
echo "20H12 (♥‿‿♥) Execution time was $dur seconds."
## DRAGON SSH WOT
echo "DRAGONS WOT OFF"
${MY_PATH}/RUNTIME/DRAGON_p2p_ssh.sh off
## RESTART
## MAIL LOG : support@qo-op.com ##
${MY_PATH}/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" "20H12"
espeak "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds" > /dev/null 2>&1
## RESTART
# espeak "Restarting Astroport Services" > /dev/null 2>&1
## CLOSING API PORT
[[ -s ~/.zen/.pid ]] && kill -9 $(cat ~/.zen/.pid) > /dev/null 2>&1

79
API/DRAGONS.sh Executable file
View File

@ -0,0 +1,79 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
################################################################################
## API: DRAGONS
## Used by OSM2IPFS welcome.html
# ?zone=DEG&ulat=LAT&ulon=LON
## Search for TW numbers in received zone # >> return json
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
start=`date +%s`
echo "PORT=$1
THAT=$2
AND=$3
THIS=$4
APPNAME=$5
WHAT=$6
OBJ=$7
VAL=$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"
### transfer variables according to script
[[ $MOATS == "" ]] && echo "MISSING MOATS" && exit 1
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET
Server: Astroport.ONE
Content-Type: text/html; charset=UTF-8
"
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
# PREPARE HTTP RESPONSE (application/json)
mkdir -p ~/.zen/tmp/${MOATS}/
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}/http
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}/http
# ------------------------------------------------------------------- #
# GET/?dragons
# ------------------------------------------------------------------- #
## RUNNING UPLANET STATIONS GPS DETECTION
rm ~/.zen/tmp/DRAGONS.json
if [[ ! -s ~/.zen/tmp/DRAGONS.json ]]; then
echo " ## cat ***/GPS.json"
cat ~/.zen/tmp/${IPFSNODEID}/GPS.json 2>/dev/null | jq -c '.[] + {ipfsnodeid: "'$IPFSNODEID'"}' > ~/.zen/tmp/${MOATS}/gps.grid
cat ~/.zen/tmp/swarm/12D*/GPS.json 2>/dev/null | jq -c '.[] + {ipfsnodeid: "'$IPFSNODEID'"}' | sort -u >> ~/.zen/tmp/${MOATS}/gps.grid
cat ~/.zen/tmp/${MOATS}/gps.grid | jq -s '.' | sed -e 's/\[/[/' -e 's/\]/]/' -e 's/},{/},\n{/g' > ~/.zen/tmp/DRAGONS.json
fi
#~ jq 'unique_by(.umap)' ~/.zen/tmp/DRAGONS.json > ~/.zen/tmp/DRAGONS_no_duplicates.json
#~ mv ~/.zen/tmp/DRAGONS_no_duplicates.json ~/.zen/tmp/DRAGONS.json
echo " ***** WELCOME DRAGONS =========== "
cat ~/.zen/tmp/DRAGONS.json
### SEND RESPONSE ON PORT
cat ~/.zen/tmp/DRAGONS.json >> ~/.zen/tmp/${MOATS}/http
(
cat ~/.zen/tmp/${MOATS}/http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
rm -Rf ~/.zen/tmp/${MOATS} && echo "BLURP DRAGONS.json"
) &
## TIMING
end=`date +%s`
echo "(DRAGONS) Operation time was "`expr $end - $start` seconds.
exit 0

View File

@ -102,9 +102,13 @@ if [[ ${QRCODE} == "station" ]]; then
ISTATION=$(cat ~/.zen/tmp/ISTATION)
fi
## LOG IPFSNODEID : IPCity + Wheater + more...
${MY_PATH}/../tools/IPFSNODEID.weather.sh > ~/.zen/tmp/${IPFSNODEID}/weather.txt
echo "<meta http-equiv=\"refresh\" content=\"0; url='${ISTATION}'\" />" > ~/.zen/tmp/${IPFSNODEID}/_index.html
## SHOW ZenStation FRONT
sed "s~_STATION_~${myIPFS}${ISTATION}/~g" $MY_PATH/../templates/ZenStation/index.html > ~/.zen/tmp/${MOATS}/index.htm
[[ ! $isLAN ]] && sed -i "s~MENU~HOSTING~g" ~/.zen/tmp/${MOATS}/index.htm
sed -i "s~2L8vaYixCf97DMT8SistvQFeBj7vb6RQL7tvwyiv1XVH~${WORLDG1PUB}~g" ~/.zen/tmp/${MOATS}/index.htm
sed -i "s~http://127.0.0.1:8080~${myIPFS}~g" ~/.zen/tmp/${MOATS}/index.htm
sed -i "s~http://127.0.0.1:33101~${myG1BILLET}~g" ~/.zen/tmp/${MOATS}/index.htm
sed -i "s~http://astroport.localhost:1234~${myASTROPORT}~g" ~/.zen/tmp/${MOATS}/index.htm
@ -491,7 +495,7 @@ if [[ ${QRCODE:0:5} == "@@@@@" ]]; then
&& ipfs name publish -k ${player}_${VoeuName} /ipfs/${MILGRAM} &
) &
echo "<br>PLEASE RETRY IN 30 SECONDS GETTING MESSAGE FROM IPFS<br>" >> ~/.zen/tmp/${MOATS}/disco
echo "<br>PLEASE RETRY IN 30 SECONDS GETTING MESSAGE FROM IPFS<bipfsr>" >> ~/.zen/tmp/${MOATS}/disco
(
cat ~/.zen/tmp/${MOATS}/disco | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
@ -609,7 +613,7 @@ if [[ ${QRCODE:0:2} == "G1" && ${AND} == "tw" ]]; then
##############################################
echo "## IPNS G1Voeu APP REDIRECT"
tiddlywiki --load ${INDEX} --output ~/.zen/tmp --render '.' "${MOATS}.g1voeu.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1Voeu]]'
cat ~/.zen/tmp/${MOATS}.g1voeu.json | jq -r '.[].wish' > ~/.zen/tmp/${MOATS}.g1wishes.txt
cat ~/.zen/tmp/${MOATS}.g1voeu.json | jq -r 'map(select(.wish != null)) | .[].wish' > ~/.zen/tmp/${MOATS}.g1wishes.txt
cat ~/.zen/tmp/${MOATS}.g1wishes.txt
while read WISH
do
@ -646,6 +650,7 @@ fi
################################################################################
## QRCODE = IPNS or G1PUB ? Can be ASTRONAUTENS or G1PUB format
ZCHK="$(echo $THAT | cut -d ':' -f 2-)" # ChK or ZEN
[[ $ZCHK == $THAT ]] && ZCHK=""
QRCODE="${QRCODE%%:*}" ## TRIM :ChK
################################################################################
################################################################################
@ -655,7 +660,7 @@ echo "IPNS2G1=${IPNS2G1} ZCHK=${ZCHK}"
[[ ${ZCHK} == "" && ${#IPNS2G1} -ge 40 && ${QRCODE::4} == "12D3" ]] \
&& echo "${PORT} QRCODE IS IPNS ADDRESS : ${myIPFS}/ipns/${QRCODE}" \
&& (echo "$HTTPCORS <meta http-equiv=\"refresh\" content=\"0; url='${myIPFS}/ipns/${QRCODE}'\" />Loading from IPFS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& echo "PRULS /ipns/${QRCODE} $PORT" && rm -Rf ~/.zen/tmp/${MOATS} \
&& echo "GLUPS /ipns/${QRCODE} $PORT" && rm -Rf ~/.zen/tmp/${MOATS} \
&& exit 0
## TEST G1 TYPE ( try g1_to_ipfs )
@ -663,7 +668,7 @@ ASTROTOIPNS=$(${MY_PATH}/../tools/g1_to_ipfs.py ${QRCODE} 2>/dev/null)
[[ ! ${ASTROTOIPNS} ]] \
&& echo "${PORT} INVALID QRCODE : ${QRCODE}" \
&& (echo "$HTTPCORS ERROR - INVALID QRCODE : ${QRCODE}" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& echo "PRULS INVALID ${QRCODE} $PORT" && rm -Rf ~/.zen/tmp/${MOATS} \
&& echo "GLUPS INVALID ${QRCODE} $PORT" && rm -Rf ~/.zen/tmp/${MOATS} \
&& exit 1
################################################################################
echo "############################################################################"
@ -678,29 +683,23 @@ echo ">>> ${QRCODE} g1_to_ipfs $ASTROTOIPNS"
&& ZEN=$(echo "($VISITORCOINS - 1) * 10" | bc | cut -d '.' -f 1) \
|| ZEN="-10"
DISPLAY="$VISITORCOINS G1"
DISPLAY="<h1>$VISITORCOINS G1</h1>"
## WALLET VIERGE
###########################################
if [[ $VISITORCOINS == "null" || ${ZEN} -lt 10 ]]; then
echo "!! LOW ZEN WALLET ZEN=${ZEN}"
DISPLAY="$DISPLAY
<h2>!! LOW ZEN WALLET ZEN=${ZEN}<h2>"
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}/index.redirect
echo "<h1>LOW ZEN WARNING</h1>
PLEASE CHARGE... only ${ZEN} ZEN
" >> ~/.zen/tmp/${MOATS}/index.redirect
(
cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP null ZEN $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &
exit 0
DISPLAY="$DISPLAY<h3>LOW ZEN WARNING</h3>
PLEASE CHARGE... ${ZEN} ZEN"
fi
## WE SEND WALLET AMOUNT DISPLAY
(
echo "$HTTPCORS <h2>${ZCHK}:${QRCODE}</h2><h1>${DISPLAY}</h1><h2><a href='$myUPLANET/g1gate/?pubkey=$G1PUB'>SCAN WALLET</a><h2>" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "$HTTPCORS ${QRCODE}:${ZCHK}:${DISPLAY}<h2><a href='$myUPLANET/g1gate/?pubkey="$QRCODE"'>SCAN WALLET</a><h2>" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP ${DISPLAY} $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &

View File

@ -111,9 +111,9 @@ if [[ ! -s ~/.zen/tmp/${JSON} ]]; then
UMAPNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${UMAP}.priv)
echo '{ "gridNumbers": [ {"lat": '${LAT}', "lon": '${LON}', "number": "(_'${LAT}'_'${LON}') = '${totnum}'", "ipns": "'${myIPFS}/ipns/${UMAPNS}/_index.html'" } ] }' \
> ~/.zen/tmp/${MOATS}.http.grid
> ~/.zen/tmp/${MOATS}/http.grid
cp ~/.zen/tmp/${MOATS}.http.grid ~/.zen/tmp/${JSON}
cp ~/.zen/tmp/${MOATS}/http.grid ~/.zen/tmp/${JSON}
cat ~/.zen/tmp/${JSON} >> ~/.zen/tmp/${MOATS}.http
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
@ -127,44 +127,51 @@ if [[ ! -s ~/.zen/tmp/${JSON} ]]; then
##############################################
## SEARCH FOR UPLANET TW NUMBERS IN THAT ZONE
echo '{ "gridNumbers": [' >> ~/.zen/tmp/${MOATS}.http.grid
echo '{ "gridNumbers": [' >> ~/.zen/tmp/${MOATS}/http.grid
for i in $(seq 0 9);
do
ZLAT=$(echo "$LAT + ${DEG} * $i" | bc -l )
ZLAT=$(echo "$LAT + ${DEG} * $i" | bc -l)
[[ -z ${ZLAT} ]] && ZLAT=0
# [[ ! $(echo $ZLAT | grep "\." ) ]] && ZLAT="${ZLAT}."
for j in $(seq 0 9); do
ZLON=$(echo "$LON + ${DEG} * $j" | bc -l )
[[ -z ${ZLON} ]] && ZLON=0
# [[ ! $(echo $ZLON | grep "\." ) ]] && ZLON="${ZLON}."
echo " ## SEARCH UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*"
swarmnum=$(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
nodenum=$(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
totnum=$(( swarmnum + nodenum ))
[[ $totnum -gt 9 ]] && displaynum="X" || displaynum=$totnum
for j in $(seq 0 9); do
[[ $displaynum != "0" ]] && echo '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${displaynum}'", "ipns": "'${ZONEINDEX}'" }
,' >> ~/.zen/tmp/${MOATS}.http.grid \
&& echo "${DEG} :" '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${totnum}'", "ipns": "'${ZONEINDEX}'" }'
ZLON=$(echo "$LON + ${DEG} * $j" | bc -l)
[[ -z ${ZLON} ]] && ZLON=0
echo " ## SEARCH UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*"
swarmnum=$(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
nodenum=$(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
totnum=$(( swarmnum + nodenum ))
[[ $totnum -gt 9 ]] && displaynum="X" || displaynum=$totnum
[[ $displaynum != "0" ]] && echo '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${displaynum}'", "ipns": "'${ZONEINDEX}'" }
,' >> ~/.zen/tmp/${MOATS}/http.grid \
&& echo "${DEG} :" '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${totnum}'", "ipns": "'${ZONEINDEX}'" }'
done
done
done
sed -i '$ d' ~/.zen/tmp/${MOATS}.http.grid ## REMOVE LAST ','
echo ']}' >> ~/.zen/tmp/${MOATS}.http.grid
[[ ! $(cat ~/.zen/tmp/${MOATS}/http.grid | tail -n 1 | grep 'gridNumbers' ) ]] \
&& sed -i '$ d' ~/.zen/tmp/${MOATS}/http.grid ## REMOVE LAST ','
echo ']}' >> ~/.zen/tmp/${MOATS}/http.grid
echo "## ADD TO CACHE ~/.zen/tmp/${JSON}"
cp ~/.zen/tmp/${MOATS}.http.grid ~/.zen/tmp/${JSON}
cp ~/.zen/tmp/${MOATS}/http.grid ~/.zen/tmp/${JSON}
fi
cat ~/.zen/tmp/${JSON} | jq -c
### SEND RESPONSE ON PORT
cat ~/.zen/tmp/${JSON} >> ~/.zen/tmp/${MOATS}.http
(
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
rm ~/.zen/tmp/${MOATS}.http.grid 2>/dev/null
rm ~/.zen/tmp/${MOATS}/http.grid 2>/dev/null
rm ~/.zen/tmp/${MOATS}.http && echo "BLURP ${JSON}"
) &
## CLEANING

46
APY/addfile.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
# Usage: bash addfile.sh <filename> <mime_type> <file_type>
filename="$1"
mime_type="$2"
file_type="$3"
echo "Processing file: $filename"
echo "MIME type: $mime_type"
echo "File type: $file_type"
# Check file type and perform corresponding treatment
case $file_type in
"video")
if [[ $mime_type == *"video"* ]]; then
# Video processing logic
echo "Video processing..."
# Add more processing steps as needed
else
echo "Invalid file type for video processing"
fi
;;
"audio")
if [[ $mime_type == *"audio"* ]]; then
# Audio processing logic
echo "Audio processing..."
# Add more processing steps as needed
else
echo "Invalid file type for audio processing"
fi
;;
"text")
if [[ $mime_type == *"text"* ]]; then
# Text processing logic
echo "Text processing..."
# Add more processing steps as needed
else
echo "Invalid file type for text processing"
fi
;;
*)
echo "Unknown file type: $file_type"
;;
esac
echo "File processing complete."

170
APY/upload_video.10101.py Executable file
View File

@ -0,0 +1,170 @@
#!/usr/bin/python3
from fastapi import FastAPI, File, UploadFile, Form, HTTPException
from fastapi.responses import HTMLResponse, JSONResponse
import subprocess
import os
import magic
app = FastAPI()
# HTML form for file upload
html_form = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>File Upload and Processing</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f5f5f5;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
#upload-container {
background-color: #ffffff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
padding: 20px;
border-radius: 8px;
text-align: center;
}
h1 {
color: #333333;
}
form {
margin-top: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
input[type="file"] {
margin-bottom: 10px;
}
input[type="button"] {
background-color: #4caf50;
color: white;
border: none;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
border-radius: 4px;
}
#result-container {
margin-top: 20px;
}
#loading-indicator {
display: none;
margin-top: 20px;
}
</style>
</head>
<body>
<div id="upload-container">
<h1>File Upload and Processing</h1>
<form id="upload-form" enctype="multipart/form-data" method="post">
<input type="file" id="file" accept="video/*,audio/*,text/*" required>
<br>
<label for="convert_to">Choose file type:</label>
<input type="radio" id="video" name="convert_to" value="video" checked>
<label for="video">Video</label>
<input type="radio" id="audio" name="convert_to" value="audio">
<label for="audio">Audio</label>
<input type="radio" id="text" name="convert_to" value="text">
<label for="text">Text</label>
<br>
<input type="button" value="Upload" onclick="uploadFile()">
<div id="loading-indicator">Loading...</div>
</form>
<div id="result-container"></div>
</div>
<script>
async function uploadFile() {
const fileInput = document.getElementById('file');
const file = fileInput.files[0];
const fileType = document.querySelector('input[name="convert_to"]:checked').value;
const formData = new FormData();
formData.append('file', file);
formData.append('convert_to', fileType);
// Show loading indicator
const loadingIndicator = document.getElementById('loading-indicator');
loadingIndicator.style.display = 'block';
try {
const response = await fetch('/upload', {
method: 'POST',
body: formData
});
const result = await response.json();
document.getElementById('result-container').innerHTML = JSON.stringify(result, null, 2);
} catch (error) {
console.error('Error uploading file:', error);
} finally {
// Hide loading indicator after response or error
loadingIndicator.style.display = 'none';
}
}
</script>
</body>
</html>
"""
@app.get("/")
async def read_root():
return HTMLResponse(content=html_form, status_code=200)
def get_mime_type(file: UploadFile):
mime = magic.Magic()
mime_type = mime.from_buffer(file.file.read(1024))
return mime_type
@app.post("/upload")
async def create_upload_file(file: UploadFile = File(...), convert_to: str = Form(...)):
# Validate file size
max_file_size = 100 * 1024 * 1024 # 100MB
if file.file.__sizeof__() > max_file_size:
raise HTTPException(status_code=400, detail="File size exceeds the limit of 100MB")
# Check the file type
mime_type = get_mime_type(file)
print(f"Detected MIME type: {mime_type}")
# Save the uploaded file to a temporary location
with open(file.filename, "wb") as f:
f.write(file.file.read())
# Continue with the processing logic
# Run the post-treatment Bash script
logs = subprocess.run(["bash", "addfile.sh", file.filename, mime_type, convert_to], capture_output=True, text=True).stdout
# Optionally, you can remove the temporary file
os.remove(file.filename)
return JSONResponse(content={"filename": file.filename, "mime_type": mime_type, "convert_to": convert_to, "message": "File processed successfully.", "logs": logs})
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=10101)

View File

@ -168,8 +168,26 @@ while read TITRE; do
TEXT="<h1>{{!!titre}} ({{!!year}})</h1><h2>{{!!sub}}</h2>
{{!!desc}}<br>
<a target='youtube' href='https://youtu.be/"${YID}"'>Bande Annonce</a>
<h3>Envoyez un don. Recevez le lien vers ce film dans votre messagerie Cesium+</h3>
<img width='300' src='/ipfs/"${PV}"'>"
<br>
<h3>Voir ce Film:</h3>
<h4>Installez Cesium+</h4>
<table><tr>
<td>
<img width='240' src='/ipfs/QmXExw6Sh4o4rSjBQjU9PGU7BCGwb1jybrKEeaZGUNRCRE'>
</td><td>
<img width='240' src='/ipfs/QmP3qwEnVX9zSsyKAwuH6nhDPfrRoMbAfszrtdkLGgo7LQ'>
</td>
</tr>
<tr>
<td>
<h4>Flashez, envoyez un don...</h4>
<br>ce soir,<br>recevez le lien dans votre messagerie.
</td><td>
<img width='300' src='/ipfs/"${PV}"'>
</td>
</tr>
</table>
"
## MAKING TIDDLER
echo "## Creation json tiddler ~/.zen/game/players/${PLAYER}/G1Kodi/${TITLE}.dragdrop.json"

View File

@ -123,7 +123,7 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEtg3SlRxtzsQnsBSeU83W0tvUyBTUvOU5lhjlbZVPCZ
* “keygen” https://git.p2p.legal/STI/Astroport.ONE/src/branch/master/tools/keygen
* “natools” https://git.p2p.legal/STI/Astroport.ONE/src/branch/master/tools/natools.py
* “jaklis” https://git.p2p.legal/axiom-team/jaklis
* “ipfs” https://git.p2p.legal/STI/Astroport.ONE/src/branch/master/kubo_v0.20.0_linux.install.sh
* “ipfs” https://git.p2p.legal/STI/Astroport.ONE/src/branch/master/install.kubo_v0.20.0_linux.sh
## ASTROPORT CREW GILET https://astroport.myspreadshop.fr/create?product=a68ad31e-d554-4c75-821d-97b00d6ad13f&view=2

BIN
BOOKS/TheNetworkState.pdf Normal file

Binary file not shown.

View File

@ -331,7 +331,9 @@ GET /?player=${PLAYER}&moa=json&tag=G1CopierYoutube
> CAN BE EXTENDED
## ➤ AMZQR : Create a QRCode with "amzqr"
### ```/?amzqr=${URLENCODEDSTRING}&logo=${IMAGE}```
```http
GET /?amzqr=${URLENCODEDSTRING}&logo=${IMAGE}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
@ -341,7 +343,9 @@ GET /?player=${PLAYER}&moa=json&tag=G1CopierYoutube
check available "logo.png" in [./images](./images)
## ➤ UPLANET : Create Umap, AstroID & ZenCard for PLAYER (email)
### ```/?uplanet=${PLAYER}&zlat=${LAT}&zlon=${LON}&g1pub=${PASS}```
```http
GET /?uplanet=${PLAYER}&zlat=${LAT}&zlon=${LON}&g1pub=${PASS}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
@ -473,12 +477,13 @@ http://localhost:12345 renvoi un json
| created | date de creation du document |
| hostname | nom de la station |
| myIP | adresse IP de la station |
| ipfsnodeid | date de creation du document |
| ipfsnodeid | Clef publique, balise de la station |
| astroport | Lien vers l'API de la station |
| g1station | Lien vers la carte PLAYER de la Station |
| g1swarm | Lien vers la carte des cartes des Stations de l'essaim |
Afin de propager la carte chaque Stations lors de son raffraichissement de cache demande aux Boostrap de la récupérer
Afin de propager la carte chaque station lors de son raffraichissement de cache
envoi aux Boostrap une requête pour upload (```/ipns/${IPFSNODEID}```)
```
STATION MAP UPSYNC : http://$nodeip:12345/?${GNODEID}=${IPFSNODEID}
```

View File

@ -176,8 +176,12 @@ for PLAYER in ${PLAYERONE[@]}; do
echo "LAT=${LAT}; LON=${LON}; UMAPNS=${UMAPNS}"
## TODATENS ################
TODATENS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}")
## 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}"

View File

@ -6,7 +6,7 @@
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "$MY_PATH/my.sh"
. "$MY_PATH/../tools/my.sh"
################################################################################
## UNPLUG A PLAYER FROM ASTROPORT STATION
############################################
@ -61,7 +61,7 @@ mkdir -p ~/.zen/tmp/${MOATS}
[[ ! -z ${SECTORG1PUB} ]] \
&& echo "> PAY4SURE ZEN:${ALL} WALLET MOVE" \
&& ${MY_PATH}/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${ALL}" "${SECTORG1PUB}" "UNPLUG:${ALL}"
&& ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${ALL}" "${SECTORG1PUB}" "UNPLUG:${ALL}"
## REMOVING PLAYER from ASTROPORT
ipfs key rm ${PLAYER}; ipfs key rm ${PLAYER}_feed; ipfs key rm ${G1PUB};
@ -72,7 +72,7 @@ mkdir -p ~/.zen/tmp/${MOATS}
## SEND PLAYER LAST KNOW TW
TW=$(ipfs add -Hq ${INDEX} | tail -n 1)
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "<html><body><h1>Hello ${PLAYER},</h1> Your TW is unplugged from Astroport : <a href='${myIPFSGW}/ipfs/${TW}'>TW ARCHIVE</a>.<br>$(cat ~/.zen/game/players/${PLAYER}/secret.june)<br><h3>May the force be with you.</h3></body></html>" "BYE BYE MESSAGE"
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "<html><body><h1>Ciao ${PLAYER},</h1> Your TW is unplugged from Astroport : <a href='${myIPFSGW}/ipfs/${TW}'>TW ARCHIVE</a>.<br>$(cat ~/.zen/game/players/${PLAYER}/secret.june)<br><h3>May the force be with you.</h3></body></html>" "BYE BYE MESSAGE"
echo "PLAYER IPNS KEYS UNPLUGED"
echo "#######################"

View File

@ -68,10 +68,10 @@ for REGION in ${REGIONS[@]}; do
# with bigger planetary swam will be closest "IA Station", or it could be choosen according to ZEN value...
STRAPS=($(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | grep -v '^[[:space:]]*$')) ## ${STRAPS[@]}
ACTINGNODE=${STRAPS[0]} ## FIST NODE IN STRAPS
[[ "${ACTINGNODE}" != "${IPFSNODEID}" ]] \
&& echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -" \
&& continue
if [[ "${ACTINGNODE}" != "${IPFSNODEID}" ]]; then
echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -"
continue
fi
##############################################################
REGIONG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${REGION}" "${UPLANETNAME}${REGION}")
[[ ! ${REGIONG1PUB} ]] && echo "ERROR generating REGION WALLET" && exit 1
@ -109,6 +109,10 @@ for REGION in ${REGIONS[@]}; do
done
NL=${#RSSNODE[@]}
echo "
---
" >> ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL
## ADD SWARM SECTORS RSS WEEK
RSSWARM=($(ls ~/.zen/tmp/swarm/*/UPLANET/SECTORS/_${REGLAT}*_${REGLON}*/_${REGLAT}*_${REGLON}*/_${REGLAT}*_${REGLON}*.week.rss.json 2>/dev/null))
for RSS in ${RSSWARM[@]}; do
@ -144,15 +148,15 @@ for REGION in ${REGIONS[@]}; do
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo "Numbers of REGION WEEK RSS : ${NL} + ${NS} : "${TOTL}
rm ~/.zen/tmp/${MOATS}/${REGION}/TODO
rm ~/.zen/tmp/${MOATS}/${REGION}/N_*
echo ${TOTL} > ~/.zen/tmp/${MOATS}/${REGION}/N_${TOTL}
RWEEKCID=$(ipfs add -q ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL 2>/dev/null)
if [[ ${RWEEKCID} ]]; then
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${RWEEKCID}'\" />" \
> ~/.zen/tmp/${MOATS}/${REGION}/Journal._${REGLAT}_${REGLON}.redir.html
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/QmYNH85cJCwSVw4c7SyHtc2jtgh7dL5RegozX7e8Re28a9/md.htm?src=/ipfs/${RWEEKCID}'\" />" \
> ~/.zen/tmp/${MOATS}/${REGION}/Journal._${REGLAT}_${REGLON}.view.html
cp ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL \
~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${REGLAT}_${REGLON}/JOURNAL.md
fi

View File

@ -39,6 +39,8 @@ ${RSS}
cat "${RSS}" | jq 'sort_by(.created) | reverse | .[]' | jq -r '.title' > ~/.zen/tmp/${MOATS}/${SECTOR}/tiddlers.list
##
gloops=0
signatures=0
while read title; do
[[ ${floop} -gt 2 ]] && echo "0lder Tiddlers are similaR... BREAK" && break
@ -54,7 +56,12 @@ while read title; do
[[ ! "${ISHERE}" ]] && echo "No Tiddler found in ${INDEX}"
if [[ "${ISHERE}" != "${title}" ]]; then
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)"
if [[ "${ISHERE}" != "${title}" || ${TMPSIGN} == 0 ]]; then
## NEW TIDDLER
echo "Importing Title: $title"
@ -72,16 +79,17 @@ while read title; do
&& rm ${INDEX} \
&& mv ~/.zen/tmp/${MOATS}/${SECTOR}/${SECTOR}.html ${INDEX} \
&& ((gloops++)) \
&& echo "SECTOR (${gloops}) : ${title}"
&& echo "SECTOR (${gloops}) : ${title}" \
&& signatures=$((signatures + TMPSIGN))
[[ ! -s ${INDEX} ]] && echo "ERROR. TW did not ingest ~/.zen/tmp/${MOATS}/NEW.json" && exit 1
else
## SAME TIDDLER
echo "TIDDLER WITH TITLE $title ALREADY EXISTS..."
echo "TIDDLER WITH TITLE $title and more than 1 signature ALREADY EXISTS..."
cp -f ~/.zen/tmp/${MOATS}/TMP.json ~/.zen/tmp/${MOATS}/INSIDE.json
cat ~/.zen/tmp/${MOATS}/TMP.json | jq .[] > ~/.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
@ -90,9 +98,15 @@ while read title; do
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
## TODO EXTEND CONTROL TO text & ipfs & _canonical_url
## NEED SIGNATURES & TIDDLER SIMILARITY TO COME UP
## NEED SIGNATURES & TIDDLER SIMILARITY TO COME UP
## CHECK FOR EMAIL SIGNATURES DIFFERENCE
NTAGS=$(cat ~/.zen/tmp/${MOATS}/NEW.json | jq -r .tags)
@ -128,7 +142,7 @@ while read title; do
# Print the results
echo "Common email addresses : ${COMMON[*]}"
echo "Email addresses unique in NEW Tiddler : ${NUNIQUE[*]}"
echo "Email addresses unique in ACTUAL Tiddler : ${IUNIQUE[*]}"
echo "Email addresses unique in INSIDE Tiddler : ${IUNIQUE[*]}"
combined=("${IEMAILS[@]}" "${NEMAILS[@]}")
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
@ -168,7 +182,7 @@ To Refuse<br>
<h2><a href='$(myIpfsGw)${VDONINJA}/?room=${MOATS}'>Actual Tiddler</a>Engage discussion about it...</a></h2>
</body></html>" > ~/.zen/tmp/${MOATS}/g1message
${MY_PATH}/mailjet.sh "$email" ~/.zen/tmp/${MOATS}/g1message "TIDDLER COLLISION"
${MY_PATH}/../tools/mailjet.sh "$email" ~/.zen/tmp/${MOATS}/g1message "TIDDLER COLLISION"
done
@ -201,6 +215,8 @@ To Refuse<br>
&& rm ${INDEX} \
&& mv ~/.zen/tmp/${MOATS}/${SECTOR}.html ${INDEX}
signatures=$((signatures + ISIGN))
fi
fi
@ -213,11 +229,11 @@ To Refuse<br>
done < ~/.zen/tmp/${MOATS}/${SECTOR}/tiddlers.list
####################################################
################################################
################################################ ${signatures} -gt ${gloops}
## SECTOR SENDS GRATITUDE TO PUBLISHING PLAYER
###################################################
if [[ ${gloops} -gt 0 && ${ASTROG1} ]]; then
if [[ ${gloops} -gt 0 && ${signatures} -gt ${gloops} && ${ASTROG1} ]]; then
# GENERATE SECTOR PRIVATE KEY ################################
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/sector.dunikey "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}"
G1SECTOR=$(cat ~/.zen/tmp/${MOATS}/sector.dunikey | grep 'pub:' | cut -d ' ' -f 2)

View File

@ -29,8 +29,13 @@ 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 SECTORS ########################
for UMAP in ${UMAPS[@]}; do
@ -62,47 +67,58 @@ for SECTOR in ${SECTORS[@]}; do
SLON=$(echo ${SECTOR} | cut -d '_' -f 3)
##############################################################
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}")
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}"
G1PUB=$(cat ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey | grep 'pub:' | cut -d ' ' -f 2)
[[ ! ${G1PUB} ]] && echo "ERROR generating SECTOR WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${G1PUB} | tail -n 1)
echo "SECTOR : ${SECTOR} (${COINS} G1) WALLET : ${G1PUB}"
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)
rm ~/.zen/tmp/${MOATS}/${SECTOR}.priv
echo "ORIGIN : ${myIPFS}/ipns/${SECTORNS}/"
echo "___ ORIGIN ___ ${myIPFS}/ipns/${SECTORNS}/"
echo "SECTOR : ${SECTOR} (${COINS} G1 <=> ${ZEN} ZEN) : ${G1PUB}"
###################### SPATIO TEMPORAL KEYS
## YESTERDATE ###############
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${SECTOR}" "${YESTERDATE}${UPLANETNAME}${SECTOR}"
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}"
###################### SPATIO TEMPORAL KEYS
## YESTERDATE ###############
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${SECTOR}" "${YESTERDATE}${UPLANETNAME}${SECTOR}"
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}"
## TODATE #########################################
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}"
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}"
## TODATE #########################################
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}"
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}"
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start=`date +%s`
start=`date +%s`
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#~ ## IPFS GET ONLINE YESTERDATE SECTORNS
ipfs --timeout 240s 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}"
fi
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end=`date +%s`
echo "_____SECTOR${SECTOR} GET time was "`expr $end - $start` seconds.
end=`date +%s`
echo "_____SECTOR${SECTOR} GET time was "`expr $end - $start` seconds.
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
### ZEN
## 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)
[[ ${ZCHAIN} && ${ZMOATS} ]] \
&& cp ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain.${ZMOATS} \
&& echo "UPDATING MOATS"
&& echo "UPDATING MOATS ${MOATS}"
MOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
ZMOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${ZMOATS})
@ -113,7 +129,7 @@ for SECTOR in ${SECTORS[@]}; do
echo "SECTOR DATA is ${hours} hours ${minutes} minutes ${seconds} seconds OLD"
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
## CONTROL ACTINGNODE SWAPPING
## CONTROL ACTINGNODE : BOOSTRAP DISTRIBUTED (jeu du mouchoir, token ring aléatoire)
UREFRESH="${HOME}/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/SECTOR.refresher"
ALLNODES=($(cat ${UREFRESH} | grep -v '^[[:space:]]*$' 2>/dev/null)) # ${ALLNODES[@]} without empty line
STRAPS=($(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | grep -v '^[[:space:]]*$')) ## ${STRAPS[@]}
@ -135,14 +151,18 @@ for SECTOR in ${SECTORS[@]}; do
&& echo "More than 26H update" \
&& ACTINGNODE=${STRAPS[0]}
[[ "${ACTINGNODE}" != "${IPFSNODEID}" ]] \
&& echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -" \
&& ipfs key rm ${TODATE}${G1PUB} ${YESYERDATE}${G1PUB} ${G1PUB}; continue
echo "* ACTINGNODE=${ACTINGNODE}"
if [[ "${ACTINGNODE}" != "${IPFSNODEID}" ]]; then
echo ">> ACTINGNODE NOT ME - CONTINUE -"
ipfs key rm "${TODATE}${G1PUB}" "${YESYERDATE}${G1PUB}" "${G1PUB}"
echo "------8<-------------8<------------------8<-----------------8<-----------------8<"
continue
fi
### NEXT REFRESHER SHUFFLE
rm ${UREFRESH}
for STRAP in ${STRAPS[@]}; do
echo ${STRAP} >> ${UREFRESH} ## RESET SECTOR.refresher file with actual STRAPS
echo ${STRAP} >> ${UREFRESH} ## RESET SECTOR.refresher file with actual STRAPS
done
# SHUFFLE UMAP.refresher
cat ${UREFRESH} | sort | uniq | shuf > ${UREFRESH}.shuf
@ -203,118 +223,126 @@ for SECTOR in ${SECTORS[@]}; do
## MAKE SECTOR PLANET WITH ASTONAUTENS LINKS
###########################################################################################
###########################################################################################
## PREPARE Ŋ1 WORLD MAP ##################################################################
echo "var examples = {};
examples['locations'] = function() {
var locations = {
" > ~/.zen/tmp/world.js
floop=1
## PREPARE Ŋ1 WORLD MAP ##################################################################
echo "var examples = {};
examples['locations'] = function() {
var locations = {
" > ~/.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))
TWFILES=("${SWARMTW[@]}" "${NODETW[@]}")
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
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
TWADD=$(cat ${TWRED} | grep -o "/ipns/[^\"]*" | sed "s/'$//")
[[ -z ${TWADD} ]] && TWADD=$(cat ${TWRED} | grep -o "/ipfs/[^\"]*" | sed "s/'$//")
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
TWADD=$(cat ${TWRED} | grep -o "/ipns/[^\"]*" | sed "s/'$//")
[[ -z ${TWADD} ]] && TWADD=$(cat ${TWRED} | grep -o "/ipfs/[^\"]*" | sed "s/'$//")
## ADD ASTRONAUTNS ON SECTOR WORLD MAP
echo "${floop}: {
alpha: Math.random() * 2 * Math.PI,
delta: Math.random() * 2 * Math.PI,
name: '"${ZMAIL}"',
link: '"${TWADD}"'
}
," >> ~/.zen/tmp/world.js
## ADD ASTRONAUTNS ON SECTOR WORLD MAP
echo "${floop}: {
alpha: Math.random() * 2 * Math.PI,
delta: Math.random() * 2 * Math.PI,
name: '"${ZMAIL}"',
link: '"${TWADD}"'
}
," >> ~/.zen/tmp/world.js
((floop++))
done
((floop++))
done
# REMOVE la dernière virgule
sed -i '$ d' ~/.zen/tmp/world.js
##################################
## FINISH LOCATIONS
echo "
};
\$('#sphere').earth3d({
locationsElement: \$('#locations'),
dragElement: \$('#locations'),
locations: locations
});
};
" >> ~/.zen/tmp/world.js
# REMOVE la dernière virgule
sed -i '$ d' ~/.zen/tmp/world.js
##################################
## FINISH LOCATIONS
echo "
};
\$('#sphere').earth3d({
locationsElement: \$('#locations'),
dragElement: \$('#locations'),
locations: locations
});
};
" >> ~/.zen/tmp/world.js
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
echo "JSON WISH WORLD READY /ipfs/${IAMAP}/world.js"
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
echo "JSON WISH WORLD READY /ipfs/${IAMAP}/world.js"
###########################################################################################
## 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}"'"' \
$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}/
convert ~/.zen/tmp/${MOATS}/${SECTOR}/ZENPUB.png -resize 250 ~/.zen/tmp/${MOATS}/ZENPUB.png
# ADD IT
composite -compose Over -gravity NorthEast -geometry +0+0 ~/.zen/tmp/${MOATS}/ZENPUB.png ~/.zen/tmp/${MOATS}/${SECTOR}.png ~/.zen/tmp/${MOATS}/${SECTOR}/INFO.png
###########################################################################################
## 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}"'"' \
$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}/
convert ~/.zen/tmp/${MOATS}/${SECTOR}/ZENPUB.png -resize 250 ~/.zen/tmp/${MOATS}/ZENPUB.png
# ADD IT
composite -compose Over -gravity NorthEast -geometry +0+0 ~/.zen/tmp/${MOATS}/ZENPUB.png ~/.zen/tmp/${MOATS}/${SECTOR}.png ~/.zen/tmp/${MOATS}/${SECTOR}/INFO.png
## zday marking
rm ~/.zen/tmp/${MOATS}/${SECTOR}/z* 2>/dev/null
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />${TODATE} ${SECTOR}" > ~/.zen/tmp/${MOATS}/${SECTOR}/z$(date +%A-%d_%m_%Y).html
## zday marking
rm ~/.zen/tmp/${MOATS}/${SECTOR}/z* 2>/dev/null
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />${TODATE} ${SECTOR}" > ~/.zen/tmp/${MOATS}/${SECTOR}/z$(date +%A-%d_%m_%Y).html
###########################################################################################
### APPLY ON APP MODEL TODATE REGIONNS LINKING
REGLAT=$(echo ${SLAT} | cut -d '.' -f 1)
REGLON=$(echo ${SLON} | cut -d '.' -f 1)
REGION="_${REGLAT}_${REGLON}"
TODATEREGIONNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}")
###########################################################################################
### APPLY ON APP MODEL TODATE REGIONNS LINKING
REGLAT=$(echo ${SLAT} | cut -d '.' -f 1)
REGLON=$(echo ${SLON} | cut -d '.' -f 1)
REGION="_${REGLAT}_${REGLON}"
TODATEREGIONNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}")
REGIONG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}")
PHONEBOOTH="${G1PUB::30}"
cat ${MY_PATH}/../templates/UPlanetSector/index.html \
| sed -e "s~_ZONE_~SECTOR ${SECTOR}~g" \
-e "s~_UPZONE_~REGION ${REGION}~g" \
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
-e "s~_ZONENS_~${TODATENS}~g" \
-e "s~_ZONEIPFS_~${ZCHAIN}~g" \
-e "s~_UPZONENS_~${TODATEREGIONNS}~g" \
-e "s~_SECTORG1PUB_~${G1PUB}~g" \
-e "s~_IPFSNINJA_~${VDONINJA}~g" \
-e "s~_CESIUMIPFS_~${CESIUMIPFS}~g" \
PHONEBOOTH="${G1PUB::30}"
cat ${MY_PATH}/../templates/UPlanetSector/index.html \
| sed -e "s~_ZONE_~SECTOR ${SECTOR}~g" \
-e "s~_UPZONE_~REGION ${REGION}~g" \
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
-e "s~_ZONENS_~${TODATENS}~g" \
-e "s~_ZCHAIN_~${ZCHAIN}~g" \
-e "s~_UPZONENS_~${TODATEREGIONNS}~g" \
-e "s~_SECTORG1PUB_~${G1PUB}~g" \
-e "s~_IPFSNINJA_~${VDONINJA}~g" \
-e "s~_CESIUMIPFS_~${CESIUMIPFS}~g" \
-e "s~_HACKGIPFS_~${HACKGIPFS}~g" \
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
-e "s~_LAT_~${LAT::-1}~g" \
-e "s~_LON_~${LON::-1}~g" \
-e "s~_EARTHCID_~${EARTHCID}~g" \
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${REGLAT}\&southWestLon=${REGLON}\&deg=1~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
-e "s~_LAT_~${SLAT}~g" \
-e "s~_LON_~${SLON}~g" \
-e "s~_EARTHCID_~${EARTHCID}~g" \
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${REGLAT}\&southWestLon=${REGLON}\&deg=1~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html
##################################
cp -f ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html ~/.zen/tmp/${MOATS}/${SECTOR}/index.html
rm ~/.zen/tmp/${MOATS}/${SECTOR}/index.html ## MAKE SECTOR VISIBLE ##
##################################
cp -f ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html ~/.zen/tmp/${MOATS}/${SECTOR}/index.html
rm ~/.zen/tmp/${MOATS}/${SECTOR}/index.html ## MAKE SECTOR VISIBLE ##
###################################################### CHAINING BACKUP
IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${SECTOR}/* | tail -n 1)
## DOES CHAIN CHANGED or INIT ?
[[ ${ZCHAIN} != ${IPFSPOP} || ${ZCHAIN} == "" ]] \
&& echo "${MOATS}:${IPFSNODEID}:${IPFSPOP}" > ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain \
&& echo "${MOATS}" > ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_moats \
&& IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${SECTOR}/* | tail -n 1) && echo "ROOT was ${ZCHAIN}"
######################################################
echo "% START PUBLISHING ${SECTOR} ${myIPFS}/ipns/${TODATENS}"
start=`date +%s`
ipfs name publish -k ${TODATE}${G1PUB} /ipfs/${IPFSPOP}
ipfs key rm ${YESTERDATE}${G1PUB} ${G1PUB} > /dev/null 2>&1
end=`date +%s`
echo "_____SECTOR${SECTOR} PUBLISH time was "`expr $end - $start` seconds.
## ZEN CHAINING
# Send 1 Zen to UPlanet REGIONG1PUB Wallet containing REGION TW HASH
INTERCOM="UPLANET:${SECTOR}:${TODATE}:/ipfs/${IPFSPOP}"
echo "> INTERCOM ${INTERCOM} (${ZEN} ZEN)"
if [[ ${ZEN} -gt 11 ]]; then
echo "---ZZZ-- SECTOR 2 REGION ZEN CHAINING ---ZZZ------ZZZ----"
${MY_PATH}/../tools/PAY4SURE.sh ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey "0.1" "${REGIONG1PUB}" "${INTERCOM}"
fi
##############################################################
## PUBLISHING ${SECTOR}
###############################
echo "% PUBLISHING ${SECTOR} ${myIPFS}/ipns/${TODATENS}"
start=`date +%s`
ipfs name publish -k ${TODATE}${G1PUB} /ipfs/${IPFSPOP}
ipfs key rm ${YESTERDATE}${G1PUB} ${G1PUB} > /dev/null 2>&1
######################################################
rm ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey
###################################################
## EXTRACT SECTOR LAST WEEK TIDDLERS TO IPFSNODEID CACHE
@ -333,6 +361,8 @@ for SECTOR in ${SECTORS[@]}; do
## TODO FILTER INFORMATION WITH MULTIPLE SIGNATURES (DONE in REGION.refresh.sh)
## TODO EXPORT AS RSS ## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/28
end=`date +%s`
echo "_____SECTOR${SECTOR} TREATMENT time was "`expr $end - $start` seconds.
done

View File

@ -11,10 +11,18 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
## SEEK FOR UPLANET KEYS
# GET & UPDATE IPNS
############################################
echo
echo
echo "############################################"
echo "## RUNNING UPLANET.refresh"
echo "
_________________________
< RUNNING UPLANET.refresh >
-------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
"
echo "############################################"
echo "############################################"
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
@ -34,9 +42,13 @@ combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
echo "ACTIVATED UMAPS : ${unique_combined[@]}" # "_LAT_LON" directories
######################################################
### LEVEL 1 ###########################################
######################################################
for UMAP in ${unique_combined[@]}; do
start=`date +%s`
echo
echo "____________REFRESHING ${UMAP}__________"
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
LON=$(echo ${UMAP} | cut -d '_' -f 3)
@ -54,10 +66,14 @@ for UMAP in ${unique_combined[@]}; do
##############################################################
## UMAP WALLET CHECK
##############################################################
G1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
[[ ! ${G1PUB} ]] && echo "ERROR generating WALLET" && exit 1
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/${UMAP}.dunikey "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}"
G1PUB=$(cat ~/.zen/tmp/${MOATS}/${UMAP}.dunikey | grep 'pub:' | cut -d ' ' -f 2)
[[ ! ${G1PUB} ]] && echo "ERROR generating UMAP WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${G1PUB} | tail -n 1)
echo "UMAP (${COINS} G1) WALLET : ${G1PUB}"
ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1)
echo "UMAP (${COINS} G1) ${ZEN} ZEN : ${G1PUB}"
## ORIGIN ##########################################################
## CALCULATE INITIAL UMAP GEOSPACIAL IPNS KEY
@ -84,6 +100,13 @@ for UMAP in ${unique_combined[@]}; do
echo "## IPFS GET YESTERDATENS"
mkdir ~/.zen/tmp/${MOATS}/${UMAP}
ipfs --timeout 240s get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /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.UMAP.memory.sh "${UMAP}" "${MOATS}"
fi
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@ -143,8 +166,9 @@ for UMAP in ${unique_combined[@]}; do
echo "* ACTINGNODE=${ACTINGNODE}"
if [[ "${ACTINGNODE}" != "${IPFSNODEID}" ]]; then
echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -"
echo ">> ACTINGNODE NOT ME - CONTINUE -"
ipfs key rm "${TODATE}${G1PUB}" "${YESTERDATE}${G1PUB}" "${G1PUB}"
echo "------8<-------------8<------------------8<-----------------8<-----------------8<"
continue
fi
########################################
@ -208,7 +232,8 @@ for UMAP in ${unique_combined[@]}; do
# %%%%%%%%%% ##################################################
## COLLECT RSS FROM ALL PLAYERS WITH SAME UMAP IN SWARM MEMORY /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
# %%%%%%%%%% ##################################################
cp ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/RSS/*.rss.json ~/.zen/tmp/${MOATS}/${UMAP}/RSS/ 2>/dev/null
cp ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/RSS/*.rss.json \
~/.zen/tmp/${MOATS}/${UMAP}/RSS/ 2>/dev/null
RSSFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/RSS/*.rss.json 2>/dev/null))
for RSSFILE in ${RSSFILES[@]}; do
cp ${RSSFILE} ~/.zen/tmp/${MOATS}/${UMAP}/RSS/
@ -217,7 +242,8 @@ for UMAP in ${unique_combined[@]}; do
# %%%%%%%%%% ##################################################
## COLLECT TW LINKS FROM NODE & SWARM
# %%%%%%%%%% ##################################################
cp -r ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/* ~/.zen/tmp/${MOATS}/${UMAP}/TW/ 2>/dev/null
cp -r ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/* \
~/.zen/tmp/${MOATS}/${UMAP}/TW/ 2>/dev/null
TWFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
@ -266,7 +292,7 @@ for UMAP in ${unique_combined[@]}; do
echo "* park4night : https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr"
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json ]] && touch ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \
&& curl -s "https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \
&& curl -s -L "https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \
&& [[ $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json) -gt $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json) ]] \
&& mv ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json \
&& echo "UPDATED PARK4NIGHT" \
@ -277,11 +303,31 @@ for UMAP in ${unique_combined[@]}; do
## GET 100KM GCHANGE ADS ( https://data.gchange.fr )
${MY_PATH}/../tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON} > ~/.zen/tmp/${MOATS}/${UMAP}/gchange50.json
## GET ALL WALLETS
echo "* GET WALLETS https://g1-stats.axiom-team.fr/data/geoloc-members.json"
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json ]] && touch ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \
&& curl -s "https://g1-stats.axiom-team.fr/data/geoloc-members.json" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \
&& [[ $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json) -gt $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json) ]] \
&& mv ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json \
&& echo "UPDATED WALLALL" \
|| rm ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json
## FILTER LOCAL WALLETS
target_lat=${LAT}
target_lon=${LON}
precision=0.1
jq --argjson target_lat "$target_lat" \
--argjson target_lon "$target_lon" \
--argjson precision "$precision" \
'.wallets | map(select((.geoPoint.lat | tonumber) >= ($target_lat - $precision) and (.geoPoint.lat | tonumber) <= ($target_lat + $precision) and (.geoPoint.lon | tonumber) >= ($target_lon - $precision) and (.geoPoint.lon | tonumber) <= ($target_lon + $precision)))' ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json \
> ~/.zen/tmp/${MOATS}/${UMAP}/wallets.json
echo "MAKING _index.p4n.html with ./templates/P4N/index.html"
## CREATE INDEX LOADING JSONs ON OPENSTREETMAP
cat ${MY_PATH}/../templates/P4N/index.html \
| sed -e "s~43.2218~${LAT}~g" \
-e "s~1.3977~${LON}~g" \
| sed -e "s~43.61000~${LAT}~g" \
-e "s~1.43000~${LON}~g" \
-e "s~_SERVICE_~Commons~g" \
-e "s~_UMAP_~${UMAP}~g" \
-e "s~http://127.0.0.1:8080~~g" \
@ -345,12 +391,14 @@ for UMAP in ${unique_combined[@]}; do
PHONEBOOTH="${G1PUB::30}"
cat ${MY_PATH}/../templates/UPlanetUmap/index.html \
| sed -e "s~_ZONE_~UMAP ${UMAP}~g" \
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
-e "s~_ZONENS_~${TODATENS}~g" \
-e "s~_IPFSNINJA_~${VDONINJA}~g" \
-e "s~_HACKGIPFS_~${HACKGIPFS}~g" \
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
-e "s~_UPZONENS_~${TODATESECTORNS}~g" \
-e "s~_UPUPZONE_~REGION ${REGION}~g" \
-e "s~_UPUPZONENS_~${TODATEREGIONNS}~g" \
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${LAT}\&southWestLon=${LON}\&deg=0.01~g" \
@ -378,6 +426,16 @@ for UMAP in ${unique_combined[@]}; do
&& cp ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain.${ZMOATS} \
&& echo "UPDATING MOATS"
######################################################
## ZEN CHAINING
# Send 1 Zen to UPlanet SECTORG1PUB Wallet containing REGION TW HASH
INTERCOM="UPLANET:${UMAP}:${TODATE}:/ipfs/${UMAPROOT}"
echo "> INTERCOM ${INTERCOM} (${ZEN} ZEN)"
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}"
fi
## MICRO LEDGER CHAIN CHANGED or INIT ?
[[ ${ZCHAIN} != ${UMAPROOT} || ${ZCHAIN} == "" ]] \
&& echo "${MOATS}:${IPFSNODEID}:${UMAPROOT}" > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain \
@ -391,14 +449,24 @@ for UMAP in ${unique_combined[@]}; do
echo "(UMAP) ${UMAP} ${TODATE} PUBLISH time was "`expr $end - $start` seconds.
ipfs key rm "${TODATE}${G1PUB}" "${YESTERDATE}${G1PUB}" "${G1PUB}" ## REMOVE IPNS KEY
rm ~/.zen/tmp/${MOATS}/*.priv
rm ~/.zen/tmp/${MOATS}/${UMAP}.dunikey
done
######################################################
### LEVEL 2 ###########################################
######################################################
### SECTOR = 0.1° Planet Slice
${MY_PATH}/SECTOR.refresh.sh "${unique_combined[@]}"
######################################################
### LEVEL 3 ###########################################
######################################################
### REGION = 1° Planet Slice
${MY_PATH}/REGION.refresh.sh "${unique_combined[@]}"
######################################################
######################################################
exit 0
######################################################

View File

@ -8,10 +8,11 @@ MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "$MY_PATH/tools/my.sh"
. "$MY_PATH/../tools/my.sh"
## LOG into ~/.zen/tmp/_12345.log
exec 2>&1 >> ~/.zen/tmp/_12345.log
echo "=========================="
echo "(◕‿◕ ) ${ME} (◕‿◕ ) "
## LOCAL
@ -36,28 +37,39 @@ MErunning=$(ps axf --sort=+utime | grep -w ${ME} | grep -v -E 'color=auto|grep'
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..."
## STORAGE FOR IPFS GET on UPLANET KEYS
## 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 {} +
floop=0
medo=0
for key in ${UKEYS[@]}; do
[[ -d ~/.zen/tmp/flashmem/$key ]] \
&& echo "$key already copied" && medo=$((medo +1)) && continue
floop=$((floop +1))
mkdir -p ~/.zen/tmp/flashmem/$key
echo "ipfs --timeout 180s get -o ~/.zen/tmp/flashmem/$key /ipns/$key"
ipfs --timeout 180s get -o ~/.zen/tmp/flashmem/$key /ipns/$key
[[ $? == 0 ]] && medo=$((medo +1)) || rm -Rf ~/.zen/tmp/flashmem/$key
[[ $? == 0 ]] \
&& medo=$((medo +1)) && floop=$((floop -1)) \
|| rm -Rf ~/.zen/tmp/flashmem/$key # GOT IT or NOT ?
floop=$((floop +1))
[ $floop -gt 33 ] && break
done
echo "(◕‿◕ ) ${ME} :: $medo SUCCESS over $floop KEYS from ${#UKEYS[@]} JOBS"
done
echo "=========================="
echo "(◕‿◕ ) ${ME} :: $medo SUCCESS missing $floop KEYS from ${#UKEYS[@]} JOBS"
echo "=========================="
exit 0

View File

@ -33,7 +33,7 @@ LIBRA=$(head -n 2 ${MY_PATH}/../A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f
################################################################################
## LIST TW MODELS
################################################################################
TWMODEL="/ipfs/bafybeie6sx76balvpeehvbh5du7oc5fhjuwydryympeh3qnm5s3b2jrvwe"
TWMODEL="/ipfs/bafybeiewwxkmiojbskcqhbj2gbkde3czkeqftn6fgvwoa7ez5n5whido3q"
# ipfs cat $TWMODEL > templates/twdefault.html
MINIMAL="/ipfs/bafybeifnlpnvpxxnblgwefoflmdnt2vhckmnu22orsi43zilh2v4sbegjy"
# ipfs cat $MINIMAL > templates/twuplanet.html
@ -328,7 +328,7 @@ DISCO="/?salt=${USALT}&pepper=${UPEPPER}"
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}/secret.dunikey.$G1PUB.enc | base16)
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 ?
###########
@ -558,9 +558,9 @@ do
echo "<br>" >> ~/.zen/tmp/${MOATS}/ZenCard.html
done <"$asciiart"
echo "<h1></h1>
<a href='${myIPFSGW}${IASTRO}'>ZenCard ${G1PUB}<br><img src='${myIPFSGW}${IASTRO}'\><br></a>
<br></body></html>" >> ~/.zen/tmp/${MOATS}/ZenCard.html
echo "<h2>PRINT & SHARE <a href='${myIPFS}/ipns/${ASTRONAUTENS}#ZenCard' title='${G1PUB}'>ZenCard</a></h2>
<img src='${myIPFSGW}${IASTRO}'\><br>
</body></html>" >> ~/.zen/tmp/${MOATS}/ZenCard.html
$MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/ZenCard.html "ZenCard (${PLAYER}) "
@ -590,9 +590,9 @@ do
done <"$asciiart"
echo "
<h3> <--> 0.1 SECTOR : <a href='${EARTHCID}/map_render.html?southWestLat=${LAT::-1}&southWestLon=${LON::-1}&deg=0.1'>${SECTOR}</a> <--> </h3>
<br><a href='${myIPFS}/ipns/${ASTRONAUTENS}#AstroID'>AstroID<br><img src='${myIPFSGW}${ASTROQR}'\></a>
<br>SECRET1=$SALT SECRET2=$PEPPER ($PASS)<br>
<h2> <--> 0.1 SECTOR : <a href='${EARTHCID}/map_render.html?southWestLat=${LAT::-1}&southWestLon=${LON::-1}&deg=0.1'>${SECTOR}</a> <--> </h2>
<br>PRINT & KEEP SAFE <a href='${myIPFS}/ipns/${ASTRONAUTENS}#AstroID'>AstroID<br><img width=120px src='${myIPFSGW}${ASTROQR}'\></a>
<br>SECRET1=$SALT<br>SECRET2=$PEPPER<br>($PASS)<br>
<h3>ASTROPORT : <a href='${myIPFS}/ipns/${IPFSNODEID}'>/ipns/${IPFSNODEID}</a></h3>
<a href='https://qo-op.com'>Uplanet</a>
</body></html>" >> ~/.zen/tmp/${MOATS}/AstroID.html
@ -610,6 +610,12 @@ $MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/AstroID.html "Astr
rm -Rf ~/.zen/tmp/${MOATS}
) &
## CHECK .current
[[ ! -d $(readlink ~/.zen/game/players/.current) ]] \
&& rm ~/.zen/game/players/.current 2>/dev/null \
&& ln -s ~/.zen/game/players/${PLAYER} ~/.zen/game/players/.current
echo $PSEUDO > ~/.zen/tmp/PSEUDO ## Return data to command.sh # KEEP IT
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
################################################ LAST LINE REPORT VALUES TO CALLING SCRIPT | tail -n 1

View File

@ -54,9 +54,10 @@ echo "Exporting ${PLAYER} TW [tag[G1Voeu]]"
rm -f ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json
tiddlywiki --load ${INDEX} --output ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu --render '.' "${PLAYER}.g1voeu.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1Voeu]]'
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json ]] && echo "AUCUN G1VOEU - EXIT -" && exit 0
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json ]] \
&& echo "AUCUN G1VOEU - EXIT -" && exit 0
cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq -r '.[].wish' > ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt
cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq -r 'map(select(.wish != null)) | .[].wish' > ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt
wishnumbers=$(cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt | wc -l)
echo "${wishnumbers} VOEUX : ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt "
@ -316,7 +317,7 @@ if [[ ${wishnumbers} -gt 0 ]]; then
to ${SECTOR} WALLET ${SECTORG1PUB}"
echo "************************************************************"
MYWISHFLUX=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/* | tail -n 1) # ADDING JSONS TO IPFS
${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${G1AMOUNT}" "${SECTORG1PUB}" "/ipfs/${MYWISHFLUX}"
${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${G1AMOUNT}" "${SECTORG1PUB}" "UPLANET:TWISH:$TODATE:/ipfs/${MYWISHFLUX}"
fi
################################################
################################################ GRATITUDE SENT TO SECTOR

96
RUNTIME/ZEN.SECTOR.memory.sh Executable file
View File

@ -0,0 +1,96 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
#~ ZEN.SECTOR.memory.sh
#~ Search for last "UPLANET:$1:..." in UPLANETG1PUB wallet history
#~ INTERCOM="UPLANET:${SECTOR}:${TODATE}:/ipfs/${IPFSPOP}" TX COMMENT are made during SECTOR.refresh.sh
#~ ~/.zen/tmp/${MOATS}/${SECTOR} <=> "/ipfs/$ipfs_pop"
################################################################################
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
################################################################################
SECTOR="$1"
[[ $SECTOR == "" ]] && echo "MISSING SECTOR ADRESS" && exit 1
MOATS="$2"
## CHECK FOR BAD PARAM
[[ ! -d ~/.zen/tmp/${MOATS-empty}/${SECTOR-empty}/ ]] \
&& echo "BAD ~/.zen/tmp/${MOATS}/${SECTOR}" \
&& exit 1
## STARTING
start=`date +%s`
## CORRESPONDING REGION UKEY
LAT=$(echo ${SECTOR} | cut -d '_' -f 2)
LON=$(echo ${SECTOR} | cut -d '_' -f 3)
REGLAT=$(echo ${LAT} | cut -d '.' -f 1)
REGLON=$(echo ${LON} | cut -d '.' -f 1)
REGION="_${REGLAT}_${REGLON}"
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/${REGION}.priv "${UPLANETNAME}${REGION}" "${UPLANETNAME}${REGION}"
REGIONG1PUB=$(cat ~/.zen/tmp/${MOATS}/${REGION}.priv | grep "pub:" | cut -d ' ' -f 2)
[[ ! ${REGIONG1PUB} ]] && echo "ERROR generating REGION WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${REGIONG1PUB} | tail -n 1)
echo "REGION : ${REGION} (${COINS} G1) WALLET : ${REGIONG1PUB}"
## RETRIEVE FROM REGION UKEY
${MY_PATH}/timeout.sh -t 20 $MY_PATH/jaklis/jaklis.py history -n 300 -p ${REGIONG1PUB} -j \
> ~/.zen/tmp/${MOATS}/${REGION}.g1history.json
## SCAN FOR UPLANET:${SECTOR} in TX
if [[ -s ~/.zen/tmp/${MOATS}/${REGION}.g1history.json ]]; then
intercom=$(jq -r '.[] | select(.comment | test("UPLANET:'"${SECTOR}"'")) | .comment' ~/.zen/tmp/${MOATS}/${REGION}.g1history.json)
ipfs_pop=$(echo "$intercom" | grep -oP 'UPLANET:'"${SECTOR}"':/ipfs/\K[^"]+')
todate=$(echo "$intercom" | grep -oP 'UPLANET:'"${SECTOR}"':\K[^:]*')
echo "SYNC ~/.zen/tmp/${MOATS}/${SECTOR} <=> /ipfs/$ipfs_pop"
## TODO: SECURITY PATCH : check payment emitter is SECTORG1PUB
if [[ $ipfs_pop ]]; then
echo "from $todate memory slot"
ipfs --timeout 90s get -o ~/.zen/tmp/${MOATS}/${SECTOR} /ipfs/$ipfs_pop
else
echo "WARNING cannot remember... scan for more TX ??!"
fi
else
echo "FATAL ERROR cannot access to REGIONG1PUB history"
exit 1
fi
end=`date +%s`
echo "(${SECTOR}.memory) ${todate} get time : "`expr $end - $start` seconds.
#~ ## EXTRACT WORLDG1PUB HISTORY
#~ ${MY_PATH}/timeout.sh -t 20 $MY_PATH/jaklis/jaklis.py history -n 300 -p ${WORLDG1PUB} -j \
#~ > ~/.zen/tmp/${MOATS}/${WORLDG1PUB}.g1history.json
#~ ## SCAN FOR UPLANET:${SECTOR} in TX
#~ if [[ -s ~/.zen/tmp/${MOATS}/${WORLDG1PUB}.g1history.json ]]; then
#~ intercom=$(jq -r '.[] | select(.comment | test("UPLANET:'"${SECTOR}"'")) | .comment' ~/.zen/tmp/${MOATS}/${WORLDG1PUB}.g1history.json)
#~ ipfs_pop=$(echo "$intercom" | grep -oP 'UPLANET:'"${SECTOR}"':/ipfs/\K[^"]+')
#~ todate=$(echo "$intercom" | grep -oP 'UPLANET:'"${SECTOR}"':\K[^:]*')
#~ echo "SYNC ~/.zen/tmp/${MOATS}/${SECTOR} <=> /ipfs/$ipfs_pop"
#~ if [[ $ipfs_pop ]]; then
#~ echo "from $todate memory slot"
#~ ipfs --timeout 90s get -o ~/.zen/tmp/${MOATS}/${SECTOR} /ipfs/$ipfs_pop
#~ end=`date +%s`
#~ echo "(${SECTOR}) ${todate} get time : "`expr $end - $start` seconds.
#~ else
#~ echo "WARNING cannot remember... scan for more TX ??!"
#~ fi
#~ else
#~ echo "FATAL ERROR cannot access to WORLDG1PUB history"
#~ exit 1
#~ fi
exit 0

73
RUNTIME/ZEN.UMAP.memory.sh Executable file
View File

@ -0,0 +1,73 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
#~ ZEN.UMAP.memory.sh
#~ Search for last "UPLANET:$1:..." in UPLANETG1PUB wallet history
#~ INTERCOM="UPLANET:${UMAP}:${TODATE}:/ipfs/${IPFSPOP}" TX COMMENT are made during UPLANET.refresh.sh
#~ ~/.zen/tmp/${MOATS}/${UMAP} <=> "/ipfs/$ipfs_pop"
################################################################################
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
################################################################################
UMAP="$1"
[[ $UMAP == "" ]] && echo "MISSING UMAP ADRESS" && exit 1
MOATS="$2"
## CHECK FOR BAD PARAM
[[ ! -d ~/.zen/tmp/${MOATS-empty}/${UMAP-empty}/ ]] \
&& echo "BAD ~/.zen/tmp/${MOATS}/${UMAP}" \
&& exit 1
## STARTING
start=`date +%s`
## CORRESPONDING SECTOR UKEY
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
LON=$(echo ${UMAP} | cut -d '_' -f 3)
## SECTOR COORD
SECLAT="${LAT::-1}"
SECLON="${LON::-1}"
SECTOR="_${SECLAT}_${SECLON}"
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/${SECTOR}.priv "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}"
SECTORG1PUB=$(cat ~/.zen/tmp/${MOATS}/${SECTOR}.priv | grep "pub:" | cut -d ' ' -f 2)
[[ ! ${SECTORG1PUB} ]] && echo "ERROR generating SECTOR WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${SECTORG1PUB} | tail -n 1)
echo "SECTOR : ${SECTOR} (${COINS} G1) WALLET : ${SECTORG1PUB}"
## RETRIEVE FROM SECTOR UKEY
${MY_PATH}/timeout.sh -t 20 $MY_PATH/jaklis/jaklis.py history -n 300 -p ${SECTORG1PUB} -j \
> ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json
## SCAN FOR UPLANET:${UMAP} in TX
if [[ -s ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json ]]; then
intercom=$(jq -r '.[] | select(.comment | test("UPLANET:'"${UMAP}"'")) | .comment' ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json)
ipfs_pop=$(echo "$intercom" | grep -oP 'UPLANET:'"${UMAP}"':/ipfs/\K[^"]+')
todate=$(echo "$intercom" | grep -oP 'UPLANET:'"${UMAP}"':\K[^:]*')
echo "SYNC ~/.zen/tmp/${MOATS}/${UMAP} <=> /ipfs/$ipfs_pop"
## TODO: SECURITY PATCH : check payment emitter is UMAPG1PUB
if [[ $ipfs_pop ]]; then
echo "from $todate memory slot"
ipfs --timeout 90s get -o ~/.zen/tmp/${MOATS}/${UMAP} /ipfs/$ipfs_pop
else
echo "WARNING cannot remember... scan for more TX ??!"
fi
else
echo "FATAL ERROR cannot access to SECTORG1PUB history"
exit 1
fi
end=`date +%s`
echo "(${UMAP}.memory) ${todate} get time : "`expr $end - $start` seconds.
exit 0

303
_12345.sh
View File

@ -43,30 +43,34 @@ echo "$(date -u)" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.staom
## MySwarm KEY INIT & SET
############################################################
## CREATE CHAN = MySwarm_${IPFSNODEID}
CHAN=$(ipfs key list -l | grep -w "MySwarm_${IPFSNODEID}" | cut -d ' ' -f 1)
CHAN=$(ipfs key list -l | grep -w "MySwarm_${IPFSNODEID}" | cut -d ' ' -f 1)
#######################################################
## CREATE MySwarm KEYS ?
if [[ ${CHAN} == "" || ${CHAN} == "null" ]]; then
echo "## MAKE /proc/cpuinfo IPFSNODEID DERIVATED KEY ##"
SECRET1=$(cat /proc/cpuinfo | grep -Ev MHz | sha512sum | cut -d ' ' -f 1)
SECRET2=${IPFSNODEID}
echo "SALT=$SECRET1 && PEPPER=$SECRET2" > ~/.zen/game/myswarm_secret.june
${MY_PATH}/tools/keygen -t ipfs -o ~/.zen/game/myswarm_secret.ipfskey "$SECRET1" "$SECRET2"
${MY_PATH}/tools/keygen -t duniter -o ~/.zen/game/myswarm_secret.dunikey "$SECRET1" "$SECRET2"
ipfs key import "MySwarm_${IPFSNODEID}" -f pem-pkcs8-cleartext ~/.zen/game/myswarm_secret.ipfskey
CHAN=$(ipfs key list -l | grep -w "MySwarm_${IPFSNODEID}" | cut -d ' ' -f 1 )
fi
######################################################## MAKE IPFS NODE CHAN ID CPU RELATED
#######################################################
## CREATE MySwarm KEYS ?
if [[ ${CHAN} == "" || ${CHAN} == "null" ]]; then
echo "## MAKE /proc/cpuinfo IPFSNODEID DERIVATED KEY ##"
SECRET1=$(cat /proc/cpuinfo | grep -Ev MHz | sha512sum | cut -d ' ' -f 1)
SECRET2=${IPFSNODEID}
echo "SALT=$SECRET1 && PEPPER=$SECRET2" > ~/.zen/game/myswarm_secret.june
${MY_PATH}/tools/keygen -t ipfs -o ~/.zen/game/myswarm_secret.ipfskey "$SECRET1" "$SECRET2"
${MY_PATH}/tools/keygen -t duniter -o ~/.zen/game/myswarm_secret.dunikey "$SECRET1" "$SECRET2"
ipfs key import "MySwarm_${IPFSNODEID}" -f pem-pkcs8-cleartext ~/.zen/game/myswarm_secret.ipfskey
CHAN=$(ipfs key list -l | grep -w "MySwarm_${IPFSNODEID}" | cut -d ' ' -f 1 )
fi
######################################################## MAKE IPFS NODE CHAN ID CPU RELATED
## PUBLISH CHANNEL IPNS
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${CHAN}'\" />" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.$(myHostName).html
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${CHAN}'\" />" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.$(myHostName).html
############################################################
############################################################
echo 0 > ~/.zen/tmp/random.sleep
###################
# NEVER ENDING LOOP
#### UPLANET FLASHMEM UPDATES
${MY_PATH}/RUNTIME/UPlanetKEYS_refresh.sh &
###################################################################
## WILL SCAN ALL BOOSTRAP - REFRESH "SELF IPNS BALISE" - RECEIVE UPLINK ORDERS
###################################################################
@ -81,175 +85,175 @@ while true; do
## FIXING TIC TAC FOR NODE & SWARM REFRESH ( 1H )
if [[ ${duree} -gt 3600000 ]]; then
${MY_PATH}/ping_bootstrap.sh
${MY_PATH}/ping_bootstrap.sh
#### UPLANET FLASHMEM UPDATES
${MY_PATH}/UPlanetKEYS_refresh.sh &
#### UPLANET FLASHMEM UPDATES
${MY_PATH}/RUNTIME/UPlanetKEYS_refresh.sh &
PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
[[ ${PLAYERONE[@]} == "" ]] && echo "EMPTY ASTROPORT - NO PLAYER - NO PUBLISHING" && continue
PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
[[ ${PLAYERONE[@]} == "" ]] && echo "EMPTY ASTROPORT - NO PLAYER - NO PUBLISHING" && continue
#####################################
( ##### SUB-PROCESS £
start=`date +%s`
#####################################
( ##### SUB-PROCESS £
start=`date +%s`
# MONITOR pending
for player in ${PLAYERONE[@]}; do
g1pub=$(cat ~/.zen/game/players/${player}/.g1pub 2>/dev/null)
# Check Station PLAYER payments
PENDINGS=($(ls "$HOME/.zen/game/pending/${g1pub}/*.TX"))
for pending in "${PENDINGS[@]}"; do
echo ${pending}
# TODO TREAT PENDINGS
#
# MONITOR pending
for player in ${PLAYERONE[@]}; do
g1pub=$(cat ~/.zen/game/players/${player}/.g1pub 2>/dev/null)
# Check Station PLAYER payments
PENDINGS=($(ls "$HOME/.zen/game/pending/${g1pub}/*.TX"))
for pending in "${PENDINGS[@]}"; do
echo ${pending}
# TODO TREAT PENDINGS
#
done
done
done
############# GET BOOSTRAP SWARM DATA
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | grep -v '^[[:space:]]*$') # remove comments and empty lines
do
############# GET BOOSTRAP SWARM DATA
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | grep -v '^[[:space:]]*$') # remove comments and empty lines
do
## ex: /ip4/149.102.158.67/tcp/4001/p2p/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u)
echo "############# RUN LOOP ######### $(date)"
ipfsnodeid=${bootnode##*/}
## ex: /ip4/149.102.158.67/tcp/4001/p2p/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u)
echo "############# RUN LOOP ######### $(date)"
ipfsnodeid=${bootnode##*/}
[[ ${ipfsnodeid} == ${IPFSNODEID} ]] && echo "MYSELF : ${IPFSNODEID} - CONTINUE" && continue
[[ ${ipfsnodeid} == ${IPFSNODEID} ]] && echo "MYSELF : ${IPFSNODEID} - CONTINUE" && continue
[[ ${ipfsnodeid} == "null" || ${ipfsnodeid} == "" ]] && echo "BAD ${IPFSNODEID} - CONTINUE" && continue
[[ ${ipfsnodeid} == "null" || ${ipfsnodeid} == "" ]] && echo "BAD ${IPFSNODEID} - CONTINUE" && continue
## SWARM CONNECT
ipfs swarm connect ${bootnode}
## SWARM CONNECT
ipfs swarm connect ${bootnode}
## PREPARE TO REFRESH SWARM LOCAL CACHE
mkdir -p ~/.zen/tmp/swarm/${ipfsnodeid}
mkdir -p ~/.zen/tmp/-${ipfsnodeid}
## PREPARE TO REFRESH SWARM LOCAL CACHE
mkdir -p ~/.zen/tmp/swarm/${ipfsnodeid}
mkdir -p ~/.zen/tmp/-${ipfsnodeid}
## GET bootnode IP
iptype=$(echo ${bootnode} | cut -d '/' -f 2)
nodeip=$(echo ${bootnode} | cut -d '/' -f 3)
## GET bootnode IP
iptype=$(echo ${bootnode} | cut -d '/' -f 2)
nodeip=$(echo ${bootnode} | cut -d '/' -f 3)
## IPFS GET TO /swarm/${ipfsnodeid}
echo "GETTING ${nodeip} : /ipns/${ipfsnodeid}"
ipfs --timeout 720s get -o ~/.zen/tmp/-${ipfsnodeid}/ /ipns/${ipfsnodeid}/
## IPFS GET TO /swarm/${ipfsnodeid}
echo "GETTING ${nodeip} : /ipns/${ipfsnodeid}"
ipfs --timeout 720s get -o ~/.zen/tmp/-${ipfsnodeid}/ /ipns/${ipfsnodeid}/
## SHOW WHAT WE GET
echo "__________________________________________________"
ls ~/.zen/tmp/-${ipfsnodeid}/
echo "__________________________________________________"
## SHOW WHAT WE GET
echo "__________________________________________________"
ls ~/.zen/tmp/-${ipfsnodeid}/
echo "__________________________________________________"
## LOCAL CACHE SWITCH WITH LATEST
if [[ -s ~/.zen/tmp/-${ipfsnodeid}/_MySwarm.moats ]]; then
if [[ $(diff ~/.zen/tmp/-${ipfsnodeid}/_MySwarm.moats ~/.zen/tmp/swarm/${ipfsnodeid}/_MySwarm.moats) || $(cat ~/.zen/tmp/swarm/${ipfsnodeid}/_MySwarm.moats 2>/dev/null) == "" ]]; then
rm -Rf ~/.zen/tmp/swarm/${ipfsnodeid}
mv ~/.zen/tmp/-${ipfsnodeid} ~/.zen/tmp/swarm/${ipfsnodeid}
echo "UPDATED : ~/.zen/tmp/swarm/${ipfsnodeid}"
## LOCAL CACHE SWITCH WITH LATEST
if [[ -s ~/.zen/tmp/-${ipfsnodeid}/_MySwarm.moats ]]; then
if [[ $(diff ~/.zen/tmp/-${ipfsnodeid}/_MySwarm.moats ~/.zen/tmp/swarm/${ipfsnodeid}/_MySwarm.moats) || $(cat ~/.zen/tmp/swarm/${ipfsnodeid}/_MySwarm.moats 2>/dev/null) == "" ]]; then
rm -Rf ~/.zen/tmp/swarm/${ipfsnodeid}
mv ~/.zen/tmp/-${ipfsnodeid} ~/.zen/tmp/swarm/${ipfsnodeid}
echo "UPDATED : ~/.zen/tmp/swarm/${ipfsnodeid}"
else
echo "TimeStamp unchanged : $(cat ~/.zen/tmp/swarm/${ipfsnodeid}/_MySwarm.moats)"
rm -Rf ~/.zen/tmp/-${ipfsnodeid}/
continue
fi
else
echo "TimeStamp unchanged : $(cat ~/.zen/tmp/swarm/${ipfsnodeid}/_MySwarm.moats)"
rm -Rf ~/.zen/tmp/-${ipfsnodeid}/
echo "UNREACHABLE /ipns/${ipfsnodeid}/"
continue
fi
else
echo "UNREACHABLE /ipns/${ipfsnodeid}/"
continue
fi
## ASK BOOSTRAP NODE TO GET MY MAP UPSYNC
## - MAKES MY BALISE PRESENT IN BOOSTRAP SWARM KEY -
if [[ $iptype == "ip4" || $iptype == "ip6" ]]; then
## ASK BOOSTRAP NODE TO GET MY MAP UPSYNC
## - MAKES MY BALISE PRESENT IN BOOSTRAP SWARM KEY -
if [[ $iptype == "ip4" || $iptype == "ip6" ]]; then
############ UPSYNC CALL
echo "STATION MAP UPSYNC : curl -s http://${nodeip}:12345/?${NODEG1PUB}=${IPFSNODEID}"
curl -s -m 10 http://${nodeip}:12345/?${NODEG1PUB}=${IPFSNODEID} -o ~/.zen/tmp/swarm/${ipfsnodeid}/map.${nodeip}.json
############ UPSYNC CALL
echo "STATION MAP UPSYNC : curl -s http://${nodeip}:12345/?${NODEG1PUB}=${IPFSNODEID}"
curl -s -m 10 http://${nodeip}:12345/?${NODEG1PUB}=${IPFSNODEID} -o ~/.zen/tmp/swarm/${ipfsnodeid}/map.${nodeip}.json
## LOOKING IF ITS SWARM MAP COULD COMPLETE MINE
echo "ANALYSING BOOSTRAP SWARM MAP"
itipnswarmap=$(cat ~/.zen/tmp/swarm/${ipfsnodeid}/map.${nodeip}.json | jq -r '.g1swarm' | rev | cut -d '/' -f 1 | rev )
ipfs ls /ipns/${itipnswarmap} | rev | cut -d ' ' -f 1 | rev | cut -d '/' -f 1 > ~/.zen/tmp/_swarm.${ipfsnodeid}
## LOOKING IF ITS SWARM MAP COULD COMPLETE MINE
echo "ANALYSING BOOSTRAP SWARM MAP"
itipnswarmap=$(cat ~/.zen/tmp/swarm/${ipfsnodeid}/map.${nodeip}.json | jq -r '.g1swarm' | rev | cut -d '/' -f 1 | rev )
ipfs ls /ipns/${itipnswarmap} | rev | cut -d ' ' -f 1 | rev | cut -d '/' -f 1 > ~/.zen/tmp/_swarm.${ipfsnodeid}
echo "================ ${nodeip}:12345 ZNODS LIST"
cat ~/.zen/tmp/_swarm.${ipfsnodeid}
echo "============================================"
for znod in $(cat ~/.zen/tmp/_swarm.${ipfsnodeid}); do
# CHECK znod validity
cznod=$(${MY_PATH}/tools/ipfs_to_g1.py ${znod} 2>/dev/null)
[[ ${cznod} == "" || ${cznod} == "null" ]] && echo "xxxxxxxxxxxx BAD ${znod} xxxx ON xxxxxx ${ipfsnodeid} - ERROR - CONTINUE" && continue
echo "================ ${nodeip}:12345 ZNODS LIST"
cat ~/.zen/tmp/_swarm.${ipfsnodeid}
echo "============================================"
for znod in $(cat ~/.zen/tmp/_swarm.${ipfsnodeid}); do
# CHECK znod validity
cznod=$(${MY_PATH}/tools/ipfs_to_g1.py ${znod} 2>/dev/null)
[[ ${cznod} == "" || ${cznod} == "null" ]] && echo "xxxxxxxxxxxx BAD ${znod} xxxx ON xxxxxx ${ipfsnodeid} - ERROR - CONTINUE" && continue
if [[ ! -d ~/.zen/tmp/swarm/${znod} ]]; then
echo "COMPLETING MY SWARM DATA WITH ZNOD=${znod}"
mkdir -p ~/.zen/tmp/swarm/${znod}
ipfs --timeout 180s get -o ~/.zen/tmp/swarm/${znod} /ipns/${znod}
else
echo "____________ KNOW ${znod}"
# TODO : SPEEDUP REFRESH COMPARE _MySwarm.moats AND KEEP LASTEST
fi
if [[ ! -d ~/.zen/tmp/swarm/${znod} ]]; then
echo "COMPLETING MY SWARM DATA WITH ZNOD=${znod}"
mkdir -p ~/.zen/tmp/swarm/${znod}
ipfs --timeout 180s get -o ~/.zen/tmp/swarm/${znod} /ipns/${znod}
else
echo "____________ KNOW ${znod}"
# TODO : SPEEDUP REFRESH COMPARE _MySwarm.moats AND KEEP LATEST
fi
ZMOATS=$(cat ~/.zen/tmp/swarm/${znod}/_MySwarm.moats 2>/dev/null)
MOATS_SECONDS=$(${MY_PATH}/tools/MOATS2seconds.sh ${MOATS})
ZMOATS_SECONDS=$(${MY_PATH}/tools/MOATS2seconds.sh ${ZMOATS})
DIFF_SECONDS=$((MOATS_SECONDS - ZMOATS_SECONDS))
if [ ${DIFF_SECONDS} -gt $(( 3 * 24 * 60 * 60 )) ]; then
echo "STATION IS STUCK... FOR TOO LONG... REMOVING FROM SWARM"
rm -Rf ~/.zen/tmp/swarm/${znod}/
else
echo "${DIFF_SECONDS} seconds old"
fi
ZMOATS=$(cat ~/.zen/tmp/swarm/${znod}/_MySwarm.moats 2>/dev/null)
MOATS_SECONDS=$(${MY_PATH}/tools/MOATS2seconds.sh ${MOATS})
ZMOATS_SECONDS=$(${MY_PATH}/tools/MOATS2seconds.sh ${ZMOATS})
DIFF_SECONDS=$((MOATS_SECONDS - ZMOATS_SECONDS))
if [ ${DIFF_SECONDS} -gt $(( 3 * 24 * 60 * 60 )) ]; then
echo "STATION IS STUCK... FOR TOO LONG... REMOVING ${znod} FROM SWARM"
rm -Rf ~/.zen/tmp/swarm/${znod}/
else
echo "${DIFF_SECONDS} seconds old"
fi
done
echo "============================================"
done
echo "============================================"
fi ## IP4 WAN BOOTSRAP UPSYNC FINISHED
fi ## IP4 WAN BOOTSRAP UPSYNC FINISHED
done
done
#############################################
# ERASE EMPTY DIRECTORIES
du -b ~/.zen/tmp/swarm > /tmp/du
while read branch; do [[ $branch =~ "4096" ]] && echo "empty $branch" && rm -Rf $(echo $branch | cut -f 2 -d ' '); done < /tmp/du
############### UPDATE MySwarm CHAN
ls ~/.zen/tmp/swarm
SWARMSIZE=$(du -b ~/.zen/tmp/swarm | tail -n 1 | cut -f 1)
#############################################
# ERASE EMPTY DIRECTORIES
du -b ~/.zen/tmp/swarm > /tmp/du
while read branch; do [[ $branch =~ "4096" ]] && echo "empty $branch" && rm -Rf $(echo $branch | cut -f 2 -d ' '); done < /tmp/du
############### UPDATE MySwarm CHAN
ls ~/.zen/tmp/swarm
SWARMSIZE=$(du -b ~/.zen/tmp/swarm | tail -n 1 | cut -f 1)
## SIZE MODIFIED => PUBLISH MySwarm_${IPFSNODEID}
[[ ${SWARMSIZE} != $(cat ~/.zen/tmp/swarm/.bsize 2>/dev/null) ]] \
&& echo ${SWARMSIZE} > ~/.zen/tmp/swarm/.bsize \
&& SWARMH=$(ipfs add -rwq ~/.zen/tmp/swarm/* | tail -n 1 ) \
&& echo "=== ~/.zen/tmp/swarm EVOLVED : PUBLISHING NEW STATE ===" \
&& ipfs name publish --key "MySwarm_${IPFSNODEID}" /ipfs/${SWARMH}
#############################################
## SIZE MODIFIED => PUBLISH MySwarm_${IPFSNODEID}
[[ ${SWARMSIZE} != $(cat ~/.zen/tmp/swarm/.bsize 2>/dev/null) ]] \
&& echo ${SWARMSIZE} > ~/.zen/tmp/swarm/.bsize \
&& SWARMH=$(ipfs add -rwq ~/.zen/tmp/swarm/* | tail -n 1 ) \
&& echo "=== ~/.zen/tmp/swarm EVOLVED : PUBLISHING NEW STATE ===" \
&& ipfs name publish --key "MySwarm_${IPFSNODEID}" /ipfs/${SWARMH}
#############################################
######################################
############# RE PUBLISH SELF BALISE
######################################
############# RE PUBLISH SELF BALISE
# Clean Empty Directory (inode dependancy BUG ??)
du -b ~/.zen/tmp/${IPFSNODEID} > /tmp/du
while read branch; do [[ $branch =~ "4096" ]] && echo "empty $branch" && rm -Rf $(echo $branch | cut -f 2 -d ' '); done < /tmp/du
# Clean Empty Directory
du -b ~/.zen/tmp/${IPFSNODEID} > /tmp/du
while read branch; do [[ $branch =~ "4096" ]] && echo "empty $branch" && rm -Rf $(echo $branch | cut -f 2 -d ' '); done < /tmp/du
# Scan local cache
ls ~/.zen/tmp/${IPFSNODEID}/
BSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
# Scan IPFSNODEID cache
ls ~/.zen/tmp/${IPFSNODEID}/
BSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
## IPFS GET LAST PUBLISHED MAP VERSION
rm -Rf ~/.zen/tmp/_${IPFSNODEID} 2>/dev/null
mkdir -p ~/.zen/tmp/_${IPFSNODEID}
ipfs get -o ~/.zen/tmp/_${IPFSNODEID}/ /ipns/${IPFSNODEID}/
NSIZE=$(du -b ~/.zen/tmp/_${IPFSNODEID} | tail -n 1 | cut -f 1)
## IPFS GET LAST ONLINE IPFSNODEID MAP
rm -Rf ~/.zen/tmp/_${IPFSNODEID} 2>/dev/null
mkdir -p ~/.zen/tmp/_${IPFSNODEID}
ipfs get -o ~/.zen/tmp/_${IPFSNODEID}/ /ipns/${IPFSNODEID}/
NSIZE=$(du -b ~/.zen/tmp/_${IPFSNODEID} | tail -n 1 | cut -f 1)
### CHECK IF SIZE DIFFERENCE ?
## Local / IPNS size differ => FUSION LOCAL OVER ONLINE & PUBLISH
[[ ${BSIZE} != ${NSIZE} ]] \
&& echo "${MOATS}" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats \
&& MYCACHE=$(ipfs add -rwq ~/.zen/tmp/${IPFSNODEID}/* | tail -n 1 ) \
&& echo "PUBLISHING NEW BALISE STATE FOR STATION /ipns/${IPFSNODEID} INDEXES = $BSIZE octets" \
&& ipfs name publish /ipfs/${MYCACHE}
### CHECK IF SIZE DIFFERENCE ?
## Local / IPNS size differ => FUSION LOCAL OVER ONLINE & PUBLISH
[[ ${BSIZE} != ${NSIZE} ]] \
&& echo "${MOATS}" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats \
&& MYCACHE=$(ipfs add -rwq ~/.zen/tmp/${IPFSNODEID}/* | tail -n 1 ) \
&& echo "PUBLISHING NEW BALISE STATE FOR STATION /ipns/${IPFSNODEID} INDEXES = $BSIZE octets" \
&& ipfs name publish /ipfs/${MYCACHE}
end=`date +%s`
echo "(*__*) MySwam Update ($BSIZE B) duration was "`expr $end - $start`' seconds. '$(date)
end=`date +%s`
echo "(*__*) MySwam Update ($BSIZE B) duration was "`expr $end - $start`' seconds. '$(date)
) & ##### SUB-PROCESS
) & ##### SUB-PROCESS
# last run recording
echo "${MOATS}" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats
echo "$(date -u)" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.staom
# last run recording
echo "${MOATS}" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats
echo "$(date -u)" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.staom
else
@ -286,6 +290,7 @@ Content-Type: application/json; charset=UTF-8
if [[ $T2WAIT == 0 || $T2WAIT != $(cat ~/.zen/tmp/random.sleep 2>/dev/null) ]]; then
(
echo "# AUTO RELAUNCH IN $T2WAIT SECONDS"
echo $T2WAIT > ~/.zen/tmp/random.sleep
sleep $T2WAIT && rm ~/.zen/tmp/random.sleep
curl -s "http://127.0.0.1:12345"
@ -311,16 +316,16 @@ Content-Type: application/json; charset=UTF-8
#####################################################################
if [[ ${arr[0]} != "" ]]; then
## CHECK URL CONSISTENCY ( G1PUB=IPNSPUB is right ? )
## CHECK URL CONSISTENCY ( do we get G1PUB=IPNSPUB right ? )
GPUB=${arr[0]}
ASTROTOIPFS=$(${MY_PATH}/tools/g1_to_ipfs.py ${arr[0]} 2>/dev/null)
if [[ "${ASTROTOIPFS}" == "${arr[1]}" && ${ASTROTOIPFS} != "" && ${arr[1]} != "" ]]; then
## WE SPEAK THE SAME PROTOCOL
echo "MAJOR TOM TO GROUD CONTROL"
echo "WE HAVE A STATION ${GPUB} CONTACT"
(
mkdir -p ~/.zen/tmp/swarm/${ASTROTOIPFS}
echo "<<< MAJOR TOM TO GROUND CONTROL >>>"
echo "UPSYNC TO ~/.zen/tmp/swarm/${ASTROTOIPFS}"
ipfs --timeout 180s get -o ~/.zen/tmp/swarm/${ASTROTOIPFS} /ipns/${ASTROTOIPFS}
) &

BIN
adventure/.DS_Store vendored Normal file

Binary file not shown.

1
adventure/BLOCKCHAIN/Me Normal file
View File

@ -0,0 +1 @@

View File

@ -0,0 +1,8 @@
Salut Fredo, Moi c'est Tonio. J'ai 23 ans et je suis gentil.
Je suis en alternance à Thales Alenia Space où j'y développe des contrôles automatique pour la qualité logiciel. J'y développe aussi
des WebApps pour collecter des données d'utilisateurs afin de faire des dashboards.
J'ai beaucoup de passions dans la vida loca, j'aime beaucoup les jeux vidéos comme league of legends, teamfight tactics et minecraft (très
bon jeu), les mangas, la techno (hardcore, acid). J'adore cuisiner, je suis un expert des lasagnes et de la paella.

View File

@ -0,0 +1,13 @@
$VOTRECOMPTE
vboxuser
Quel OS utilisez vous?
windows sur mon ordi perso, j'ai deja utiliser linux dans mon ancien travail
Machine PERSO ou PRO ?
PERSO
Connaissances techniques particulières ?
pandas, palandir foundry, flask, python
Activités PRO actuelle ?
creation de pipeline destiné a la création de knowledgeGraph d'un gros client
Objectif souhaité ?
devenir data-engineer qualifié
Autre ...

View File

@ -0,0 +1,9 @@
me
---
OS: Fedora Workstation 39 x86_64
Connaissances techniques: Python, Bash, Docker, SQL, MongoDB, Power BI
Activité pro: Data analyst
Objectif souhaité: Utiliser la technologie blockchain dans un point de vue Data engineering

View File

@ -0,0 +1,17 @@
me
mon compte ?
Quel OS ?
Windows
Machine perso
Connaissances techniques particulières :
Talend, Digdash, Python, Sql, Machine Learning
Activité pro actuelle
Alternance Developpeuse decisionnelle
Objectif souhaité
Monter en compétences

View File

@ -0,0 +1 @@
Salut, je suis Nathan, 21 ans. Je suis en alternance en tant que Data Analyst où je fais surtout du Power BI. J'adore le foot et le PSG. Je suis à YNOV depuis le B3 et voilà

View File

@ -0,0 +1,5 @@
unix
Perso
DataEng/BI
DataEng/BI
Créé une blockchain de 0 sans utiliser un repos ou on connait pas le contenue, start from scratch, construire, stocker et requeter, pas de logiciel libre ou quoi que ce soit, blockchain local avec VM a la limite

View File

@ -0,0 +1,49 @@
#!/bin/bash
###################################################################
# This Launch script is based on BashVenture.
#
# Remember, kids - sharing is caring! Keep it open. Spread the love.
# - @BenNunney
# Thanks and gratitude to all living creatures and the whole creation.
# - @Fred
# $AGE×365,25×24×60×60×9,807÷299792458 = RELATIVE LIGHT GRAVITY SPEED
###################################################################
# Guide avancé d'écriture des scripts Bash : https://abs.traduc.org/abs-fr/
# GAMESHELL : https://github.com/phyver/GameShell/
###################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
###################################################################
### CREER VOTRE PROPRE VERSION DU JEU
### CHOISIR SCENARIO
###################################################################
if hash uuidgen 2>/dev/null; then
homefolder=$(pwd)
newplayer=$(uuidgen)
## Copy Player Game Files
mkdir -p $HOME/.zen/adventure/$newplayer
cp -r $MY_PATH/rooms $HOME/.zen/adventure/$newplayer/rooms
cp -r $MY_PATH/art $HOME/.zen/adventure/$newplayer/art
cp -r $MY_PATH/script $HOME/.zen/adventure/$newplayer/script
cp -r $MY_PATH/logic $HOME/.zen/adventure/$newplayer/logic
fi
###################################################################
echo "Loading..."
echo
sleep 4
###################################################################
if hash uuidgen 2>/dev/null; then
cd $HOME/.zen/adventure/$newplayer/rooms
else
cd rooms
fi
./start.sh
###################################################################
if hash uuidgen 2>/dev/null; then
cd "$homefolder"
rm -r $HOME/.zen/adventure/$newplayer
fi
echo "To continue..."
exit

View File

@ -0,0 +1,21 @@
.';:llllc;'.
.:xXWX;.,ll;.:XWXx;.
;0MMMMMMKl;'',l0MMMMMWO,
,0MMMMMMW0dc;,,;cd0WMMMMMMO.
dWMMMMM0; ;OMMMMMN:
dMMMMMN: .,'. cWMMMMMc
,WMMMMX. .xNMMMMNx,'lONMMMMMMN.
oMMMMM: :WMMMMMMMMMMMMMMMMMMMMc
xMMMMM' xMMMMMMOlllllllloNMMMMo
oMMMMMc ,NMMMMMWd. KMMMM:
.WMMMMN, .l0NWWWKc KMMMX.
cMMMMMWo .. KMMW;
cWMMMMMXo' .lKd. KMK'
.xWMMMMMMN0dlllldONMMMMWOXd
.xNMMMMMMMd''lWMMMMMMXo.
'lONWMW, .XMWXOl.
..,,..,,..

View File

@ -0,0 +1,21 @@
.':cdxxxxxoc;.
.:x00dc;'..:..,:lk00o'
;0Xd, oMo :OXx.
:KK; cMMMl .oNk.
.kN: ;MMMMMc xNl
.0K. ,WMMMMMW; ;Wo
OX. ,WMMMMMMMW; ;Wc
cM; .WMMMMMMMMMW, kX.
OX .NMMMMMMMMMMMW' ,Mc
O0 .NMMMMMMMMMMMMMW' .Mc
ON .XMMMMM0kkkkKMMMMN. ,M:
:M; KMMMMM: .,,;dMMMMMN. kX.
ON. 0MMMMMl ,WMMMMMMMMMMX. ;Wc
.0K. 0MMMMMd 'WMMMMMMMMMMMMX. :Wo
.xN: kMMMMMO .XWWWWNNNNNXXKKKd xNc
;0Xl. .oXx.
,OXx, .cOKd.
;d00xl:,....';coO0Ol'
.;:odddddl:,.

View File

@ -0,0 +1,21 @@
MMMMMMMMMMMMMMMMMMMl xxlxxxd . KNNMNl. 'd0xdddkXKxc. ,dNMMMMMMMMMMMMMMM
MMMMMMMMMMMWKOl:cc' .NNOMXNX .ld; ,lxXMMMMMMMMMMM
MMMMMMMMNo. ,,' .KKWMOXX .. .dWMMMMMMMM
MMMMMMWc cdddc .NNNMXNX .do '' ' .:,:k; l, .KMMMMMMM
MMMMMW, ;ll: .,:ddddd .KKOM0XX .do '0MMXMo . dMMMMMMXOMX0: XMMMMMM
MMMMMo xc:d 'ddddddd .XXWMK00' .do .oo. .dMMMMMMO;lWNMMMMMMWXMMMX: :MMMMMM
MMMMW. .cXKKXWooK0kk0d0Oxxkkx .XXNM0Ok; .:ol:'do,0MMK ... 'XMMMMMMMMMMMMMMMMMWWMMMMx .dkONMM
MKNK. NMWooOWllKKoMNll0MM0x0 xNXXOMKOkKOoM0kkkOkWMMMM0NWWXXMMMMMMMMMMW:WkWk0OKMWdOMNxd0O. .KM
l dkkMMWloOWcc0KoMNccOMMxl0cMMXXWM0KOMMMM0OkkOKMMMMMMMMMMMMMMMMMMMMM0 : o.. 'll.lMMMMMMx .O
;kMMMMMWlckWooKXdMNccOMMxlXk0MMMNMMMMMMMM0OkkOWMMMMMMMMMMMMMMMMMMMMMMo0OWW,xNWKcooMM0NN0Oc
.NMMMMMMNllkWllKKoMNll0MMxlNxOMMMOMMMMMMMM0OkOOWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNMMNdxMMMk
;WMMMMMMMMMMMNNWWNMMMMMMMWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWMWx.
:MMkxxxWMMMWkxxxxxxxWXxxxxxxxxKWxxxxxxxxxWMMKxxxxxxKMMKxxxxxxxxKMMXxxxxxx0MMkxxxxxxxxNMXxdlloodO:
:N, OMM0. 'N. 0: :Mc XK Nx kl ,N. ;'
x..M0xddddKMMOddddddddKKddddddddxNxdddddddddOWoooooooooN0ddddddddddNdoooooooo0xdddddddddkKdddddddox.
MWKK ,MN. .,XMMMMl ;MMMM' xc 'MMd .Mx ;x .NMO N; dMMMl ,W
MMMK NM:. 'MMMW. xMMMO dW. oMM. lM' .:N, ;MM; ;K oMMMW. dO
MMMMMMMo xXXXXXk .MMMO NMMM; .WWN. 00 XM0 KK 0WWWWMMW OMX kc .WWW. OMMMO Nc
MMMMMMMX dMMM; ;MMMN dMMk N0 .. oMl .MMMMMMMN ... :W. lMM0 XMMM; ;M' .c
MMMMMMMM, .xMMMW. kMMMx .NMM: cMMd. .;0MM. oMMMMMMMMk. .,kMO XMMl :MMMW. kMOKMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

View File

@ -0,0 +1,21 @@
.,'.
.,,;,'',;,'',,.'.
.;;,,.. .........'
.l:. ............cc.
.c, .................:c.
.lc ................... .l;
l' ... .............. c:
:: .. ........... l'
d . .''...... 'o
.o .. ''''''. l
.d . ......''''''' l
o . .,,,,,,'''''' 'l
;: . ',,,,''''', l.
l, .. .,,,''''', oc
.lc .',,,''',. .c,
'l, .,,''',..:c.
';;. .,,',,:;.
':;;'. .;:,,,.
.,,'''''','..;,,.
,:.
.,

View File

@ -0,0 +1,9 @@
_______ _ ______ _
|__ __| | | ____| | |
| | | |__ ___ | |__ _ __ __| |
| | | '_ \ / _ \ | __| | '_ \ / _` |
| | | | | | __/ | |____| | | | (_| |_
|_| |_| |_|\___| |______|_| |_|\__,_(_)

View File

@ -0,0 +1,21 @@
.:dO0NNkNX0ko,.
.:OWMMMMMMc cWMMMMMXd,
'kWMMMMMMMMc cWMMMMMMMNo.
.kMMMMMMMMMMo lMMMMMMMMMWl
.KMMMMMMMMMMd oMMMMMMMMMMx
.XMMMMMMMMMMk dMMMMMMMMMMx
xMMMMMMMMMM0 OMMMMMMMMMM,
.NMMMMMMMMMK. OMMMMMMMMMk
'MMMMMMMMMK. OMMMMMMMMK
.NMMMMMMMK. ,;;;;' OMMMMMMMx
dMMMMMMX. kMKkxxc 0MMMMMM,
.KMMMMN. dMx .KMMMMd
.0MMN. cMx .KMMd
xW' 'W0. ......:Xc
.lXNNWNWMMMMMMMMMMMMMMMMXl
;xXMMMMMMMMMMMMMMWKo'
.,lxkKKKK0kdc'

View File

@ -0,0 +1,10 @@
_____ _ _
/ ____| (_) | |
| (___ _ _ _ __ _ __ _ __ _ ___ ___| |
\___ \| | | | '__| '_ \| '__| / __|/ _ \ |
____) | |_| | | | |_) | | | \__ \ __/_|
|_____/ \__,_|_| | .__/|_| |_|___/\___(_)
| |
|_|

View File

@ -0,0 +1,9 @@
_ _ _ ____ ___ _ ____
/ \ ___| |_ _ __ ___ _ __ ___ _ __| |_ |___ \ / _ \ _ / |___ \
/ _ \ / __| __| '__/ _ \| '_ \ / _ \| '__| __| __) | | | | (_) | | __) |
/ ___ \\__ \ |_| | | (_) | |_) | (_) | | | |_ / __/| |_| | _ | |/ __/
/_/ \_\___/\__|_| \___/| .__/ \___/|_| \__| |_____|\___/ (_) |_|_____|
|_|
--- Un JEu de Forêt Jardin en Monnaie Libre sur IPFS ---

View File

@ -0,0 +1 @@
on

View File

@ -0,0 +1 @@
off

View File

@ -0,0 +1,2 @@
Pour voir les nouvelles fonctionnalités il faut monter tout au nord et rejoindre le Valhalla.

View File

@ -0,0 +1,58 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
# This is close to the endgame, but affords the player a last set of things to try and do.
# Obviously if you use this framework to create a game of your own, you can extend this massively.
echo
sleep 1
echo "Vous décidez de sortir de la Sation Astroport."
echo
echoleverstate=`cat ../logic/stationlogic.ben`
if [ "$leverstate" = "on" ]; then
sleep 2
echo "Il ne dépend que de vous d'explorer ce nouveau futur."
echo "Le Visa MadeInZion inaugure un monde sans territoire, sans frontière, transnationnal, interplanétaire, à vous de voir?"
sleep 2
echo "Avant de nous rejoindre. Visitez notre 'bon coin' https://gchange.fr "
echo
sleep 3
echo "Ouvrez une ambassade? Installez IPFS, devenons hébergeur, fournisseur d'accès de nos Internets."
echo
sleep 4
echo "Ouvrez votre propriété au futur en commun, activez Astroport."
echo "Nous organisons des formations habitats posés, vissés et cousus. Eau potable. Biogaz, Marmite Norvégienne..."
echo "Comment nourrir le sol, reconnaitre les plantes... Redevenir ceuilleur, créateur."
echo
else
echo ""
echo "Aucune entrée n'est visible."
fi
echo
sleep 5
echo
echo "Que voulez vous faire?"
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Pas moyen de se déplacer." ;;
s ) echo ".Pas le choix." ;;
e ) echo "Pas par là." ;;
w ) echo "Plus à l'ouest que ça? Y'a pas!" ;;
u ) ./end.sh
exit ;;
h ) echo "Comment refuser une telle proposition..." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,62 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
sleep 1
# Here's this room's script.
echo "Sur la direction du sud, vous traversez une zone plus sombre et humide."
echo "Le sol est glissant à cause de l'argile qui colle sous vos bottes"
echo "Vous finissez par croiser un chemin qui traverse la forêt d'Est en Ouest"
echo
echo "Un terminal informatique est installé là."
echo
echo "Il ressemble à une grosse calculatrice"
# Here we tell the player whether the lever is on or off.
leverstate=`cat ../logic/leverlogic.ben`
if [ "$leverstate" = "on" ]; then
echo "'VISA SVP' clignote sur l'écran..."
else
echo "La machine affiche l'heure : 20:12"
fi
echo
echo "Il est tard pour explorer le chemin à pied, vous devriez retourner d'où vous venez."
echo
echo "Que faites vous?"
# In this set of actons lies the logic switch used later in the game.
# You have to set this switch to reach the endgame.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) ./mainroom.sh
exit ;;
s ) echo "Si vous continuez à marcher dans la forêt. Vous allez vous perdre..." ;;
e ) echo "Le chemin qui part à l'Est est plein de boue... Impossble d'aller par là." ;;
w ) echo "Une rivière vous empêche de passer." ;;
u ) leverstate=`cat ../logic/leverlogic.ben`
if [ "$leverstate" = "on" ]; then
echo "A chaque frappe d'une touche. l'écran fait défiler le texte 'SCANNEZ VISA SVP'."
else
sed -i='' 's/off/on/' ../logic/leverlogic.ben
echo "Vous pianotez sur l'appareil..."
sleep 3
echo "A moment où vous touchez la touche '#' L'écran se met à clignoter..."
echo "Puis le message 'ACTIVATION STATION' défile sur les caractères lumineux."
fi
;;
h ) echo "Le terminal comporte un clavier numérique. Un petit écran.. Il est réalisé avec un mini ordinateur Raspberry Pi. Il porte l'adresse G1TAG [https://g1sms.fr]" ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,71 @@
#!/bin/bash
clear
# This is the endgame. This file does nothing but give you the final bit of storyline.
# Use (over-use) of 'sleep' is for dramatic effect - play around with it, see how it reads.
# Let's reset the lever, now that we're done with it.
sed -i='' 's/on/off/' ../logic/leverlogic.ben
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
sleep 1
echo "Voici la fin de cette petite aventure."
echo
sleep 4
echo "Vous venez de visiter la forêt où s'est posé Astroport ONE."
sleep 3
echo
echo "Une oeuvre habitable. Un jardin sur sol vivant. Un progamme pair à pair interplanétaire"
sleep 4
echo
echo "Les terraformeurs"
echo "En quête de la meilleure façon de vivre sur le vaisseau spatial Terre..."
echo
sleep 5
echo "Vous aussi ouvrez votre Ambassade."
echo "Activez le JEu. Invitez vos visiteurs à rêver d'un monde meilleur"
echo "Reproduisez, améliorez, partagez les plans pour y parvenir."
echo
sleep 7
echo "Il est l'heure de laisser derrière vous la civilisation thermo industrielle."
echo "Gagnez en autonomie, en convivialité, en optimisme, en conscience."
echo
sleep 5
echo
echo "EMBARQUEZ VERS LE FUTUR"
echo
sleep 9
echo
file1="../art/bigfinish.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
echo
read -p "Appuyez sur [ENTER] pour terminer..."
echo
clear
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
echo "Merci d'avoir joué le jeu"
echo "Je suis heureux de vous avoir fait partager le rêve des astronautes terraformeurs."
echo
echo "Le futur ne se prédit pas, il se construit. Il se vit."
echo
echo " - @Fred"
echo
# That's all, folks!
exit

View File

@ -0,0 +1,88 @@
#!/bin/bash
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# This room gives the player a typical poisoned apple style scenaro.
# Just because something looks shiny and fun, doesn't make it any
# less deadly.
sleep 1
echo "Dans une cabine, un écran est disposé en coin. Un tout petit ordinateur"
echo "y est raccordé... D'autres fils sortent de l'appareil. Une webcam. Une imprimante."
echo
echo "Que voulez vous faire?"
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1"
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Vous êtes dans une cabine. Des QRCode sont collés à la parois nord" ;;
s ) echo "Cette paroie comporte un miroir. Pour se faire une beauté avant d'enregistrer une capsule vidéo." ;;
w ) ./kroo.sh
exit ;;
e ) echo "Vous êtes face à l'écran. Au dessus des hauts parleurs, une webcam" ;;
u ) leverstate=`cat ../logic/stationlogic.ben`
if [ "$leverstate" = "on" ]; then
echo "A chaque frappe d'une touche. l'écran fait défiler le texte 'SCANNEZ VISA SVP'."
else
sed -i='' 's/off/on/' ../logic/stationlogic.ben
echo "Vous appuyez sur l'interupteur de l'écran. Y apparaît alors :"
sleep 3
echo "AMBASSADE MadeInZion - TerraPi4 - 2 To -"
echo ""
echo
sleep 2
echo "INTERNET est dangereux. il vend vos information personnelles pour que vous deveniez un produit. "
sleep 2
echo
echo "Rebootez INTERNET. Activez votre TW sur le Système de Fichiers Interplanétaire (IPFS)."
sleep 2
echo
echo "On y échange en pair à pair. La monnaie y est Libre."
sleep 4
file1="../art/astrored.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
echo
echo "____ Astroport déclenche à 20:12 la synchronisation de ses ambassades..."
echo "Rapport 2022 : https://ipfs.asycn.io/ipfs/QmUtGpGeMZvwp47ftqebVmoFWCmvroy5wEtWsKvWvDWJpR"
sleep 3
echo
echo "ASTROPORT ONE"
echo "VISA pour le vaisseau spatial TERRE."
if [[ -d ~/.zen/Astroport.ONE ]]; then
read -p "Appuyez sur [ENTER] pour activer votre Station Astroport.ONE"
espeak "Astroport Command" > /dev/null 2>&1
~/.zen/Astroport.ONE/command.sh
else
espeak "Please Install Astroport" > /dev/null 2>&1
echo "Install Astroport.ONE ..."
echo "bash <(wget -qO- https://raw.githubusercontent.com/papiche/Astroport.ONE/master/install.sh)"
./end.sh
fi
fi
exit
;;
h ) echo "'DEMARRER API http://$myIP:1234 ... Une Station Astroport.ONE.?." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,38 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# Everybody clap your hands. I mean, here is the script.
sleep 1
echo "Vous atteignez une zone remplie de jeunes épineux"
echo "Vous reconnaissez des prunus, des aubépines."
echo "Quelques génévriers dont vous remarquez les baies noires."
echo "Un peu plus loin ce sont les ronces."
echo
echo "Plus vous progressez plus vous souffrez des épines. Existe-t-il un passage? Qui sait."
echo
echo "Que voulez vous faire?"
# And here's what you could have won...
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Un énorme roncier vous barre la route. Ca ne passe pas." ;;
s ) echo "Vers le sud, aucun passage en vue." ;;
e ) ./mainroom.sh
exit ;;
w ) echo "Vous voyez le même paysage à perte de vue" ;;
u ) echo "Vous cueillez une baie de genèvrier. Vous la portez à la bouche. Croquez. La saveur est délicieuse. La force de la plante vous envahi." ;;
h ) echo "Ce type de terrain est caractéritique des zones déboisées. La nature sort ses épines pour protéger les arbres qui poussent en dessous." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,35 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# I like this room. There is no way to get out of it alive.
sleep 1
echo "Un évier derrière une fenère, une ancienne porte d'armoire comme table."
echo "Un meuble fait de planches de bois cousues rempli de bocaux"
echo "Une glacière recouverte d'une couche d'isolant Un bruleur à gaz."
echo "C'est un espace pour cuisiner."
sleep 3
echo
echo "Vous avez soif. Un filtre à eau gravitationnel vous fait face"
echo "vous attraper un gobelet et le remplissez à raz bord du liquide de la bombone"
echo "Vous portez le verre à vos lèvres..."
echo
sleep 5
echo "A la première gorgée vous vous sentez ramolir. Comment savoir combien vous avez bu"
echo "quand votre corps devenu impossible à garder droit s'est éffondré sur le sol."
echo "Simplement le temps de vous demander pourquoi?"
echo
echo "Vous sombrez dans l'inconscience."
sleep 4
echo "VOUS VOUS SENTEZ DECOLLER."
echo
read -p "Appuyez sur [ENTER] pour revenir..."
./mainroom.sh
exit

View File

@ -0,0 +1,58 @@
#!/bin/bash
clear
# This room gets a little artsy with sleep commands, to help with the
# narrative of the story. This is why there are two versions - foyer and foyer2.
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# It's script time again...
sleep 1
echo "Vous pénétrez à l'intérieur de l'Astroport."
echo
sleep 3
echo "Une voix synthétique vous accueille."
espeak "Welcome. Please Identify." > /dev/null 2>&1
echo
echo "Vous parcourez l'espace du regard"
echo "Au nord, face à vous se trouve un foyer où brule un feu."
echo
sleep 3
echo "A l'ouest sont suspendus tuyaux, ustensiles et bocaux. Une cuisine?"
echo "A l'est il y a un genre de 'photomaton' "
sleep 2
echo "Derrière vous, la porte par où vous êtes entré est encore ouverte."
echo
echo "Que voulez vous faire?"
# And once again the room logic.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Vous vous asseyez sur le grand tapis devant le feu. Vous vous relaxez un instant."
./magic8.sh
;;
s ) ./bigroom.sh
exit ;;
e ) ./gameroom.sh
exit ;;
w ) ./grue.sh
exit ;;
u ) echo "Vous tapotez sur le barmoètre. Une photo satellite?"
./meteofrance.sh
exit
;;
h ) echo "La pièce est spacieuse. La chaleur du feu agréable, à gauche on dirait une cuisine explosée, à droite une chaise moletonnée fait face à un écran." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,40 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# So here's a little story all about how this script got flip-turned upside down...
sleep 1
echo "You're in a corridor, but it's quite a small one. You got here"
echo "the first time by hugging a statue of a kitten. Standard."
echo
echo "You see a glow coming from the rooms to your east and west, and"
echo "there's a big, old looking door to the south of you."
echo
echo "What would you like to do?"
# Imma let you finish, but here's the room choices.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "You faceplant the wall. Idiot." ;;
s ) ./bigroom.sh
exit ;;
e ) ./gameroom.sh
exit ;;
w ) ./grue.sh
exit ;;
u ) echo "There's nothing you can use right here." ;;
h ) echo "After hugging that cat you aren't sure you should try to hug yourself again." ;;
* ) echo "I'm sorry, I don't understand you. Commands are: n, e, s, w, u and h.";;
esac
done
esac
exit

View File

@ -0,0 +1,29 @@
#!/bin/bash
# magic 8 ball. Yup. Pick a random number, output message
# source: https://www.linuxjournal.com/content/bash-shell-games-lets-play-go-fish
answers=("Oui c'est certain." "C'est carrément ça."
"Sans aucun doute." "Oui - assurément."
"Comptez la dessus." "Comme je le vois, oui." "Très probablement."
"Bonne perspective." "Oui." "Les signes indiquent que oui."
"Réponse floue, essayez à nouveau." "Redemandez plus tard."
"Il vaut mieux ne pas vous le dire maintenant.." "Impossible de prédire maintenant."
"Concentrez-vous et demandez à nouveau." "N'y comptez pas."
"Ma réponse est non." "Mes sources disent que non."
"Rien de bon." "Très douteux.")
echo "Oh ! Boule magique, dis-moi la vérité, s'il te plaît...." ; echo ""
/bin/echo -n "Quelle est votre question ? "
read question
answer=$(( $RANDOM % 20 ))
echo ""
echo "J'ai regardé dans le futur et je dis: "
echo " ${answers[$answer]}" ; echo ""
sleep 3
./mainroom.sh
exit

View File

@ -0,0 +1,45 @@
#!/bin/bash
clear
# This is a repeat of the opening room in the start.sh file - if the player
# wants to go back to the main room, this saves going through the whole
# start script over again.
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# Shakesphere wrote this, honest.
sleep 1
echo "Vous êtes de retour à votre point de départ."
echo "La forêt qui vous entoure est immense."
echo "Vous ne pouvez pas vraiment en imaginer la taille,"
echo
echo "Vous pouvez vous diriger au nord, à l'est, au sud et à l'ouest."
echo
echo "Que voulez-vous faire ?"
# And the room logic once again.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) ./white.sh
exit ;;
s ) ./brown.sh
exit ;;
e ) ./red.sh
exit ;;
w ) ./green.sh
exit ;;
u ) echo "Il n'y a rien que vous puissiez utiliser ici." ;;
h ) echo "Vous observez votre montre, il est 20:12" ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,58 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}
################################################################################
# Choisir la source de capture
# https://fr.sat24.com/image?type=visual5HDComplete&region=fr
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
## TEST IPFS
[[ ! $(which ipfs) ]] && echo "Missing IPFS. Please install... https://ipfs.tech" && exit 1
## PREPARE FILE SYSTEM CACHE
mkdir -p ~/.zen/adventure/meteo.anim.eu
rm -f ~/.zen/adventure/meteo.anim.eu/meteo.png
## SCRAPING meteo.png
curl -m 20 --output ~/.zen/adventure/meteo.anim.eu/meteo.png https://s.w-x.co/staticmaps/wu/wu/satir1200_cur/europ/animate.png
if [[ ! -f ~/.zen/adventure/meteo.anim.eu/meteo.png ]]; then
echo "Impossible de se connecter au service meteo"
exit 1
else
echo "Mise à jour archive meteo : ${MOATS}"
echo ${MOATS} > ~/.zen/adventure/meteo.anim.eu/.moats
OLDID=$(cat ~/.zen/adventure/.meteo.index 2>/dev/null)
# TODO : COMPARE SIMILAR OR NOT
# ipfs get "/ipfs/$OLDID/meteo.anim.eu/meteo.png"
## PREPARE NEW index.html
sed "s/_OLDID_/$OLDID/g" ${MY_PATH}/../templates/meteo_chain.html > /tmp/index.html
sed -i "s/_IPFSID_/$IPFSID/g" /tmp/index.html
sed -i "s/_DATE_/$(date -u "+%Y-%m-%d#%H:%M:%S")/g" /tmp/index.html
sed "s/_PSEUDO_/${USER}/g" /tmp/index.html > ~/.zen/adventure/index.html
# Copy style css
cp -r ${MY_PATH}/../templates/styles ~/.zen/adventure/
INDEXID=$(ipfs add -rHq ~/.zen/adventure/* | tail -n 1)
echo $INDEXID > ~/.zen/adventure/.meteo.index
echo "METEO INDEX : http://127.0.0.1:8080/ipfs/$INDEXID"
IPFS=$(ipfs add -q ~/.zen/adventure/meteo.anim.eu/meteo.png | tail -n 1)
echo $IPFS > ~/.zen/adventure/meteo.anim.eu/.chain
fi

View File

@ -0,0 +1,41 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# Set up the script for this room. It's a simple one!
sleep 1
echo "Vous entrez dans l'ancienne bergerie."
echo "Un canapé mauve est installé au milieu de l'espace"
echo "Une bache transparente vous sépare du ciel."
echo
echo "Vous êtes dans une serre."
echo "Une seule sortie. A l'Ouest, d'où vous venez."
echo
echo "Que voulez-vous faire?"
# And the choices go here.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Une fente dans le mur vous laisse observer une carcasse de voiture. Une vieille 2cv. Un grillage vous empêche de passer." ;;
s ) echo "L'emplacement d'un grand feu se trouve la. Il ne reste que de la cendre." ;;
e ) echo "Une autre pièce remplie de gravats et d'éboulis se trouve devant vous. Impossible d'y accéder." ;;
w ) ./mainroom.sh
exit ;;
u ) echo "Vous vous asseyez dans le canapé. Vous vous sentez immédiatement happé par un nuage."
sleep 2
xdg-open "https://www.copylaradio.com/blog/blog-1/post/le-pas-a-pas-qui-libere-du-grand-mechant-cloud-36#scrollTop=0"
;;
h ) echo "Aucun détail particulier si ce n'est une tache sur le sofa." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,72 @@
#!/bin/bash
clear
# Logic in the game is stored in .ben files. This sample has just one 'logic' file.
# You can add more logic files by simply adding a 'sed' command and appropriate .ben file.
# First off, let us reset the game logic. Use this as an example.
sed -i='' 's/on/off/' ../logic/leverlogic.ben
# Who doen't love ASCII text, right?
# Next up, let's initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
# Next up, let's load in the initial introduction. Script is also stored in .ben files.
sleep 5
file2="../script/opening.ben"
while IFS= read -r line
do
echo "$line"
done <"$file2"
read -p "Pressez sur [ENTER] pour démarrer..."
#Okay, now that the introduction is out of the way, we can start the first room!
clear
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
sleep 1
# Here's where you introduce the room to the player. Be sure to tell them if there
# Are exits - but don't give too much away. Make it fun for them to explore!
echo
echo "La téléportation vous a placé debout au centre d'une clairière."
echo "Vous vous trouvez près d'une ancienne bergerie aux gros murs de pierres."
echo "Le toit et une bonne partie des murs sont effondrés."
echo
echo "Tout autour la forêt. Des feuillus. Quelques arbustres épineux."
echo "Sous vos pieds. Le sol est rouge parsemé de cailloux blancs."
echo
echo "Vous pouvez vous diriger selon les points cardinaux."
echo "Au nord un chemin remonte, au sud un passage descend, à l'est, la bergerie, à l'ouest, des traces d'animaux"
echo
echo "Que voulez-vous faire? Les commandes sont : n, e, s, w, u et h."
# Now we wait for their response - and send them somewhere accordingly.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) ./white.sh
exit ;; # These lines will take the player to a new room - a new script file.
s ) ./brown.sh
exit ;; # Be sure to include 'exit' otherwise the game won't quit properly!
e ) ./red.sh
exit ;;
w ) ./green.sh
exit ;;
u ) echo "Vous ouvrez votre sac il contient une tente, des vêtements, un thermos, une scie pliante et un couteau" ;; # Something to say? You can also just echo.
h ) echo "Comment avez-vous pu arriver ici.? Des souvenirs vous reviennent... https://ipfs.copylaradio.com/ipfs/QmWyCFvvvrE1xWudCnc14oDvaztLaRZ4guvQFVkkDLwa23#JOUR%201.%20PLANETE%201." ;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,45 @@
#!/bin/bash
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
echo "Bienvenue dans la quête du Valhalla"
sleep 1
echo "Vous vous tenez devant les portes massives du Valhalla, le grand hall où"
echo "les guerriers les plus valeureux reposent en paix, attendant Ragnarök."
echo "Quelle action souhaitez-vous entreprendre? "
while true; do
read -p "> " action
case $action in
n ) echo "Vous avancez vers le nord, à travers les brumes épaisses, cherchant l'entrée."
sleep 2
echo "Vous êtes monter trop haut au nord, vous vous retrouvez au valhalla ... "
sleep 1
echo "Les dieux chuchotent ... Pour sortir du Valhalla : ctrl+shift+$ et quit"
sleep 3
telnet valhalla.com 4242
echo "Vous tombez du Valhalla et retourner au point de départ"
sleep 4
./start.sh;;
s ) echo "Au sud s'étend la vaste plaine de Vigrid, où la bataille finale est destinée à se dérouler." ;;
e ) echo "À l'est, vous trouvez un ancien ruisseau dont les eaux murmurent des histoires des temps passés." ;;
w ) echo "À l'ouest, se dressent les montagnes, où les géants se cachent, préparant leur assaut contre les dieux." ;;
o ) echo "Vous offrez une prière aux dieux, espérant gagner leur faveur pour entrer dans le Valhalla." ;;
c ) echo "Loki s'est emparer de votre ordinateur, fuyez pauvre fou !!!!!."
image_url="https://ia904505.us.archive.org/9/items/download-5_20210715/download%20%285%29.jpeg"
image_path="./download (5).jpeg"
wget "$image_path"
gsettings set org.gnome.desktop.background picture-uri "$image_path"
echo "Le fond d'écran a été changé avec succès.";;
* ) echo "Les actions possibles sont : n (nord), s (sud), e (est), w (ouest), o (offrir une prière), c (crier un défi)." ;;
esac
done

View File

@ -0,0 +1,66 @@
#!/bin/bash
clear
# Initialise the Title Art
file1="../art/titleart.ben"
while IFS= read -r line
do
echo "$line"
done <"$file1"
echo
#Setting up the room...
sleep 1
echo "Vous parcourez un chemin qui monte en direction du nord.."
echo "Au sommet de cette petite colline vous découvrez un magestueux chêne"
echo "trônant au centre d'une clairière lumineuse. La forêt à cet endroit"
echo "forme un cercle tout autour..."
echo
echo "Un Astroport fait de vitres, de planches, de tôles et de chevrons"
echo "est posé là. Eclairé par les rayons du soleil."
echo
# Here we're going to check to see if the lever - the only logic we are using in this game - is on or off.
leverstate=`cat ../logic/leverlogic.ben`
if [ "$leverstate" = "on" ]; then
echo "Une poignée est apparue sur la porte de la façade..."
else
echo "Vous en faites le tour..."
echo "Aucune entrée n'est visible."
fi
echo
echo "Pas d'autre chemin praticable que celui d'où vous venez."
echo
echo "Que voulez-vous faire ?"
# Now lets capture this room's actions. Note that here, the actions change depending on whether or not
# the lever is on or off. If it's on, you go elsewhere. If it's off, you don't.
while true; do
read -p "> " nsewuh
case $nsewuh in
n ) echo "Vous vous aventurez dans la forêt plus au nord. Sans boussole, vous allez vous perdre rapidement... "
sleep 3
echo "Vous vous êtes perdu... Au loin vous voyez le Valhalla"
./valhalla.sh;;
s ) ./mainroom.sh
exit ;;
e ) echo "Une corniche surplombe un ruisseau qui coule dans le fond de la ravine. Impossible de passer sans équipement" ;;
w ) echo "Vous voilà face à un Jardin luxuriant. Une cloture électrique le délimite et en empêche l'accès." ;;
h ) echo "Vous voyez à l'interieur de la Station une video en cours de projection..."
sleep 2
xdg-open "https://www.youtube.com/embed/Yk-WRXKysXM"
;;
u ) leverstate=`cat ../logic/leverlogic.ben`
if [ "$leverstate" = "on" ]; then
./kroo.sh
exit
else
echo "Vous cherchez une ouverture... Pas la moindre. Impossible d'entrer sans commettre une effraction..."
fi
;;
* ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w, u et h..";;
esac
done
esac
exit

View File

@ -0,0 +1,23 @@
Message de la Confédération Interplanétaire
La planète où vous vous trouvez est en danger. Les menaces sont nombreuses.
Vos gouvernements se disputent les dernières ressources. Le cycle du vivant est perturbé !
Le "contrat social" des 'pays civilisés' vascille. Les technocrates réclament plus de contrôle.
La commission extraterrestre est formelle. Vous êtes en danger.
Heureusement la monnaie libre a été découverte sur votre planète!
Elle s'utilise dans un jeu 'grandeur nature'. Astroport 20:12
Bienvenue dans l'aventure du changement de civilisation.
Les commandes pour vous déplacer et interagir sont
'n' aller au nord,
's' aller au sud,
'e' aller à l'est,
'w' aller à l'ouest,
'u' utiliser,
'h' observer plus en détail.
Ctrl-C pour quitter.
- - -

View File

@ -57,18 +57,18 @@ mot_passe_vocal(){
# Début du jeu
clear
echo "
_| _|
_| _| _|_| _| _| _|_|_| _|_|_|
_| _| _| _| _| _| _| _| _|
_| _| _| _| _| _| _| _| _|
_| _|_| _|_|_| _| _| _|_|_|
_|
_|_|
_| _| _|
_| _| _|_|_| _|_|_| _| _| _|_| _| _|_|
_|_|_|_| _| _| _| _|_| _|_|_|_| _|_|
_| _| _| _| _| _| _| _| _|
_| _| _|_|_| _|_|_| _| _| _|_|_| _|
_| _|
_| _| _|_| _| _| _|_|_| _|_|_|
_| _| _| _| _| _| _| _| _|
_| _| _| _| _| _| _| _| _|
_| _|_| _|_|_| _| _| _|_|_|
_|
_|_|
_| _| _|
_| _| _|_|_| _|_|_| _| _| _|_| _| _|_|
_|_|_|_| _| _| _| _|_| _|_|_|_| _|_|
_| _| _| _| _| _| _| _| _|
_| _| _|_|_| _|_|_| _| _| _|_|_| _|
"
sleep 1

View File

@ -0,0 +1,26 @@
# Rémi Montagut
# CONSIGNES
* Connaître les commandes de base de PowerShell ou Shell pour un usage quotidien
* Gérer les utilisateurs avec des scripts
* Automatiser ladministration des stations de travail et des serveurs
* Ecrire des scripts sous Windows avec PowerShell
* Savoir programmer et debugger un shellscript
Expériences
--
Alternance en tant qu'ingénieur devops, SHELL, Jenkis, Ansible
OS
--
Mac OS ( ARM ) / Proxmox à disposition pour virtualiser
Votre machine ou celle de votre boite ?
la mienne
Activité de votre alternance ?
ingénieur devops

View File

@ -20,9 +20,9 @@ start=`date +%s`
################################################################### IPFS
########################################################################
[[ ! $(which ipfs) ]] \
&& echo "bash <(wget -qO- https://git.p2p.legal/qo-op/Astroport.ONE/raw/branch/master/kubo_v0.20.0_linux.install.sh)" \
&& echo "bash <(wget -qO- https://git.p2p.legal/qo-op/Astroport.ONE/raw/branch/master/install.kubo_v0.20.0_linux.sh)" \
&& architecture=$(uname -m) && [[ $architecture == "x86_64" || $architecture == "aarch64" || "$architecture" == "armv7l" ]] \
&& bash <(wget -qO- https://raw.githubusercontent.com/papiche/Astroport.ONE/master/kubo_v0.20.0_linux.install.sh) \
&& bash <(wget -qO- https://raw.githubusercontent.com/papiche/Astroport.ONE/master/install.kubo_v0.20.0_linux.sh) \
|| echo "=== IPFS FOUND === OK"
[[ ! $(which ipfs) ]] && echo "INSTALL IPFS PLEASE" && exit 1
@ -44,7 +44,7 @@ echo "#############################################"
echo "######### INSTALL BASE & PYTHON3 PACKAGE ####"
echo "#############################################"
for i in git make cmake docker-compose fail2ban npm shellcheck netcat-traditional ncdu chromium miller inotify-tools curl net-tools libsodium* libcurl4-openssl-dev python3-pip python3-setuptools python3-wheel python3-dotenv python3-gpg python3-jwcrypto python3-brotli python3-aiohttp mpack; do
for i in git make cmake docker-compose fail2ban npm shellcheck socat netcat-traditional ncdu chromium miller inotify-tools curl net-tools libsodium* libcurl4-openssl-dev python3-pip python3-setuptools python3-wheel python3-dotenv python3-gpg python3-jwcrypto python3-brotli python3-aiohttp mpack; do
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo ">>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
sudo apt install -y $i

5
templates/P4N/all.min.css vendored Normal file

File diff suppressed because one or more lines are too long

BIN
templates/P4N/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -3,8 +3,12 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="./favicon.ico">
<title>UPlanet _UMAP_ _SERVICE_ Data</title>
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmUBL1cAkKbwnkxCcjvN6B9ydgoNgYGt1sYBqij8Wy2AjS/leaflet.css" />
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmZX8YdRWqqJFirdDg1z66Suy7JQrWWufTjPeX51mGoQix/leaflet.css" />
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmZX8YdRWqqJFirdDg1z66Suy7JQrWWufTjPeX51mGoQix/leaflet.awesome-markers.css" />
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmZX8YdRWqqJFirdDg1z66Suy7JQrWWufTjPeX51mGoQix/all.min.css" />
<style>
body {
margin: 0;
@ -25,54 +29,177 @@
color: #fff;
padding: 10px;
text-align: center;
font-size: 18px;
font-size: 20px;
overflow: hidden;
z-index: 2; /* Ensure the rolling text is above the map */
}
.leaflet-popup-content {
font-size: 16px; /* Adjust the font size as needed */
}
</style>
</head>
<body>
<div id="map"></div>
<div id="rollingText" class="rolling-text-container"></div>
<script src="http://127.0.0.1:8080/ipfs/QmUBL1cAkKbwnkxCcjvN6B9ydgoNgYGt1sYBqij8Wy2AjS/leaflet.js"></script>
<script src="http://127.0.0.1:8080/ipfs/QmUBL1cAkKbwnkxCcjvN6B9ydgoNgYGt1sYBqij8Wy2AjS/axios.min.js"></script>
<script>
// Initialize the map
// const map = L.map('map').setView([0.00, 0.00], 11);
const map = L.map('map').setView([43.2218, 1.3977], 11);
<script src="http://127.0.0.1:8080/ipfs/QmZX8YdRWqqJFirdDg1z66Suy7JQrWWufTjPeX51mGoQix/leaflet.js"></script>
<script src="http://127.0.0.1:8080/ipfs/QmZX8YdRWqqJFirdDg1z66Suy7JQrWWufTjPeX51mGoQix/leaflet.awesome-markers.min.js"></script>
<script src="http://127.0.0.1:8080/ipfs/QmZX8YdRWqqJFirdDg1z66Suy7JQrWWufTjPeX51mGoQix/axios.min.js"></script>
<!-- Include the tweetnacl library for Ed25519 operations -->
<script src="./nacl.min.js"></script>
<script>
// Custom Base58 encoding and decoding functions
function base58Encode(bytes) {
const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
const base = BigInt(ALPHABET.length);
let encoded = '';
let value = BigInt('0');
for (let i = 0; i < bytes.length; i++) {
value = value * BigInt(256) + BigInt(bytes[i]);
}
while (value > BigInt(0)) {
const remainder = value % base;
value = value / base;
encoded = ALPHABET[Number(remainder)] + encoded;
}
return encoded;
}
function base58Decode(encoded) {
const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
const base = BigInt(ALPHABET.length);
let value = BigInt('0');
for (let i = 0; i < encoded.length; i++) {
const char = encoded[i];
const charValue = BigInt(ALPHABET.indexOf(char));
value = value * base + charValue;
}
const valueBytes = [];
while (value > BigInt(0)) {
const byteValue = Number(value % BigInt(256));
value = value / BigInt(256);
valueBytes.unshift(byteValue);
}
return new Uint8Array(valueBytes);
}
function convertPublicKey(pubkey) {
const g1PublicKey = pubkey;
// Decode the Base58 encoded G1 public key using custom function
const decodedShared = base58Decode(g1PublicKey);
// Create a new Uint8Array to hold the IPNS public key bytes
const ipnsPublicKeyBytes = new Uint8Array(decodedShared.length + 6);
// Prefix bytes for IPNS public key
const prefixBytes = new Uint8Array([0, 36, 8, 1, 18, 32]);
// Copy the prefix bytes and G1 public key bytes into the new array
ipnsPublicKeyBytes.set(prefixBytes, 0);
ipnsPublicKeyBytes.set(decodedShared, prefixBytes.length);
// Encode the IPNS public key using custom Base58 encoding
const ipnsPublicKey = '1' + base58Encode(ipnsPublicKeyBytes); // Prepend '1'
return ipnsPublicKey;
}
</script>
<script>
/////////////////////////////////////////////////////////
// Initialize Leaflet map
const map = L.map('map').setView([43.61000, 1.43000], 11);
/////////////////////////////////////////////////////////
// Add OpenStreetMap layer
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
// Fetch JSON data
axios.get('./p4n.json')
/////////////////////////////////////////////////////////
// Fetch wallets data
axios.get('./wallets.json')
.then(response => {
const places = response.data;
const walletPlaces = response.data;
// Iterate through places and add markers to the map
places.forEach(place => {
const { lat, lng, title_short, description, images, services, activities } = place;
const marker = L.marker([lat, lng]).addTo(map);
// Create a popup content
const popupContent = `
<b>${title_short}</b><br>
${description}<br>
<b>Services:</b> ${services.join(', ')}<br>
<b>Activities:</b> ${activities.join(', ')}<br>
<a href="#" onclick="goToLocation(${lat}, ${lng})">Zoom In</a>
`;
// Iterate through wallet data
walletPlaces.forEach(place => {
const { geoPoint, title, description, socials, pubkey, isMember } = place;
const { lat, lon } = geoPoint;
// Bind popup to the marker
marker.bindPopup(popupContent);
// Add a marker with a FontAwesome icon
var customIcon = L.AwesomeMarkers.icon({
icon: 'coffee', // Specify the FontAwesome icon name
markerColor: 'red' // Customize marker color
});
// Create a marker on the map
const marker = L.marker([lat, lon], { icon: customIcon }).addTo(map);
// Create a popup content
let popupContent = `<b>${title}</b><br>${description}<br>`;
// Check if socials is defined
if (socials && socials.length > 0) {
popupContent += `<br><a href="${socials[0].url}" target="_blank">WWW</a><br>`;
}
if (isMember) {
// Member ID
popupContent += `<br>* <a href="/ipfs/QmXex8PTnQehx4dELrDYuZ2t5ag85crYCBxm3fcTjVWo2k/#/app/wot/tx/${pubkey}/" target="_blank"><span style="color: red; font-size: 18px;">Forgeron</span></a>`;
} else {
// Merchant ID
popupContent += `<br>* <a href="/ipfs/QmadaNua8Cj8fwRNeEfzkMAjQ8XJuBJpD41w5pb2DBC8uc/#/app/user/${pubkey}/" target="_blank">Gchange</a>`;
popupContent += `<br>* <a href="/ipfs/QmXex8PTnQehx4dELrDYuZ2t5ag85crYCBxm3fcTjVWo2k/#/app/wot/tx/${pubkey}/" target="_blank">Cesium</a>`;
popupContent += `<br>* <a href="/ipns/${convertPublicKey(pubkey)}" target="_blank">+ TW +</a>`;
}
popupContent += `<br><br>* <a href="https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=${map.getCenter().lat}%2C${map.getCenter().lng}%3B${lat}%2C${lon}" target="_blank">Route</a>`;
// Bind popup to the marker
marker.bindPopup(popupContent);
});
})
.catch(error => {
console.error('Error fetching JSON data:', error);
console.error('Error fetching wallets JSON data:', error);
});
/////////////////////////////////////////////////////////
// Fetch p4n data
axios.get('./p4n.json')
.then(response => {
const p4nPlaces = response.data;
// Iterate through p4n data
p4nPlaces.forEach(place => {
const { lat, lng, title_short, description, services, activities } = place;
// Create a marker on the map
const marker = L.marker([lat, lng]).addTo(map);
// Create a popup content
const popupContent = `
<b>${title_short}</b><br>
${description}<br>
<b>Services:</b> ${services.join(', ')}<br>
<b>Activities:</b> ${activities.join(', ')}<br>
* <a href="#" onclick="goToLocation(${lat}, ${lng})">Zoom</a><br>
* <a href="https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=${map.getCenter().lat}%2C${map.getCenter().lng}%3B${lat}%2C${lng}" target="_blank">Route</a>
`;
// Bind popup to the marker
marker.bindPopup(popupContent);
});
})
.catch(error => {
console.error('Error fetching p4n JSON data:', error);
});
/////////////////////////////////////////////////////////
function goToLocation(lat, lng) {
// Switch to ArcGIS World Imagery basemap
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
@ -82,24 +209,26 @@ axios.get('./p4n.json')
// Set the map view to the specified GPS position
map.setView([lat, lng], 18); // Adjust the zoom level as needed
}
/////////////////////////////////////////////////////////
// Fetch JSON data for rolling text
axios.get('gchange50.json')
.then(response => {
const ids = response.data.hits.hits.map(hit => hit._id);
//
const titles = response.data.hits.hits.map(hit => hit._source.title);
displayRollingText(titles);
displayRollingText(titles, ids);
})
.catch(error => {
console.error('Error fetching rolling text JSON data:', error);
});
function displayRollingText(titles) {
/////////////////////////////////////////////////////////
function displayRollingText(titles, ids) {
const rollingTextContainer = document.getElementById('rollingText');
let currentIndex = 0;
function updateText() {
rollingTextContainer.textContent = titles[currentIndex];
currentIndex = (currentIndex + 1) % titles.length;
rollingTextContainer.innerHTML = `<a href="https://data.gchange.fr/market/record/${ids[currentIndex]}/_share" target="_blank">${titles[currentIndex]}</a>`;
currentIndex = (currentIndex + 1) % titles.length;
}
setInterval(updateText, 3000); // Change text every 3 seconds (adjust as needed)

View File

@ -0,0 +1,128 @@
/*
Author: L. Voogdt
License: MIT
Version: 1.0
*/
/* Marker setup */
.awesome-marker {
background: url('images/markers-soft.png') no-repeat 0 0;
width: 35px;
height: 46px;
position:absolute;
left:0;
top:0;
display: block;
text-align: center;
}
.awesome-marker-shadow {
background: url('images/markers-shadow.png') no-repeat 0 0;
width: 36px;
height: 16px;
}
/* Retina displays */
@media (min--moz-device-pixel-ratio: 1.5),(-o-min-device-pixel-ratio: 3/2),
(-webkit-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5),(min-resolution: 1.5dppx) {
.awesome-marker {
background-image: url('images/markers-soft@2x.png');
background-size: 720px 92px;
}
.awesome-marker-shadow {
background-image: url('images/markers-shadow@2x.png');
background-size: 35px 16px;
}
}
.awesome-marker i {
color: #333;
margin-top: 10px;
display: inline-block;
font-size: 14px;
}
.awesome-marker .icon-white {
color: #fff;
}
/* Colors */
.awesome-marker-icon-red {
background-position: 0 0;
}
.awesome-marker-icon-darkred {
background-position: -180px 0;
}
.awesome-marker-icon-lightred {
background-position: -360px 0;
}
.awesome-marker-icon-orange {
background-position: -36px 0;
}
.awesome-marker-icon-beige {
background-position: -396px 0;
}
.awesome-marker-icon-green {
background-position: -72px 0;
}
.awesome-marker-icon-darkgreen {
background-position: -252px 0;
}
.awesome-marker-icon-lightgreen {
background-position: -432px 0;
}
.awesome-marker-icon-blue {
background-position: -108px 0;
}
.awesome-marker-icon-darkblue {
background-position: -216px 0;
}
.awesome-marker-icon-lightblue {
background-position: -468px 0;
}
.awesome-marker-icon-purple {
background-position: -144px 0;
}
.awesome-marker-icon-darkpurple {
background-position: -288px 0;
}
.awesome-marker-icon-pink {
background-position: -504px 0;
}
.awesome-marker-icon-cadetblue {
background-position: -324px 0;
}
.awesome-marker-icon-white {
background-position: -574px 0;
}
.awesome-marker-icon-gray {
background-position: -648px 0;
}
.awesome-marker-icon-lightgray {
background-position: -612px 0;
}
.awesome-marker-icon-black {
background-position: -682px 0;
}
.awesome-marker-square {
background-position-y: -46px;
}

View File

@ -0,0 +1,7 @@
/*
Leaflet.AwesomeMarkers, a plugin that adds colorful iconic markers for Leaflet, based on the Font Awesome icons
(c) 2012-2013, Lennard Voogdt
http://leafletjs.com
https://github.com/lvoogdt
*//*global L*/(function(e,t,n){"use strict";L.AwesomeMarkers={};L.AwesomeMarkers.version="2.0.1";L.AwesomeMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"awesome-marker",prefix:"glyphicon",spinClass:"fa-spin",icon:"home",markerColor:"blue",iconColor:"white"},initialize:function(e){e=L.Util.setOptions(this,e)},createIcon:function(){var e=t.createElement("div"),n=this.options;n.icon&&(e.innerHTML=this._createInner());n.bgPos&&(e.style.backgroundPosition=-n.bgPos.x+"px "+ -n.bgPos.y+"px");this._setIconStyles(e,"icon-"+n.markerColor);return e},_createInner:function(){var e,t="",n="",r="",i=this.options;i.icon.slice(0,i.prefix.length+1)===i.prefix+"-"?e=i.icon:e=i.prefix+"-"+i.icon;i.spin&&typeof i.spinClass=="string"&&(t=i.spinClass);i.iconColor&&(i.iconColor==="white"||i.iconColor==="black"?n="icon-"+i.iconColor:r="style='color: "+i.iconColor+"' ");return"<i "+r+"class='"+i.prefix+" "+e+" "+t+" "+n+"'></i>"},_setIconStyles:function(e,t){var n=this.options,r=L.point(n[t==="shadow"?"shadowSize":"iconSize"]),i;t==="shadow"?i=L.point(n.shadowAnchor||n.iconAnchor):i=L.point(n.iconAnchor);!i&&r&&(i=r.divideBy(2,!0));e.className="awesome-marker-"+t+" "+n.className;if(i){e.style.marginLeft=-i.x+"px";e.style.marginTop=-i.y+"px"}if(r){e.style.width=r.x+"px";e.style.height=r.y+"px"}},createShadow:function(){var e=t.createElement("div");this._setIconStyles(e,"shadow");return e}});L.AwesomeMarkers.icon=function(e){return new L.AwesomeMarkers.Icon(e)}})(this,document);

File diff suppressed because one or more lines are too long

1
templates/P4N/nacl.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

233452
templates/P4N/wallall.json Normal file

File diff suppressed because one or more lines are too long

5155
templates/P4N/wallets.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -157,16 +157,16 @@ iframe {
</div>
</div>
<div id="console">
| <a href="INFO.png" target="aframe" title="_SECTOR_ INFO"> _<img width=20 src="http://127.0.0.1:8080/ipfs/QmaeRPu6yYZ8iRACgkd4DtD1V1H8NdXT8yf5Gfxf17c9pm" ></a> |
| <a href="INFO.png" target="aframe" title="INFO"> _<img width=20 src="http://127.0.0.1:8080/ipfs/QmaeRPu6yYZ8iRACgkd4DtD1V1H8NdXT8yf5Gfxf17c9pm" ></a> |
<a href="https://transiscope.gogocarto.fr/map#/carte/@_LAT_,_LON_,12z?cat=all" target="aframe" title="- Transiscope - Le portail des alternatives"><img width=20 src="http://127.0.0.1:8080/ipfs/QmbM7PH7untyyZRYHTT1Y27rdaYNWUcBF1YAeXbFMW7GX8" ></a> |
<a href="_CESIUMIPFS_/#/app/wot/tx/_SECTORG1PUB_/" target="aframe" title="SECTOR WALLET"><img width=20 src="http://127.0.0.1:8080/ipfs/QmQd7rNi13eHHWaEfqKLHxmY6V5HWakGsXNZH8QVoGQvNt" ></a> |
<a href="/ipfs/_ZONEIPFS_/TW" target="aframe" title="_ZONE_ TW NEWS"> _<img width=20 src="http://127.0.0.1:8080/ipfs/QmZX2Titv5L488iNVHwbRNeuZh2PJULSCfxoSgF4Qzv547" ></a> |
<a href="_CESIUMIPFS_/#/app/wot/tx/_SECTORG1PUB_/" target="aframe" title="ZEN BANK ACCOUNT"><img width=20 src="http://127.0.0.1:8080/ipfs/QmQd7rNi13eHHWaEfqKLHxmY6V5HWakGsXNZH8QVoGQvNt" ></a> |
<a href="./TW" target="aframe" title="LOCAL TW NEWS"> _<img width=20 src="http://127.0.0.1:8080/ipfs/QmZX2Titv5L488iNVHwbRNeuZh2PJULSCfxoSgF4Qzv547" ></a> |
<!--
<a href="https://minetest.dustlabs.io/?launch" target="aframe" title="- Minetest - Building Blocks on UPlanet - DEV -"><img width=20 src="http://127.0.0.1:8080/ipfs/Qmeaaee1gojMHkos4Quqqw8dwmF4SDP8kTCgAdnJiTeVgJ" ></a> |
<a href="_HACKGIPFS_" target="aframe" title="Ẑen Quest"> ( <img width=20 src="http://127.0.0.1:8080/ipfs/QmNSc5e4K2qzpWpiqHm47KNywxNjsnsN8R2ebpqEespyBX" > ) </a>
<a href="https://carte.monnaie-libre.fr" target="aframe" title="MONNAIE LIBRE"> ( <img width=20 src="http://127.0.0.1:8080/ipfs/QmP1DzFR57kQTpC8Fc8bEVtuEkpXTfkBcb4ryrhXRieMcq" > ) </a>
-->
<a href="_IPFSNINJA_/?room=_PHONEBOOTH_&record" target="aframe" title="_SECTOR_ VISIO 📺"> ( ° - °)📺<img width=20 src="http://127.0.0.1:8080/ipfs/QmU3JKMFDnRUWv1juLcA4YEPxHLcXrgrn9FdbXaPgZgwbT" ></a> |
<a href="_IPFSNINJA_/?room=_PHONEBOOTH_&record" target="aframe" title=" ( ° - °)📺">📺 VISIO 📺<img width=20 src="http://127.0.0.1:8080/ipfs/QmU3JKMFDnRUWv1juLcA4YEPxHLcXrgrn9FdbXaPgZgwbT" ></a> |
&nbsp;&nbsp;&nbsp;<button id="fullscreenButton" onclick="toggleConsoleFullScreen()"> ^^ </button>&nbsp;&nbsp;&nbsp;<button onclick="hideConsole()"> X </button>
<iframe name="aframe" id="aframe" src="INFO.png" width="100%" height="100%"></iframe>
</div>

View File

@ -138,6 +138,7 @@ iframe {
<h1>_ZONE_</h1>
<p> (✜) <a href="_UPLANETLINK_" title="Navigate">"UPlanet Registration"</a> (✜) </p>
<p><a href="http://127.0.0.1:8080/ipns/_UPUPZONENS_">"_UPUPZONE_"</a></p>
<p><a href="http://127.0.0.1:8080/ipns/_UPZONENS_">"_UPZONE_"</a></p>
<p><a href="http://127.0.0.1:8080/ipns/_ZONENS_">"_ZONE_"</a></p>
@ -151,10 +152,10 @@ iframe {
</div>
<div id="console">
| <a href="_index.p4n.html" target="aframe" title="Local POI"> <img width=20 src="http://127.0.0.1:8080/ipfs/QmNp9pTJJNqz4AA9RLvd3pTDLFhAzqxiFgtUocNuZmsef2" ></a> |
<a href="http://127.0.0.1:8080/ipns/_ZONENS_/TW" target="aframe" title="_ZONE_ PLAYERs TW"><img width=20 src="http://127.0.0.1:8080/ipfs/QmaLzMFUR7QfKvxp63KkHkPco92maRSiNvPEgMoKNxM7Q8" ></a> |
<a href="http://127.0.0.1:8080/ipns/_ZONENS_/TW" target="aframe" title="LOCAL PLAYERs TW"><img width=20 src="http://127.0.0.1:8080/ipfs/QmaLzMFUR7QfKvxp63KkHkPco92maRSiNvPEgMoKNxM7Q8" ></a> |
<a href="https://minetest.dustlabs.io/?launch" target="aframe" title="Building Blocks UPlanet"><img width=20 src="http://127.0.0.1:8080/ipfs/Qmeaaee1gojMHkos4Quqqw8dwmF4SDP8kTCgAdnJiTeVgJ" ></a> |
<a href="http://127.0.0.1:8080/ipns/_UPZONENS_/TW" target="aframe" title="_UPZONE_ TW NEWS" ><img width=20 src="http://127.0.0.1:8080/ipfs/QmZX2Titv5L488iNVHwbRNeuZh2PJULSCfxoSgF4Qzv547" ></a>
<a href="_IPFSNINJA_/?room=_PHONEBOOTH_&record" target="aframe" title="_📺_PHONEBOOTH_ vdo room_📺 "> <img width=20 src="http://127.0.0.1:8080/ipfs/QmU3JKMFDnRUWv1juLcA4YEPxHLcXrgrn9FdbXaPgZgwbT" >(° - ° )📺</a> |
<a href="_IPFSNINJA_/?room=_PHONEBOOTH_&record" target="aframe" title="(° - ° )📺"> <img width=20 src="http://127.0.0.1:8080/ipfs/QmU3JKMFDnRUWv1juLcA4YEPxHLcXrgrn9FdbXaPgZgwbT" >📺 VISIO 📺</a> |
<!--
<a href="_HACKGIPFS_" target="aframe" title="Ẑen Quest"> ( <img width=20 src="http://127.0.0.1:8080/ipfs/QmNSc5e4K2qzpWpiqHm47KNywxNjsnsN8R2ebpqEespyBX" > ) </a>
<a href="https://g1.quest" target="aframe" title="Ğ1 Quest"> ( <img width=20 src="http://127.0.0.1:8080/ipfs/QmNSc5e4K2qzpWpiqHm47KNywxNjsnsN8R2ebpqEespyBX" > ) </a>

View File

@ -43,15 +43,19 @@ header {
background: white;
color: black;
}
#yellow {
background: black;
color: white;
position: absolute;
bottom: 2%;
left: 2%;
width: 60%;
visibility: hidden;
}
#console {
visibility: visible;
background: rgba(0, 0, 0, 0.9);
color: white;
width: 70%;
height: 55%;
position: absolute;
bottom: 0;
left: 0;
padding: 5px;
box-sizing: border-box;
z-index: 1000; /* Ensure the console appears above other elements */
}
#ainfo {
position: absolute;
top: 2%;
@ -106,7 +110,13 @@ a {
width: 400px;
height: 400px;
}
#toggleConsoleButton {
cursor: pointer;
}
#fullscreenButton {
cursor: pointer;
}
</style>
</head>
@ -277,17 +287,41 @@ a {
});
</script>
<h1><button id="ainfo" onclick="javascript:var x = document.getElementById('yellow'); if (x.style.visibility === 'hidden') {x.style.visibility = 'visible';} else {x.style.visibility = 'hidden';}">0/1</button></h1>
<div id="yellow" ><a href="_STATION_" target="aframe">MENU</a>
<h1><button id="ainfo" onclick="javascript:var x = document.getElementById('console'); if (x.style.visibility === 'hidden') {x.style.visibility = 'visible';} else {x.style.visibility = 'hidden';}">0/1</button></h1>
<div id="console" >
<a href="_STATION_" target="aframe">CONSOLE</a>
&nbsp;&nbsp;&nbsp;<button id="fullscreenButton" onclick="toggleConsoleFullScreen()"> ^^ </button>&nbsp;&nbsp;&nbsp;<button onclick="hideConsole()"> X </button>
<iframe name="aframe" id="aframe" src="_STATION_" width="100%" height="320px"></iframe>
</div>
<script>
function toggleConsole() {
const console = document.getElementById('console');
console.style.visibility = (console.style.visibility === 'visible' ? 'hidden' : 'visible');
}
function hideConsole() {
document.getElementById('console').style.visibility = 'hidden';
}
function toggleConsoleFullScreen() {
const console = document.getElementById('console');
if (console.style.width === '100%' && console.style.height === '100%') {
console.style.width = '570px';
console.style.height = '480px';
} else {
console.style.width = '100%';
console.style.height = '100%';
}
}
</script>
<script>
let cookies = document.cookie;
console.log(cookies);
const el = document.getElementById('yellow');
const el = document.getElementById('console');
setTimeout(() => {
el.style.visibility = 'visible';

View File

@ -79,7 +79,7 @@ header {
<button onclick="homeAstroportStation('http://127.0.1.1:1234/?qrcode=station', '', 21654)">Ẑen Station</button>
</div>
<form id="formlink" action="http://127.0.0.1:1234" method="GET" enctype="application/x-www-form-urlencoded">
<h1><span>Astroport</span> <a href="http://127.0.0.1:12345">Ŋ1</a></h1>
<h1><span>Internet</span> <a href="http://127.0.0.1:12345">Ŋ1</a></h1>
<div id="yellow">
<h2>AstroID SECRETS</h2>
<input name='salt' value='0'>
@ -89,13 +89,13 @@ header {
<h2>
<div id="typed-strings">
<p><span>/ <strong><em><a href="https://opencollective.com/monnaie-libre/projects/coeurbox" target="funding">La♥BOX</a></em></strong> /</span>^3223</p>
<p>&#8984; Interplanetary <em>Cloud Storage</em> &#9925;</span> ^3222</p>
<p>We Make <strong><em><u>👉<a href="https://opencollective.com/monnaie-libre">Le Claude</a>👈</u></em></strong>^3112</p>
<p>&#8984; (Inter) Planetary <em>Eternal Storage</em> &#9925;</span> ^3222</p>
<p>We make <strong><em><u>👉<a href="https://opencollective.com/monnaie-libre">Le Claude</a>👈</u></em></strong>^3112</p>
<p>🔥.^999.^888.^777.^666.5^555.4^444.3^333.2^222.1^111 🚀^4321</p>
</div>
<span id="typed"></span>
</h2>
<span><a target="youtube" href="https://youtube.com">📺 (&#128077;)</a> : </span><input name=g1pub value='enter video source to feed in TW'></br>
<span><a target="youtube" href="https://youtube.com">📺</a> : </span><input name=g1pub value='enter video source to feed in TW'><a target="youtube" href="https://youtube.com">(&#128077;)</a></br>
<span>Email : </span><input name=email value=''></br></br>
<input type='submit' value='[(♥‿‿♥)]'>
@ -104,7 +104,7 @@ header {
</h2>
</br>
<p>
<b><a target="pad" href="https://ipfs.copylaradio.com/ipfs/QmdGGAukDepUiH63YgnMsvb4BySNPqM2bLz81bx4rjqCJD/?room=cocoding">COCODING ROOM</a></b>
<b><a target="pad" href="https://ipfs.copylaradio.com/ipfs/QmdGGAukDepUiH63YgnMsvb4BySNPqM2bLz81bx4rjqCJD/?room=UPLANET">UPLANET VISIO ROOM</a></b>
</p>
</header>

File diff suppressed because one or more lines are too long

66
tools/IPFSNODEID.weather.sh Executable file
View File

@ -0,0 +1,66 @@
#!/bin/bash
########################################################################
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
## EXPLORE SWARM MAPNS
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "$MY_PATH/../tools/my.sh"
# Mapping of weather conditions to emoticons
weather_emoticon_map=(
["Clear"]="😊"
["Clouds"]="☁️"
["Rain"]="🌧️"
["Snow"]="❄️"
["Thunderstorm"]="⛈️"
# Add more mappings as needed
)
default_emoticon="😊"
## GET IPFSNODEID WHEATER
source ~/.zen/GPS
echo "... ~/.zen/GPS ... $LAT $LON ..."
## caching IPCity
[[ ! -s ~/.zen/IPCity ]] \
&& my_IPCity > ~/.zen/IPCity
ville=$(cat ~/.zen/IPCity)
api_key="ac5e65a2fd10d3788d40cdae0d4516ba" # Remplacez YOUR_API_KEY par votre clé API OpenWeatherMap
url="http://api.openweathermap.org/data/2.5/weather?q=$ville&APPID=$api_key&units=metric"
meteo=$(curl -s $url)
# Extract relevant weather information
condition=$(echo "$meteo" | jq -r '.weather[0].main')
emoticon=${weather_emoticon_map[$condition]}
selected_emoticon=${emoticon:-$default_emoticon}
description=$(echo "$meteo" | jq -r '.weather[0].description')
temp=$(echo "$meteo" | jq -r '.main.temp')
humidity=$(echo "$meteo" | jq -r '.main.humidity')
wind_speed=$(echo "$meteo" | jq -r '.wind.speed')
# Create a sentence with "emoticons" and ASCII art decorations
echo "# $ville
## $selected_emoticon $condition
$description
---
T=${temp} °C
H=${humidity} %
W=${wind_speed} m/s
---
😊 Stay cozy BRO !
"
## SATELLITE IMAGE ...
## Add more +++

View File

@ -28,7 +28,7 @@ MINUTE=${Zmoats:10:2}
MINUTE=${MINUTE#0}
SECMINUTE=$((MINUTE * 60))
SECOND=$((${Zmoats:12:2}+0))
SECOND=${Zmoats:12:2}
# Calculate the time difference in seconds

View File

@ -11,8 +11,8 @@ ME="${0##*/}"
. "${MY_PATH}/my.sh"
## REDIRECT OUTPUT TO "pay4sure.log"
exec 2>&1 >> ~/.zen/tmp/pay4sure.log
## REDIRECT OUTPUT TO "/tmp/20h12.log"
exec 2>&1 >> /tmp/20h12.log
KEYFILE="$1"
AMOUNT="$2"
@ -29,24 +29,29 @@ COMMENT=${COMMENT}"
&& MOATS=$(date -u +"%Y%m%d%H%M%S%4N") \
|| echo "OLD PAYMENT FAILURE = NEW TRY $MOATS"
## CHECKING PAYOUT WALLET (dunikey file)
## CHECKING ISSUER WALLET (dunikey file)
[[ -s ${KEYFILE} ]] \
&& ISSUERPUB=$(cat ${KEYFILE} | grep "pub:" | cut -d ' ' -f 2) \
|| { echo "ERROR : MISSING SECRET DUNIKEY FILE" && exit 1; }
|| { echo "ERROR : MISSING SECRET DUNIKEY FILE - EXIT -" && exit 1; }
[[ -z ${ISSUERPUB} ]] && echo "CANNOT EXTRACT ISSUERPUB FROM DUNIKEY - EXIT -" && exit 1
COINS=$($MY_PATH/COINScheck.sh ${ISSUERPUB} | tail -n 1)
[[ -z $COINS ]] && echo "ERROR : ${ISSUERPUB}=$COINS EMPTY WALLET" && exit 1
[[ -z $COINS ]] && echo "ERROR : ${ISSUERPUB}=$COINS EMPTY WALLET - EXIT -" && exit 1
###### TEST INPUT VALUES
[[ $AMOUNT == "ALL" ]] && AMOUNT=$COINS ## ALL MEAN EMPTY ORIGIN WALLET
[[ -z $AMOUNT ]] && echo "ERROR : ${ISSUERPUB}=$COINS MISSING AMOUNT" && exit 1
[[ $AMOUNT =~ ^[0-9]+([.][0-9]+)?$ ]] && echo "Valid AMOUNT=${AMOUNT}" || { echo "ERROR NOT a valid AMOUNT : ${AMOUNT}" && exit 1; }
[[ $(echo "$COINS <= $AMOUNT" | bc -l) -eq 1 ]] && echo "ERROR : SOURCE WALLET IS MISSING COINS !!! $AMOUNT > $COINS" && exit 1
[[ -z $G1PUB ]] && echo "ERROR : ${ISSUERPUB}=$COINS ($AMOUNT) MISSING DESTINATION" && exit 1
[[ -z $AMOUNT ]] && echo "ERROR : ${ISSUERPUB}=$COINS MISSING AMOUNT - EXIT -" && exit 1
[[ $AMOUNT =~ ^[0-9]+([.][0-9]+)?$ ]] \
&& echo "Valid AMOUNT=${AMOUNT}" \
|| { echo "ERROR NOT a valid AMOUNT : ${AMOUNT} - EXIT -" && exit 1; }
[[ $(echo "$COINS < $AMOUNT" | bc -l) -eq 1 ]] \
&& echo "ERROR : SOURCE WALLET IS MISSING COINS !!! $AMOUNT > $COINS - EXIT -" && exit 1
[[ -z $G1PUB ]] && echo "ERROR : ${ISSUERPUB}=$COINS ($AMOUNT) MISSING DESTINATION - EXIT -" && exit 1
echo
echo "PAYMENT PROCESSOR ID ${MOATS}"
echo "KEYFILE: $HOME/.zen/game/pending/${ISSUERPUB}/"
echo "${ISSUERPUB} : (${AMOUNT}) -> ${G1PUB}"
echo "COMMENT : ${COMMENT}"
[[ -z $COMMENT ]] && COMMENT="ZEN:${MOATS}"
@ -68,6 +73,7 @@ rm -f ${PENDINGDIR}/${MOATS}.result.html
################################################
# MAKE PAYMENT
echo
${MY_PATH}/jaklis/jaklis.py -k ${PENDINGDIR}/${MOATS}.key pay -a ${AMOUNT} -p ${G1PUB} -c "${COMMENT}" -m 2>&1> ${PENDINGDIR}/${MOATS}.result.html
CHK1=$(cat ${PENDINGDIR}/${MOATS}.result.html | head -n 1 )
CHK2=$(cat ${PENDINGDIR}/${MOATS}.result.html | head -n 2 )
@ -97,14 +103,16 @@ if [[ $? == 0 || $(echo "${CHK2}" | grep 'succès') || $(echo "${CHK1}" | grep
ZENDES=$(echo "$DES * 10" | bc | cut -d '.' -f 1)
##### MONITORING #########
echo "<html><h1>ZEN OPERATION</h1>
<h3><a href='${CESIUMIPFS}/#/app/wot/tx/${ISSUERPUB}/'>${ISSUERPUB}</a>
<br> ${ZENCUR} - ${ZENAMOUNT} </h3>
<h3><a href='${CESIUMIPFS}/#/app/wot/tx/${G1PUB}/'>${G1PUB}</a>
<br> ${ZENDES} + ${ZENAMOUNT} </h3>
<h2>OK</h2></html>" > ${PENDINGDIR}/${MOATS}.result.html
echo "<html><h1>${ZENAMOUNT} ZEN OPERATION</h1>
${COMMENT}
<h3><a title='CESIUM' href='${CESIUMIPFS}/#/app/wot/tx/${ISSUERPUB}/'>${ISSUERPUB}</a>
(<a href='$myUPLANET/g1gate/?pubkey=${ISSUERPUB}'>SCAN</a>)
<br> //--->> <a title='CESIUM' href='${CESIUMIPFS}/#/app/wot/tx/${G1PUB}/'>${G1PUB}</a>
(<a href='$myUPLANET/g1gate/?pubkey=${G1PUB}'>SCAN</a>)
</h3>
</html>" > ${PENDINGDIR}/${MOATS}.result.html
$MY_PATH/mailjet.sh "support@qo-op.com" ${PENDINGDIR}/${MOATS}.result.html "${ZENAMOUNT} ZEN : ${ISSUERPUB} > ${G1PUB}"
$MY_PATH/mailjet.sh "support@qo-op.com" ${PENDINGDIR}/${MOATS}.result.html "${ZENAMOUNT} ZEN ${ISSUERPUB}//${COMMENT} TO ${G1PUB}"
## REMOVE IF YOU WANT TO MONITOR "SENT" WINDOW INCERTITUDE
rm ${PENDINGDIR}/${MOATS}.key

View File

@ -18,9 +18,9 @@ RSS=$1 ## filepath to RSS week file to extract Tiddlers
#~ echo "======= RSS 2 WEEKnewsfile =======
#~ Analysing ${RSS}
#~ =================================================================="
cat ${RSS} | jq -r '.[] | if .ipfs then "\n# [\(."title")](\(."ipfs"))\n\n\(.tags)\n \(.duree)"
cat ${RSS} | jq -r '.[] | select(.title | startswith("$:/") | not) | if .ipfs then "\n# [\(."title")](\(."ipfs"))\n\n\(.tags)\n \(.duree)"
elif .ipfs_one then "\n# \(."title")\n\n\(.tags)\n\(.desc)\n\(.g1pub)"
elif ._external_url then "\n# [\(."title")](\(._external_url))\n\n\(.tags)\n\(.mime) \(.type)"
else "\n# \(."title")\n\n\(.tags)\n\(.text)" end'
else "\n# \(."title")\n\n\(.tags)\n\(.text)" end | select(.tags | contains(["$:/isEmbedded", "$:/isIpfs"]) | not)'
exit 0

View File

@ -40,8 +40,8 @@ ipfs config --json Experimental.P2pHttpProxy true
ipfs config --json Swarm.ConnMgr.LowWater 20
ipfs config --json Swarm.ConnMgr.HighWater 40
[[ ! $isLAN ]] && ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://ipfs.localhost:8080", "http://127.0.0.1:8080", "http://127.0.1.1:8080", "https://ipfs.'$(hostname)'.copylaradio.com", "https://ipfs.copylaradio.com" ]' \
|| ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://'$(hostname)'.local:8080","http://'$(hostname)':8080", "http://127.0.0.1:8080", "http://ipfs.localhost:8080", "http://127.0.1.1:8080" ]'
[[ ! $isLAN ]] && ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://'$(hostname)'.localhost:8080", "http://ipfs.localhost:8080", "http://127.0.0.1:8080", "http://127.0.1.1:8080", "https://ipfs.'$(hostname)'.copylaradio.com", "https://ipfs.copylaradio.com" ]' \
|| ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://'$(hostname)'.local:8080","http://'$(hostname)':8080", "http://'$(hostname)'.localhost:8080", "http://127.0.0.1:8080", "http://ipfs.localhost:8080", "http://127.0.1.1:8080" ]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'

View File

@ -42,7 +42,6 @@ import os
import re
import struct
import sys
import time
import warnings
__version__='0.0.5'
@ -610,7 +609,7 @@ class keygen:
try:
self.ed25519_seed_bytes_from_duniterpy()
self.ed25519_from_seed_bytes()
except:
except Exception as e:
log.error(f'Unable to get ed25519 from duniterpy: {e}')
self._cleanup()
exit(2)

View File

@ -10,6 +10,9 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "$MY_PATH/my.sh"
ME="${0##*/}"
## LOG OUTPUT
exec 2>&1 >> ~/.zen/tmp/mailjet.log
echo '
########################################################################
# \\///

View File

@ -223,6 +223,6 @@ htmlipfs=$(ipfs add -q $html_file)
[[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]] && xdg-open http://ipfs.localhost:8080/ipfs/$htmlipfs
echo "/ipfs/$htmlipfs" > ~/.zen/tmp/ISTATION
cat ~/.zen/tmp/ISTATION
cat ~/.zen/tmp/ISTATION ### KEEPIT ON LAST LINE
exit 0

View File

@ -428,6 +428,37 @@ function makecoord() {
echo "${input}"
}
# Fonction pour récupérer la météo depuis l'API OpenWeatherMap
recuperer_meteo() {
echo "En train de récupérer les données météo..."
# Récupérer la météo à l'aide de l'API OpenWeatherMap
ville="Paris" # Vous pouvez modifier la ville ici
api_key="310103dee4a9d1b716ee27d79f162c7e" # Remplacez YOUR_API_KEY par votre clé API OpenWeatherMap
url="http://api.openweathermap.org/data/2.5/weather?q=$ville&appid=$api_key&units=metric"
meteo=$(curl -s $url)
# Extraire les informations pertinentes de la réponse JSON
temperature=$(echo $meteo | jq -r '.main.temp')
description=$(echo $meteo | jq -r '.weather[0].description')
echo "La météo à $ville : $description, Température: $temperature °C"
}
# my_IPCity # Fonction pour récupérer la géolocalisation à partir de l'adresse IP
my_IPCity() {
local ip=$1
if [ -z "$ip" ]; then
ip=$(curl 'https://api.ipify.org?format=json' --silent | jq -r '.ip')
fi
local url="http://ip-api.com/json/$ip"
local geolocalisation=$(curl -s "$url")
local ville=$(echo "$geolocalisation" | jq -r '.city')
local pays=$(echo "$geolocalisation" | jq -r '.country')
echo "$ville,$pays"
}
IPFSNODEID="$(myIpfsPeerId)"
[[ ! $MOATS ]] && MOATS="$(myDate)"
isLAN="$(isLan)"
@ -440,16 +471,16 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(
myDOMAIN="copylaradio.com"
myASTROPORTW="http://$(hostname).local:1234" #astroport.localhost
myASTROPORT="http://${myIP}:1234" # BE ACCESSIBLE THROUGH LAN
myAPI="http://${myIP}:5001"
myASTROPORT="http://127.0.0.1:1234" # BE ACCESSIBLE THROUGH LAN
myAPI="http://127.0.0.1:5001"
myDATA="https://data.gchange.fr"
myGCHANGE="https://www.gchange.fr"
myCESIUM="https://g1.data.e-is.pro"
myG1BILLET="http://${myIP}:33101"
myG1BILLET="http://127.0.0.1:33101"
myHOST="$(myHostName)"
myIPFSW="http://$(hostname).local:8080" ## ipfs.localhost (IP works better in LAN deported desktop), but not in docker.
myIPFS="http://${myIP}:8080" ## ipfs.localhost (IP works better in LAN deported desktop), but not in docker.
myIPFS="http://127.0.0.1:8080" ## ipfs.localhost (IP works better in LAN deported desktop), but not in docker.
myIPFSGW="$(myIpfsGw)"
myTUBE="$(myTube)"
myASTROTUBE="https://$(myAstroTube)"
@ -488,7 +519,7 @@ if [[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]]; then
fi
## https://git.p2p.legal/qo-op/OSM2IPFS
EARTHCID="/ipfs/QmYGS24WxVbsmmQfqWohXhXQZiwSmNswhTtSj9msVWKkNh"
EARTHCID="/ipfs/QmXWDm78ne22ou9kmRPFqVa3e15BNHsXBZe4Y9KmgBPmJL"
FLIPPERCID="${EARTHCID}/coinflip" ### EASTER EGG
###########################

View File

@ -19,16 +19,17 @@ EMAIL="$1"
if [[ "${EMAIL}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then
INDEX=$(ls $HOME/.zen/game/players/${EMAIL}/ipfs/moa/index.html 2>/dev/null) ## LOCAL
[[ ! $INDEX ]] && INDEX=$(ls $HOME/.zen/tmp/${IPFSNODEID}/TW/${EMAIL}/index.html 2>/dev/null) ## CACHE
[[ ! $INDEX ]] && INDEX=$(ls $HOME/.zen/tmp/swarm/*/TW/${EMAIL}/index.html 2>/dev/null) ## SWARM
INDEX=$(ls $HOME/.zen/game/players/${EMAIL}/ipfs/moa/index.html 2>/dev/null) && source="LOCAL"
[[ ! $INDEX ]] && INDEX=$(ls $HOME/.zen/tmp/${IPFSNODEID}/TW/${EMAIL}/index.html 2>/dev/null) && source="CACHE"
[[ ! $INDEX ]] && INDEX=$(ls $HOME/.zen/tmp/swarm/*/TW/${EMAIL}/index.html 2>/dev/null) && source="SWARM"
[[ ! $INDEX ]] && exit 1
## TODO ? SEARCH WITH DNSLINK
echo "export TW=${INDEX}"
echo "export TW=${INDEX} source=${source}"
# SWARM CACHE index.html contains
# <meta http-equiv="refresh" content="0; url='/ipns/$EXTERNAL'" />
EXTERNAL=$(grep -o "url='/[^']*'" ${INDEX} | sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}')
# <meta http-equiv="refresh" content="0; url='/ipfs/$EXTERNAL'" />
[[ ${source} != "LOCAL" ]] \
&& EXTERNAL=$(grep -o "url='/[^']*'" ${INDEX} | sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}')
if [[ ! ${EXTERNAL} ]]; then
## EXTRACT DATA FROM TW
@ -39,13 +40,15 @@ if [[ "${EMAIL}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
ASTROG1=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].g1pub)
TWCHAIN=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].chain)
## GET ASTRONAUTENS - field was missing in TW model Astroport Tiddler -
ASTRONAUTENS=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astronautens)
[[ ${ASTRONAUTENS} == "null" || ${ASTRONAUTENS} == "" ]] && ASTRONAUTENS="/ipns/"$(ipfs key list -l | grep -w ${ASTROG1} | cut -d ' ' -f1)
[[ ${ASTRONAUTENS} == "/ipns/" ]] && ASTRONAUTENS=""
[[ ${ASTRONAUTENS} == "/ipns/" ]] && ASTRONAUTENS="/ipfs/${TWCHAIN}"
else
ASTRONAUTENS="/ipns/${EXTERNAL}"
ASTRONAUTENS="/ipfs/${EXTERNAL}"
ASTROPORT="/ipns/$(echo $INDEX | rev | cut -d / -f 4 | rev)"
fi
rm -Rf ~/.zen/tmp/${MOATS}