SSBFRIEND
This commit is contained in:
parent
2b8505d6f9
commit
9e35153c17
|
@ -60,28 +60,36 @@ count=1
|
|||
########################################################################
|
||||
# Let's look if our SSB Friends ARE "IPFS swarm connected"
|
||||
########################################################################
|
||||
echo "" > /tmp/This_friends_should_install_astroport
|
||||
for SSBFRIEND in $(cat /tmp/ssb-friends.txt); do
|
||||
|
||||
# Force Strict #swarm0 !!
|
||||
[[ $count == 1 ]] && ipfs bootstrap rm --all
|
||||
|
||||
### sbotc $SSBFRIEND name
|
||||
sbotc query.read '{"query":[{"$filter":{"value":{"author": "'"$SSBFRIEND"'", "content":{"type":"about", "about": "'"$ssbme"'"}}}}]}' | jq -r .value?.content?.name | grep -v null | tail -n 1
|
||||
MYFRIEND=$(sbotc query.read '{"query":[{"$filter":{"value":{"author": "'"$SSBFRIEND"'", "content":{"type":"about", "about": "'"$SSBFRIEND"'"}}}}]}' | jq -r .value?.content?.name | grep -v null | tail -n 1)
|
||||
### GET SSB "ipfstryme" message type !!! Astroport Node should have publish it during "ssb_INIT.sh"
|
||||
TRYME=$(sbotc query.read '{"query":[{"$filter":{"value":{"author": "'"$SSBFRIEND"'", "content":{"type":"ipfstryme"}}}}]}' | jq -r .value?.content?.text | tail -n 1)
|
||||
|
||||
## !! REMOVE NOTfriends from IPFS swarm
|
||||
[[ $TRYME ]] && [[ $(grep -Rwl "$SSBFRIEND" /tmp/ssb-NOTfriends.txt) ]] && echo "NOT $TRYME" && ipfs swarm disconnect $TRYME && ipfs bootstrap rm $TRYME && continue
|
||||
|
||||
[[ $TRYME ]] && [[ $(grep -Rwl "$SSBFRIEND" /tmp/ssb-NOTfriends.txt) ]] && MES="($count) HUMMMM $MYFRIEND ($SSBFRIEND) IS NOT my friend disconnecting" && ipfs swarm disconnect $TRYME && ipfs bootstrap rm $TRYME && continue
|
||||
## Ici, on peut décider de demander à faire supprimer la couche astroport à son PAS AMI
|
||||
|
||||
## ADD Friend to our IPFS swarm
|
||||
[[ $TRYME ]] && echo "Friend $TRYME" && ipfs swarm connect $TRYME && ipfs bootstrap add $TRYME
|
||||
[[ $TRYME ]] && MES="($count) $MYFRIEND ($SSBFRIEND) connect OK $TRYME" && ipfs swarm connect $TRYME && ipfs bootstrap add $TRYME
|
||||
## Ce pote est connecté IPFS avec moi
|
||||
|
||||
[[ ! $TRYME ]] && echo "$SSBFRIEND missing ipfstryme"
|
||||
## This_friends_should_install_astroport
|
||||
[[ ! $TRYME ]] && MES="($count) $MYFRIEND ($SSBFRIEND) is NOT running ASTROPORT !!!" && echo $MES >> /tmp/This_friends_should_install_astroport
|
||||
|
||||
### WHAT HAPPENED this loop on my ssb friends
|
||||
echo $MES
|
||||
|
||||
count=$((count+1))
|
||||
|
||||
done
|
||||
|
||||
|
||||
echo "$WHOAMI ipfs peers are:"
|
||||
echo "__________________________________________
|
||||
$WHOAMI ipfs peers are:"
|
||||
ipfs swarm peers
|
||||
|
|
Loading…
Reference in New Issue