forked from axiom-team/astrXbian
optimistic swarm connect
This commit is contained in:
parent
81694f5bc1
commit
ffd3f73d47
|
@ -1,3 +1,3 @@
|
|||
# CONTAINS G1PUB of bootstrap PUB Station
|
||||
# oasis.astroport.com
|
||||
2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS
|
||||
|
||||
#csmld
|
||||
|
|
|
@ -21,15 +21,14 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
|||
########################################################################
|
||||
|
||||
# GET NODE disk performance. TODO, publish and use as IPFS repartition
|
||||
echo "DISK SIZE AVAILABLE & PERFORMANCE TESTING"
|
||||
[[ -f ~/.ipfs/test.disk ]] && rm -f ~/.ipfs/test.disk
|
||||
diskperf=$(dd if=/dev/zero of=~/.ipfs/test.disk bs=10M count=1 oflag=dsync 2>&1 | tail -n 1 | sed s/\,\ /\ -/g | cut -d '-' -f 4)
|
||||
# echo $diskperf
|
||||
echo "DISK PERFORMANCE TESTING : $diskperf"
|
||||
|
||||
# IPFS LOCAL REPOSITORY for Node Identity
|
||||
mkdir -p ~/.zen/ipfs/.$IPFSNODEID/G1SSB
|
||||
|
||||
# find IPFSTRYME public address
|
||||
# create IPFSTRYME public address file
|
||||
~/.zen/astrXbian/zen/tools/add_externIP_to_ipfstryme.sh
|
||||
cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
||||
|
||||
|
@ -97,6 +96,7 @@ NODEIPNS=$(ipfs name publish --allow-offline --quieter /ipfs/$IWALLETS)
|
|||
|
||||
###
|
||||
# GET ALL MY GCHANGE FRIENDS AND SEND THEM my IPFS Address
|
||||
########################################################################
|
||||
# GET LIST of issuer(s) who likes me
|
||||
for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer');
|
||||
do
|
||||
|
@ -113,11 +113,16 @@ if [[ $g1node != "" ]]; then
|
|||
echo "LIKING my BOOTSTRAP node : $g1node"
|
||||
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.le-sou.org" send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
||||
~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
||||
|
||||
isG1PUBoot=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # search my G1PUB ?
|
||||
if [[ $isG1PUBoot == "$G1PUB" ]]; then
|
||||
for liking_me in $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer')
|
||||
do
|
||||
echo "SENDING 3 STARS to $liking_me"
|
||||
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me -s 3
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# SHOW RESULT
|
||||
cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
# Author: Fred (support@qo-op.com)
|
||||
# Version: 2020.12.22
|
||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||
########################################################################
|
||||
# Auto maticaly accept incoming frendship sending back 3 stars like
|
||||
# AstrXbian NODE running it starts acting like a "SSB" PUB
|
||||
# Best using 24/24 public IP node + 1 TB
|
||||
|
||||
# GET XZUID
|
||||
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid ]] && echo "ERROR no _xbian.zuid" && exit 1
|
||||
XZUID=$(cat ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid) # Should be hostname... but like that can be changed...
|
||||
|
||||
isG1PUBoot=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # search my G1PUB ?
|
||||
|
||||
if [[ $isG1PUBoot == "$G1PUB" ]]; then
|
||||
for liking_me in $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer')
|
||||
do
|
||||
echo "SENDING 3 STARS to $liking_me"
|
||||
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me -s 3
|
||||
echo "Our SWARM will join during ipfs_SWARM_refresh.sh RUN"
|
||||
done
|
||||
fi
|
||||
|
||||
~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh
|
||||
|
||||
echo "Share collected indexes as mine"
|
||||
cp /var/www/astrxbian/FASTRXBIAN ~/.zen/ipfs/xbian/F${XZUID}
|
||||
|
Loading…
Reference in New Issue