forked from STI/Astroport.ONE
PING & CONNECT to Boostrap && /swarm/*
This commit is contained in:
parent
052ec4e539
commit
97677b4024
@ -1,19 +1,39 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
## SHOW DHT STATS
|
||||||
|
echo "------------------------------------------------- ~/.zen/tmp/ipfs.stats.dht.wan"
|
||||||
|
echo "GETTING DHT STATS"
|
||||||
ipfs stats dht wan > ~/.zen/tmp/ipfs.stats.dht.wan
|
ipfs stats dht wan > ~/.zen/tmp/ipfs.stats.dht.wan
|
||||||
cat ~/.zen/tmp/ipfs.stats.dht.wan
|
# cat ~/.zen/tmp/ipfs.stats.dht.wan
|
||||||
|
|
||||||
|
## BOOSTRAP
|
||||||
|
echo "-------------------------------------------------"
|
||||||
|
echo "SWARM NODES"
|
||||||
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | grep -v '^[[:space:]]*$')
|
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | grep -v '^[[:space:]]*$')
|
||||||
do
|
do
|
||||||
echo
|
echo
|
||||||
ipfsnodeid=${bootnode##*/}
|
ipfsnodeid=${bootnode##*/}
|
||||||
ipfs swarm peers | grep $bootnode
|
ipfs swarm peers | grep $bootnode
|
||||||
ipfs ping -n 3 $bootnode
|
ipfs --timeout 15s ping -n 3 $bootnode
|
||||||
[ $? = 0 ] && ipfs swarm connect $bootnode \
|
[ $? = 0 ] && ipfs swarm connect $bootnode \
|
||||||
|| echo "BAD NODE $bootnode"
|
|| echo "BAD NODE $bootnode"
|
||||||
echo "*****"
|
echo "*****"
|
||||||
|
echo "in DHT ? --------------"
|
||||||
cat ~/.zen/tmp/ipfs.stats.dht.wan | grep $ipfsnodeid
|
cat ~/.zen/tmp/ipfs.stats.dht.wan | grep $ipfsnodeid
|
||||||
|
echo "-------------------------------------------------"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
## SWARM
|
||||||
|
echo
|
||||||
|
echo "-------------------------------------------------"
|
||||||
|
echo "SWARM NODES"
|
||||||
|
for ipfsnodeid in $(ls ~/.zen/tmp/swarm);
|
||||||
|
do
|
||||||
|
ipfs --timeout 15s ping -n 3 /p2p/$ipfsnodeid
|
||||||
|
[ $? = 0 ] && ipfs swarm connect /p2p/$ipfsnodeid \
|
||||||
|
|| echo "BAD NODE $ipfsnodeid"
|
||||||
|
echo "in DHT ? --------------"
|
||||||
|
cat ~/.zen/tmp/ipfs.stats.dht.wan | grep $ipfsnodeid
|
||||||
|
echo "-------------------------------------------------"
|
||||||
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user