From 48970b176bd279f716bb98d2bc87edd385bf712a Mon Sep 17 00:00:00 2001 From: qo-op Date: Sat, 12 Dec 2020 00:56:07 +0100 Subject: [PATCH] using cesium+/gchange+ instead of scuttlebutt --- ISOconfig.sh | 4 ++-- install.sh | 11 ++++++----- zen/gchange_INIT.sh | 1 + zen/gchange_IPFS_swarm.sh | 23 ++++++++++------------- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/ISOconfig.sh b/ISOconfig.sh index 751479f..4a2d15c 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -181,8 +181,8 @@ echo 'INSTALL Astroport cron_MINUTE' # BETTER NOT: Send new 'ipfstryme' message on each boot is done instead echo "CHANGE hostname" -sudo sed -i s/xbian/$XZUID/g /etc/hostname -sudo sed -i s/xbian/$XZUID/g /etc/hosts +sudo sed -i s/astrxbian/$XZUID/g /etc/hostname +sudo sed -i s/astrxbian/$XZUID/g /etc/hosts echo "CHANGE DNS" # Avoid provider restrictions sudo cat > /etc/resolv.conf < ~/.zen/ipfs/.${IPFSNODEID}/disk.perf echo $(df ~/.ipfs/ | tail -n 1 | awk '{print $4}') > ~/.zen/ipfs/.${IPFSNODEID}/disk.bytes +## PUBLISH ~/.zen/ipfs on self key IPNS IWALLETS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) NODEIPNS=$(ipfs name publish --allow-offline --quieter /ipfs/$IWALLETS) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index d652fe3..4bb70e6 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -22,14 +22,6 @@ ME="${0##*/}" ## TODO : Beware of liking_me FLOOD & Invite $liking_me people to my #Swarm0 -######################################################################## -## CONNECT GLOBAL "ipfs.io" ## DANGEROUS DATA LEAK only for short time... -######################################################################## -# ADD ipfs.io public bootstrap into your swarm peers -# RUN: cat ~/.zen/astroport/ipfs.swarm.ipfs.io | ipfs swarm connect -# SOON ipfs swarm peers will GROW!!! YOU ARE VSIBLE !!! -# RUN: sudo systemctl restart ipfs # GOES BACK TO SWARM0 -######################################################################## ######################################################################## # ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info @@ -43,6 +35,7 @@ isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|gr # Force Strict #swarm0 !!? # ipfs bootstrap rm --all echo "" > ~/.zen/A_allow_ip.txt + echo "" > ~/.zen/A_liking_me_NO_ipfstryme.txt # contains "friends" with no "ipfstryme" incoming message liking_me_count=0 friend_of_mine_count=0 @@ -65,7 +58,7 @@ do echo $ip >> ~/.zen/A_allow_ip.txt # Get its ipfsnodeid ipfsnodeid=$(echo "$peer" | awk -F '/' '{print $7}') - + # 3. ADD liking_me friend_of_mine to my swarm & bootstrap ipfs swarm connect $peer; ipfs bootstrap add $peer; @@ -73,15 +66,19 @@ do ipfsadd=$((ipfsadd+1)) done; + #g1id=$(~/.zen/astroport/zen/tools/ipfs_to_g1.py "$ipfsnodeid") + #echo "G1 ID : $g1id" + if [[ $friend_of_mine != null ]]; then if [[ $ipfsadd == 0 ]]; then # Friend of mine with no ipfstryme message (did not install astroport) echo "No 'ipfstryme' message... from $liking_me" echo "$liking_me" >> ~/.zen/A_liking_me_NO_ipfstryme.txt - else + else + # REMOVING DUPLICATES OLD ipfstryme MESSAGES nbmessage=0 - for messageid in $(./jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq -r '.id') + for messageid in $(./jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id') do nbmessage=$((nbmessage+1)) [ $nbmessage -gt 1 ] && echo "Delete OLD 'ipfstryme' messages from $liking_me" && ./jaklis.py delete -i $messageid @@ -106,9 +103,9 @@ My actual #SWARM0" ipfs swarm peers echo "__________________________________________" echo -## Send message to +## Could send message to friends with 'ipfstryme' message for line in $(cat ~/.zen/A_liking_me_NO_ipfstryme.txt | uniq); do - echo "Liking ME, but no ipfstryme received..." + echo "Liking each other, but no ipfstryme received..." echo "cd ~/.zen/astroport/zen/jaklis" echo "./jaklis.py send -d $line -t 'Astroport' -m 'Rejoins mon #Swarm0 https://copylaradio.com'" done