From 8aa121b7b0d46e669f1456d1233ceb9646c0f1ef Mon Sep 17 00:00:00 2001 From: qo-op Date: Sun, 9 May 2021 22:25:26 +0200 Subject: [PATCH] A_boostrap_nodes.txt format change --- A_boostrap_nodes.txt | 10 +++++----- ISOconfig.sh | 18 ++++++++++++------ zen/gchange_INIT.sh | 6 ++++-- zen/new_file_in_astroport.sh | 5 ++++- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/A_boostrap_nodes.txt b/A_boostrap_nodes.txt index 6e2337c..5a4c09a 100644 --- a/A_boostrap_nodes.txt +++ b/A_boostrap_nodes.txt @@ -1,5 +1,5 @@ -# CONTAINS G1PUB of bootstrap PUB Station -# oasis.astroport.com -2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS -# aries.copylaradio.com (thuya83pk) -HbBJDXDrN8swxvMohMxmegYRyZ7m99jqgxwwN1gwxck2 +# CONTAINS Address of 1st Bootstrap Stations (24/24 Public IP) +# oasis.astroport.com = 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS +/ip4/51.15.166.54/tcp/4001/p2p/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN +# aries.copylaradio.com (thuya83pk) = HbBJDXDrN8swxvMohMxmegYRyZ7m99jqgxwwN1gwxck2 +/ip4/37.187.127.175/tcp/4001/p2p/12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx diff --git a/ISOconfig.sh b/ISOconfig.sh index b5fd0fb..4a5d6a6 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -132,15 +132,19 @@ echo "CREATING CESIUM+ PROFILE" ######################################################################## echo "BECOME FRIEND with A_boostrap_nodes.txt" ######################################################################## -for g1node in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments +for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments do -if [[ "$g1node" != "" ]]; then - echo "SENDING STAR TO BOOTSTRAP NODE : $g1node" +if [[ $bootnode != "" ]]; then + ipfsnodeid=${bootnode##*/} + g1node=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) + echo "SENDING STAR TO BOOTSTRAP NODE : $g1node" ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.e-is.pro" stars -p $g1node -n 1 ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $g1node -n 1 ### DELETE # ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.e-is.pro" unstars -p $g1node # ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" unstars -p $g1node + ## ADD TO BOOTSTRAP + ipfs bootstrap add $bootnode fi done @@ -195,10 +199,12 @@ echo 'Sending "ipfstryme" message' ######################################################################## echo 'Sending \"ipfstryme\" message to BOOTSTRAP nodes' # Add bootstrap in A_boostrap_nodes.txt ######################################################################## -for g1node in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments +for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments do -if [[ $g1node != "" ]]; then - echo "SENDING ipfstryme to BOOTSTRAP node : $g1node" +if [[ $bootnode != "" ]]; then + ipfsnodeid=${bootnode##*/} + g1node=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) + echo "SENDING ipfstryme to BOOTSTRAP node : $g1node" # ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.le-sou.org" send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr fi diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index c491219..accb129 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -100,7 +100,9 @@ fi #### FRIENDS && BOOTSTRAP ipfstryme MESSAGE sending procedure ######################################################################## # GET LIST of issuer(s) who likes me & A_boostrap_nodes.txt -IamBOOTSTRAP=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # AM I A BOOTSTRAP ? +IamINBOOTSTRAP=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$IPFSNODEID") # AM I A BOOTSTRAP ? +ipfsnodeid=${IamINBOOTSTRAP##*/} +IamBOOTSTRAP=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) # Contains G1PUB ################## AUTO PINNING for BOOTSTRAP [[ $IamBOOTSTRAP ]] && ~/.zen/astrXbian/zen/tools/autoPINfriends.sh @@ -108,7 +110,7 @@ IamBOOTSTRAP=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # AM I ################## CHECKING WHO GAVE ME STARS -for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' && cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#"); +for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' && ~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | shuf) ); do ##### BOOTSTRAP AUTO LIKE BACK (NOT liking Myself) if [[ "$IamBOOTSTRAP" == "$G1PUB" ]]; then diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index db6bbeb..d906e69 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -188,7 +188,10 @@ echo "$IPFSID" > /tmp/.ipfsid ######################################################################## ################ ask autoPIN to one shuffle A_boostrap_nodes ######################################################################## -PINnode=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | shuf | tail -n 1) +PINIPFSnode=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | shuf | tail -n 1) +nodeid=${PINIPFSnode##*/} +PINnode=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $nodeid) + echo "ASK AUTOPIN to $PINnode" ## CREATE $PINnode IPFS communication directory [[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/KEY/${INDEXPREFIX}${REFERENCE}/${G1PUB}/${PINnode} ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/KEY/${INDEXPREFIX}${REFERENCE}/${G1PUB}/${PINnode}