From 19f2da3a53ee86e0d4016e2a3a52de4979e50c95 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 1 Oct 2022 16:18:15 +0200 Subject: [PATCH] EVOLVE TO P2P QOS MAP --- 20h12.process.sh | 7 +++++-- ASTROBOT/PLAYER.refresh.sh | 13 +++++++++++-- ASTROBOT/VOEUX.refresh.sh | 9 ++++++--- A_boostrap_nodes.txt | 6 +++--- install.sh | 2 +- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/20h12.process.sh b/20h12.process.sh index 05bb2a8e..468b2d90 100755 --- a/20h12.process.sh +++ b/20h12.process.sh @@ -15,13 +15,16 @@ start=`date +%s` ## PROCESS TW BACKOFFICE TREATMENT cd ~/.zen/Astroport.ONE/ git pull +## SOON /ipns/ Address !!! +# Refresh ~/.zen/game/world/G1VOEU ~/.zen/Astroport.ONE/ASTROBOT/VOEUX.refresh.sh + +# Refresh ~/.zen/game/players/PLAYER ~/.zen/Astroport.ONE/ASTROBOT/PLAYER.refresh.sh -## ADD A_boostrap_nodes.txt TO BOOTSTRAP - +## REFRESH BOOTSTRAP LIST (OFFICIAL SWARM) ipfs bootstrap rm --all > /dev/null 2>&1 for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#") # remove comments do diff --git a/ASTROBOT/PLAYER.refresh.sh b/ASTROBOT/PLAYER.refresh.sh index 1ef95c5d..75951f8e 100755 --- a/ASTROBOT/PLAYER.refresh.sh +++ b/ASTROBOT/PLAYER.refresh.sh @@ -26,7 +26,13 @@ for PLAYER in $(ls ~/.zen/game/players/); do rm -Rf ~/.zen/tmp/astro mkdir -p ~/.zen/tmp/astro - ipfs --timeout 12s cat /ipns/$ASTRONAUTENS > ~/.zen/tmp/astro/index.html + + echo "Getting latest online TW..." + YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); + LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2) + echo "$LIBRA/ipns/$voeuns" + [[ $YOU ]] && ipfs --timeout 12s cat /ipns/$ASTRONAUTENS > ~/.zen/tmp/astro/index.html \ + || curl -so ~/.zen/tmp/astro/index.html "$LIBRA/ipns/$ASTRONAUTENS" if [ ! -s ~/.zen/tmp/astro/index.html ]; then @@ -34,7 +40,7 @@ for PLAYER in $(ls ~/.zen/game/players/); do continue else ## Replace tube links with downloaded video ## TODO create LOG tiddler - $MY_PATH/../tools/TUBE.copy.sh ~/.zen/tmp/astro/index.html $PLAYER + $MY_PATH/TUBE.copy.sh ~/.zen/tmp/astro/index.html $PLAYER ## LAN TO WAN MIGRATION myIP=$(hostname -I | awk '{print $1}' | head -n 1) @@ -167,7 +173,10 @@ done done +################################################################# ## IPFSNODEID ROUTING +## PUBLISHING ASTRONAUTS LIST +## EVOLVE TO P2P QOS MAP ROUTING=$(ipfs add -q ~/.zen/game/astronautes.txt) echo "PUBLISHING IPFSNODEID / Astronaute List" ipfs name publish /ipfs/$ROUTING diff --git a/ASTROBOT/VOEUX.refresh.sh b/ASTROBOT/VOEUX.refresh.sh index 2689243e..7d99e961 100755 --- a/ASTROBOT/VOEUX.refresh.sh +++ b/ASTROBOT/VOEUX.refresh.sh @@ -12,7 +12,6 @@ ME="${0##*/}" # Backup and chain [[ $PLAYER == "" ]] && PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) - ############################################ echo "## WORLD VOEUX" @@ -31,7 +30,11 @@ do mkdir -p ~/.zen/tmp/work echo "Getting latest online TW..." - ipfs --timeout 12s cat /ipns/$voeuns > ~/.zen/tmp/work/index.html + YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); + LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2) + echo "$LIBRA/ipns/$voeuns" + [[ $YOU ]] && ipfs --timeout 12s cat /ipns/$voeuns > ~/.zen/tmp/work/index.html \ + || curl -so ~/.zen/tmp/work/index.html "$LIBRA/ipns/$voeuns" if [[ ! -s ~/.zen/tmp/work/index.html ]]; then echo "UNAVAILABLE WISH! If you want to remove $W $voeu" @@ -42,7 +45,7 @@ do continue else ## Replace tube links with downloaded video - $MY_PATH/../tools/TUBE.copy.sh ~/.zen/tmp/work/index.html $voeu + $MY_PATH/TUBE.copy.sh ~/.zen/tmp/work/index.html $voeu ## LAN TO WAN MIGRATION myIP=$(hostname -I | awk '{print $1}' | head -n 1) diff --git a/A_boostrap_nodes.txt b/A_boostrap_nodes.txt index f9d32ce0..41025fae 100644 --- a/A_boostrap_nodes.txt +++ b/A_boostrap_nodes.txt @@ -1,7 +1,7 @@ -# CONTAINS Address of 1st Bootstrap Stations (24/24 Public IP) +# CONTAINS Address of 1st Bootstrap Stations (24/24 Public IP) - DO NOT EDIT MANUALY - +# http://libra.copylaradio.com:8080 +/ip4/149.102.158.67/udp/4001/quic/p2p/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u # cancer.astroport.com /ip4/185.202.238.69/tcp/4001/p2p/12D3KooWSnxRBuoeCZGdXBbSKiW8qM4HxLp3RLypW9dg82o41ZqM -# libra.copylaradio.com -/ip4/149.102.158.67/udp/4001/quic/p2p/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u # aries.copylaradio.com /ip4/37.187.127.175/tcp/4001/p2p/12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx diff --git a/install.sh b/install.sh index cfcb2185..5bc3716e 100755 --- a/install.sh +++ b/install.sh @@ -203,7 +203,7 @@ ipfs config --json Experimental.P2pHttpProxy true ipfs config --json Swarm.ConnMgr.LowWater 0 ipfs config --json Swarm.ConnMgr.HighWater 0 myIP=$(hostname -I | awk '{print $1}' | head -n 1) -ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://127.0.0.1:8080", "http://astroport", "https://astroport.com", "https://qo-op.com", "https://tube.copylaradio.com" ]' +ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://127.0.0.1:8080", "http://astroport", "https://astroport.com", "https://qo-op.com", "https://tube.copylaradio.com", "http://libra.copylaradio.com:8080" ]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'