forked from axiom-team/astroport
sbotc
This commit is contained in:
parent
f7acc359c7
commit
c2766585d4
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
ipfs() {
|
||||||
# Install IPFS
|
# Install IPFS
|
||||||
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
@ -16,54 +16,54 @@ fi
|
||||||
|
|
||||||
[[ -d ~/.ipfs ]] && echo "IPFS install exist, please remove backup before execute this script" && exit 1
|
[[ -d ~/.ipfs ]] && echo "IPFS install exist, please remove backup before execute this script" && exit 1
|
||||||
|
|
||||||
echo -e "${c_yellow}Onboarding IPFS...$c_"
|
echo -e "${c_yellow}Onboarding IPFS...$c_"
|
||||||
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
|
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
|
||||||
if [[ $ARM == "yes" ]]; then
|
|
||||||
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
|
|
||||||
else
|
|
||||||
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-amd64.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "INSTALL ipfs-update"
|
|
||||||
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err+="Untar ipfs-update"
|
|
||||||
rm $MY_PATH/ipfs-update.tar.gz
|
|
||||||
cd /usr/src/ipfs-update/
|
|
||||||
sudo ./install.sh || err+="Install ipfs-update"
|
|
||||||
cd $MY_PATH
|
|
||||||
|
|
||||||
echo "INSTALL latest ipfs"
|
|
||||||
sudo ipfs-update install latest || err+="Install IPFS"
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ! -f /etc/systemd/system/ipfs.service ]]; then
|
if [[ $ARM == "yes" ]]; then
|
||||||
|
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
|
||||||
|
else
|
||||||
|
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-amd64.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "CREATE SYSTEMD ipfs SERVICE"
|
echo "INSTALL ipfs-update"
|
||||||
sudo cp -f $templates/ipfs.service /etc/systemd/system/
|
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err+="Untar ipfs-update"
|
||||||
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
|
rm $MY_PATH/ipfs-update.tar.gz
|
||||||
fi
|
cd /usr/src/ipfs-update/
|
||||||
sudo systemctl daemon-reload || err+="Restart IPFS"
|
sudo ./install.sh || err+="Install ipfs-update"
|
||||||
sudo systemctl enable ipfs || err+="Enable IPFS daemon"
|
cd $MY_PATH
|
||||||
|
|
||||||
################
|
echo "INSTALL latest ipfs"
|
||||||
# BECOME $USER
|
sudo ipfs-update install latest || err+="Install IPFS"
|
||||||
# INIT ipfs
|
|
||||||
ipfs init -p lowpower
|
|
||||||
# ipfs init -p server ## Uncomment for server infrastructure
|
|
||||||
|
|
||||||
# ACTIVATE CONFIG OPTIONS
|
echo "CREATE SYSTEMD ipfs SERVICE"
|
||||||
# PUBSUB
|
sudo cp -f $templates/ipfs.service /etc/systemd/system/
|
||||||
ipfs config Pubsub.Router gossipsub
|
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
|
||||||
# MAXSTORAGE
|
|
||||||
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
|
sudo systemctl daemon-reload || err+="Restart IPFS"
|
||||||
diskSize="$((availableDiskSize / 2))"
|
sudo systemctl enable ipfs || err+="Enable IPFS daemon"
|
||||||
ipfs config Datastore.StorageMax $diskSize
|
|
||||||
## PORT FORWARD (SSH)
|
|
||||||
ipfs config --json Experimental.Libp2pStreamMounting true
|
|
||||||
|
|
||||||
######### UPDATE BOOTSTRAP LIST ###########
|
# INIT ipfs
|
||||||
ipfs bootstrap rm --all
|
ipfs init -p lowpower
|
||||||
|
# ipfs init -p server ## Uncomment for server infrastructure
|
||||||
|
|
||||||
sudo systemctl daemon-reload || err+="Restart IPFS"
|
# ACTIVATE CONFIG OPTIONS
|
||||||
|
# PUBSUB
|
||||||
|
ipfs config Pubsub.Router gossipsub
|
||||||
|
# MAXSTORAGE
|
||||||
|
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
|
||||||
|
diskSize="$((availableDiskSize / 2))"
|
||||||
|
ipfs config Datastore.StorageMax $diskSize
|
||||||
|
## PORT FORWARD (SSH)
|
||||||
|
ipfs config --json Experimental.Libp2pStreamMounting true
|
||||||
|
|
||||||
|
######### UPDATE BOOTSTRAP LIST ###########
|
||||||
|
ipfs bootstrap rm --all
|
||||||
|
|
||||||
|
sudo systemctl restart ipfs || err+="Restart IPFS daemon"
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
$@
|
||||||
|
|
|
@ -25,13 +25,23 @@ __) _|_ |_ |\ /--\ \_|
|
||||||
mkdir -p ~/.zen
|
mkdir -p ~/.zen
|
||||||
sudo apt update || true
|
sudo apt update || true
|
||||||
libzzz=$(sudo apt-cache search libsodium | awk '{print $1}' | grep libsodium2)
|
libzzz=$(sudo apt-cache search libsodium | awk '{print $1}' | grep libsodium2)
|
||||||
sudo apt install build-essential $libzzz -y
|
sudo apt install build-essential jq $libzzz -y
|
||||||
sudo pip3 install base58
|
sudo pip3 install base58
|
||||||
sudo apt install python3-pip python3-setuptools python3-wheel -y
|
sudo apt install python3-pip python3-setuptools python3-wheel -y
|
||||||
pip3 install silkaj --user
|
pip3 install silkaj --user
|
||||||
echo 'PATH=$PATH:~/.local/bin' >> ~/.bashrc && source ~/.bashrc
|
echo 'PATH=$PATH:~/.local/bin' >> ~/.bashrc && source ~/.bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# INSTALL sbotc
|
||||||
|
if [[ ! $(which sbotc) ]]; then
|
||||||
|
cd /tmp
|
||||||
|
sudo apt install libsodium-dev jq -y
|
||||||
|
git clone https://git.scuttlebot.io/%25133ulDgs%2FoC1DXjoK04vDFy6DgVBB%2FZok15YJmuhD5Q%3D.sha256 sbotc
|
||||||
|
cd sbotc
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
cd $MY_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -d ~/.ssb ]]; then
|
if [[ -d ~/.ssb ]]; then
|
||||||
echo "ScuttleButt is already installed...??"
|
echo "ScuttleButt is already installed...??"
|
||||||
|
|
Loading…
Reference in New Issue