peering peers only the one who sync
This commit is contained in:
parent
d74b7528b5
commit
e2dea7e5af
|
@ -114,17 +114,6 @@ do
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
################################################################
|
################################################################
|
||||||
echo "@@ CREATING Peering.Peer @@"
|
|
||||||
echo "jq '.Peering.Peers? += { \"Addrs\": [], \"ID\": \"'$ipfsnodeid'\" }'"
|
|
||||||
################################################################
|
|
||||||
Addr=$(echo "$peerline" | rev | cut -d '/' -f 2- | rev )
|
|
||||||
IsAlreadythere=$(cat ~/.ipfs/config.new | grep '"$ipfsnodeid"') && echo $IsAlreadythere
|
|
||||||
if [[ ! $IsAlreadythere ]]; then
|
|
||||||
echo '{ "ID": "'$ipfsnodeid'", "Addrs": [] }' >> ~/.zen/A_peering_peers.txt
|
|
||||||
#jq '.Peering.Peers? += { "Addrs": [], "ID": "'$ipfsnodeid'" }' ~/.ipfs/config.new > ~/.ipfs/config.wew && cp ~/.ipfs/config.wew ~/.ipfs/config.new
|
|
||||||
jq '.Peering.Peers[.Peering.Peers| length] |= . + { "Addrs": [], "ID": "'$ipfsnodeid'" }' ~/.ipfs/config.new > ~/.ipfs/config.wew && cp ~/.ipfs/config.wew ~/.ipfs/config.new
|
|
||||||
fi
|
|
||||||
################################################################
|
|
||||||
## Refresh bootstrap if XID exists
|
## Refresh bootstrap if XID exists
|
||||||
[[ "$XID" != "" ]] && ipfs bootstrap rm "/ipfs/$ipfsnodeid" && ipfs bootstrap add "$peerline" || ipfs bootstrap rm "$peerline"
|
[[ "$XID" != "" ]] && ipfs bootstrap rm "/ipfs/$ipfsnodeid" && ipfs bootstrap add "$peerline" || ipfs bootstrap rm "$peerline"
|
||||||
################################################################
|
################################################################
|
||||||
|
@ -138,6 +127,17 @@ do
|
||||||
then
|
then
|
||||||
echo "TIMEOUT REACHED ___ SHOULD I REMOVE $ipfsnodeid FROM ~/.zen/A_my_swarm.txt? DO NOTHING";
|
echo "TIMEOUT REACHED ___ SHOULD I REMOVE $ipfsnodeid FROM ~/.zen/A_my_swarm.txt? DO NOTHING";
|
||||||
else
|
else
|
||||||
|
################################################################
|
||||||
|
echo "@@ CREATING Peering.Peer @@"
|
||||||
|
echo "jq '.Peering.Peers? += { \"Addrs\": [], \"ID\": \"'$ipfsnodeid'\" }'"
|
||||||
|
################################################################
|
||||||
|
Addr=$(echo "$peerline" | rev | cut -d '/' -f 2- | rev )
|
||||||
|
IsAlreadythere=$(cat ~/.ipfs/config.new | grep '"$ipfsnodeid"') && echo $IsAlreadythere
|
||||||
|
if [[ ! $IsAlreadythere ]]; then
|
||||||
|
echo '{ "ID": "'$ipfsnodeid'", "Addrs": [] }' >> ~/.zen/A_peering_peers.txt
|
||||||
|
#jq '.Peering.Peers? += { "Addrs": [], "ID": "'$ipfsnodeid'" }' ~/.ipfs/config.new > ~/.ipfs/config.wew && cp ~/.ipfs/config.wew ~/.ipfs/config.new
|
||||||
|
jq '.Peering.Peers[.Peering.Peers| length] |= . + { "Addrs": [], "ID": "'$ipfsnodeid'" }' ~/.ipfs/config.new > ~/.ipfs/config.wew && cp ~/.ipfs/config.wew ~/.ipfs/config.new
|
||||||
|
fi
|
||||||
################################################################
|
################################################################
|
||||||
echo "## REFRESH stargates keys from my friend"
|
echo "## REFRESH stargates keys from my friend"
|
||||||
################################################################
|
################################################################
|
||||||
|
|
Loading…
Reference in New Issue