TW change some /ipns/ with current /ipfs/ (to make quicker access)

This commit is contained in:
fred 2023-12-05 16:33:32 +01:00
parent 68881f008d
commit 526a67114a
5 changed files with 16 additions and 9 deletions

View File

@ -72,7 +72,9 @@ if [[ $DEG == "0.001" ]]; then
ipfs key rm ${G1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
UMAPNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${UMAP}.priv)
echo '{ "gridNumbers": [ {"lat": '${LAT}', "lon": '${LON}', "number": "UMAP_'${LAT}'_'${LON}'", "ipns": "'${UMAPNS}'" } ] }' >> ~/.zen/tmp/${MOATS}.http
## TODO : REDIRECT TO THE STATION WITH THE MORE OF THIS UMAP ;)
echo '{ "gridNumbers": [ {"lat": '${LAT}', "lon": '${LON}', "number": "UMAP_'${LAT}'_'${LON}'", "ipns": "'${myIPFS}/ipns/${UMAPNS}'" } ] }' >> ~/.zen/tmp/${MOATS}.http
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
rm -Rf ~/.zen/tmp/${MOATS}/
end=`date +%s`

View File

@ -335,8 +335,9 @@ for PLAYER in ${PLAYERONE[@]}; do
IRSS=$(ipfs add -q ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json | tail -n 1) \
&& ipfs name publish --key="${PLAYER}_feed" /ipfs/${IRSS}
######################### REPLACE TW with REDIRECT (reduce 12345 cache size)
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${ASTRONAUTENS}'\" />${PLAYER}" \
######################### REPLACE TW with REDIRECT to latest IPFS or IPNS (reduce 12345 cache size)
[[ ! -z ${TW} ]] && TWLNK="/ipfs/${TW}" || TWLNK="/ipns/${ASTRONAUTENS}"
echo "<meta http-equiv=\"refresh\" content=\"0; url='${TWLNK}'\" />${PLAYER}" \
> ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${IRSS}'\" />${PLAYER}" \

View File

@ -173,17 +173,20 @@ for SECTOR in ${SECTORS[@]}; do
" > ~/.zen/tmp/world.js
floop=1
UMAPTW=($(cat ~/.zen/tmp/swarm/*/UPLANET/_${SLAT}*_${SLON}*/TW/*/index.html | grep -o "/ipns/[^\"]*" | sed "s/'$//" | sort | uniq))
for TWADD in ${UMAPTW[@]};
do
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/'$//")
## ADD ASTRONAUTNS ON SECTOR WORLD MAP
echo "${floop}: {
alpha: Math.random() * 2 * Math.PI,
delta: Math.random() * 2 * Math.PI,
name: '"${floop}"',
name: '"${ZMAIL}"',
link: '"${TWADD}"'
}
," >> ~/.zen/tmp/world.js

View File

@ -277,6 +277,7 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />" > ~/.z
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}: {

View File

@ -479,7 +479,7 @@ if [[ $XDG_SESSION_TYPE == 'x11' ]]; then
###
fi
EARTHCID="/ipfs/QmcZgAPVt9FiePnSy3zjT8T1kKHrhMAT7GT46Vsi43MACv"
EARTHCID="/ipfs/QmaWofxVaxSwssvUVY8WssQY6P2Xhz4SHDPrSBX89dQVki"
FLIPPERCID="${EARTHCID}/coinflip"
myUPLANET="${myIPFS}${EARTHCID}" ## EMAIL LAT LON KEY