Browse Source

swarm desync correction

master
fred 1 month ago
parent
commit
ea3e841fea
  1. 12
      zen/gchange_IPFS_swarm.sh
  2. 2
      zen/ipfs_SWARM_refresh.sh

12
zen/gchange_IPFS_swarm.sh

@ -35,6 +35,18 @@ echo $(date)
########################################################################
rm -f /tmp/liking_me ## FILE WILL BE REFRESHED
## REFRESH IPFS SWARM FROM AVAILABLE FRIENDS
for g1friend in $(find ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/ -type d | rev | cut -d '/' -f 1 | rev);
do
ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend)
echo "### $g1friend ipfs reading XID"
XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid)
if [[ $XID ]]; then
echo "### REFRESH ipfs_swarm $ipfsnodeid ($XID)"
ipfs --timeout=360s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
fi
done
# Check liking_me station in my swarm FRIENDS
for swarm_frof in $(ls ~/.zen/ipfs_swarm/.*/FRIENDS/$G1PUB/stars.level | cut -d '/' -f 6 | cut -d '.' -f 2); ## FROM IPFS
do

2
zen/ipfs_SWARM_refresh.sh

@ -62,7 +62,9 @@ cp ~/.ipfs/config ~/.ipfs/config.new ## Prepare Peering.Peers changes
# for ipfsnodeid in $( (cat /tmp/ipfs_swarm_peers | grep -o '[^/]*$' && cat /tmp/A_swarm | grep -o '[^/]*$' ) | sort | uniq); ## TODO ACTIVATE IN DEFCON 4
for ipfsnodeid in $(cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/tryme.addr | grep -o '[^/]*$' | sort | uniq);
#for g1friend in $(find ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/ -type d | rev | cut -d '/' -f 1 | rev);
do
# ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend)
## $ipfsnodeid already Treated ?
[[ "$ipfsnodeid" == "$IPFSNODEID" ]] && continue
[[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid ]] && XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) || XID=''

Loading…
Cancel
Save