Swarm.ConnMgr.LowWater & HighWater
This commit is contained in:
parent
0462b11d42
commit
880d5c109e
@ -17,17 +17,17 @@ sudo true
|
||||
|
||||
## Error funciton
|
||||
err() {
|
||||
echo -e "ERREUR: $1"
|
||||
exit 1
|
||||
echo -e "ERREUR: $1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# CHECK if daemon is already running
|
||||
if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]]; then
|
||||
echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!"
|
||||
ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers
|
||||
echo "ipfs bootstrap list: " && ipfs bootstrap list
|
||||
echo "Please RUN : sudo service ipfs stop"
|
||||
exit 1
|
||||
echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!"
|
||||
ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers
|
||||
echo "ipfs bootstrap list: " && ipfs bootstrap list
|
||||
echo "Please RUN : sudo service ipfs stop"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script" && exit 1
|
||||
@ -41,11 +41,11 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(
|
||||
MACHINE_TYPE=`uname -m`
|
||||
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz
|
||||
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz
|
||||
elif [ ${MACHINE_TYPE:0:3} == 'arm' ]; then
|
||||
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz
|
||||
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz
|
||||
else
|
||||
[ ! -f $MY_PATH/ipfs-update.tar.gz ] && err "Your $MACHINE_TYPE is not supported yet... Please add an issue."
|
||||
[ ! -f $MY_PATH/ipfs-update.tar.gz ] && err "Your $MACHINE_TYPE is not supported yet... Please add an issue."
|
||||
fi
|
||||
|
||||
echo "INSTALL ipfs-update >>>>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
@ -62,14 +62,14 @@ sudo ipfs-update install 0.7.0 || err "Install IPFS"
|
||||
[[ $isLAN ]] && ipfs init -p lowpower \
|
||||
|| ipfs init -p server
|
||||
|
||||
## Special Xbian init.d config
|
||||
## Special Xbian init.d config
|
||||
if [[ "$USER" == "xbian" ]]; then
|
||||
sudo cp ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs
|
||||
sudo chmod 755 /etc/init.d/ipfs
|
||||
sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log
|
||||
sudo cp ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs
|
||||
sudo chmod 755 /etc/init.d/ipfs
|
||||
sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log
|
||||
else
|
||||
## DEBIAN
|
||||
echo "CREATE SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>>>>"
|
||||
## DEBIAN
|
||||
echo "CREATE SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>>>>"
|
||||
cat > /tmp/ipfs.service <<EOF
|
||||
[Unit]
|
||||
Description=IPFS daemon
|
||||
@ -86,12 +86,12 @@ CPUQuota=60%
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo cp -f /tmp/ipfs.service /etc/systemd/system/
|
||||
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/ipfs.service
|
||||
sudo cp -f /tmp/ipfs.service /etc/systemd/system/
|
||||
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/ipfs.service
|
||||
|
||||
[[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ipfs
|
||||
[[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ipfs
|
||||
fi
|
||||
|
||||
|
||||
@ -109,7 +109,8 @@ ipfs config Datastore.StorageMax $diskSize
|
||||
## Activate Rapid "ipfs p2p"
|
||||
ipfs config --json Experimental.Libp2pStreamMounting true
|
||||
ipfs config --json Experimental.P2pHttpProxy true
|
||||
|
||||
ipfs config --json Swarm.ConnMgr.LowWater 200
|
||||
ipfs config --json Swarm.ConnMgr.HighWater 400
|
||||
######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ###########
|
||||
ipfs bootstrap rm --all
|
||||
###########################################
|
||||
|
Loading…
Reference in New Issue
Block a user