A_boostrap_nodes.txt format change

This commit is contained in:
qo-op 2021-05-09 22:25:26 +02:00
parent bebb93ebc9
commit 8aa121b7b0
4 changed files with 25 additions and 14 deletions

View File

@ -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

View File

@ -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
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,9 +199,11 @@ 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
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

View File

@ -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

View File

@ -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}