transition to ipfs backend

This commit is contained in:
fred 2021-09-03 17:59:15 +02:00
parent 2aff2ff612
commit 1d505b8d8b
1 changed files with 6 additions and 10 deletions

View File

@ -101,13 +101,6 @@ do
## CHECKING VALUE CAPSULE
starsin=$(ipfs --timeout=10s cat /ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/$G1PUB/stars.level)
starsout=$(ipfs --timeout=10s cat /ipns/$IPFSNODEID/.$IPFSNODEID/FRIENDS/$whoisg1/stars.level)
Addr=$(echo "$peerline" | rev | cut -d '/' -f 2- | rev )
## Prepare
[[ $starsin && $starsout ]] && echo '{
"ID": "'$ipfsnodeid'",
"Addrs": ["'$Addr'"]
},' >> ~/.zen/A_peering_peers.txt
# REFRESH A_swarm_map.txt
echo $peerline >> ~/.zen/A_swarm_map.txt
@ -135,12 +128,13 @@ do
"Addrs": ["'$Addr'"]
},' >> ~/.zen/A_peering_peers.txt
# jq '.Peering.Peers += [{"ID": "'$ipfsnodeid'", "Addrs": "["'$Addr'"]"}]'
else
echo "ALREADY RECORDED FRIEND"
fi
## Sync ipfs_swarm
ipfs --timeout=60s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
else
## REMOVE FRIENDS DIRECTORY
echo "NOT FULL FRIEND $ipfsnodeid / $whoisg1"
[[ "$liking_me" != "" ]] && rm -Rf ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me
# SEND ME A MESSAGE TO DECIDE WHAT TO DO ?
@ -164,10 +158,12 @@ echo $(date)
echo "####################################################"
# ipfs SWARM shaping
# ipfs_SWARM_refresh
[[ $(cat ~/.zen/A_my_swarm.txt | wc -l) -gt 0 ]] && ~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh && exit 0 || echo "SWARM LOST !! "
## SHOULD HAVE exit 0 before !!
########################################################################
########################################################################
## ERROR !! SHOULD HAVE exit 0 before !!
########################################################################
## SWARM LOST !! EMERGENCY RECOVERY CODE !!!
########################################################################