123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- #!/bin/bash
- set -e
- Version=2.3
- Gui=no
- function print_centered {
- [[ $# == 0 ]] && return 1
- declare -i TERM_COLS="$(tput cols)"
- declare -i str_len="${#1}"
- [[ $str_len -ge $TERM_COLS ]] && {
- echo "$1";
- return 0;
- }
- declare -i filler_len="$(( (TERM_COLS - str_len) / 2 ))"
- [[ $# -ge 2 ]] && ch="${2:0:1}" || ch=" "
- filler=""
- for (( i = 0; i < filler_len; i++ )); do
- filler="${filler}${ch}"
- done
- printf "%s%s%s" "$filler" "$1" "$filler"
- [[ $(( (TERM_COLS - str_len) % 2 )) -ne 0 ]] && printf "%s" "${ch}"
- printf "\n"
- return 0
- }
- print_centered "$(tput setaf 2)"
- print_centered " ______ __ __ "
- print_centered "| | |--.|__|.---.-."
- print_centered "| ---| || || _ |"
- print_centered "|______|__|__||__||___._|"
- echo -n "$(tput setaf 7)"
- print_centered "Toolkit for Chia v$Version"
- if [ $Gui = "YES" ]
- then
- echo -n "$(tput setaf 7)"
- print_centered "(Gui / wallet enabled)"
- fi
- print_centered "$(tput setaf 7)"
- sleep 3
- echo -e "$(tput setaf 2)\nUpdate and install packages:$(tput sgr0)"
- sudo apt-get install python3-venv python3-distutils python3-dev libsodium-dev -y
- echo -e "\e[97mDone.\e[0m"
- echo -e "$(tput setaf 2)\nDownload pack:$(tput sgr0)"
- ./download_pack.sh
- echo -e "$(tput setaf 2)\nBuild Chia-Miner:$(tput sgr0)"
- cp ../pack/chia-miner.tar.xz /home/wareck/
- cd /home/wareck
- tar xvfJ chia-miner.tar.xz
- rm chia-miner.tar.xz
- cat <<'EOF'>> chia-miner.sh
- cd /home/wareck/chia-miner/
- su wareck -c "screen -dmS chia-miner /home/wareck/chia-miner/hpool-miner-chia -config /home/wareck/chia-miner/config.yaml"
- exit 0
- EOF
- chmod +x chia-miner.sh
- sudo cp chia-miner.sh /etc/init.d/chia-miner
- sudo update-rc.d chia-miner defaults
- sudo rm chia-miner.sh
- echo -e "\e[97mDone.\e[0m"
- echo -e "$(tput setaf 2)\nBuild Chia-Plotter (MadMax) :$(tput sgr0)"
- cd /home/wareck
- if [ ! -d chia-plotter ]
- then
- git clone https://github.com/madMAx43v3r/chia-plotter.git
- else
- cd /home/wareck/chia-plotter
- git pull
- fi
- cd /home/wareck/chia-plotter
- git submodule init
- git submodule update
- ./make_devel.sh
- cd build
- cat <<'EOF'>> go.sh
- #!/bin/bash
- ./chia_plot -n 1 -r 4 -u 128 -t /media/Nvme/ -2 /media/Nvme/ -d /media/Partage/Plots/ -p a99e72c49c5ed39bf793caab9e074a80dd61011a859e975842874aab47b783f9ce84282febe2ca275c0930149b67990a -f 8ba5acd276b45fd0f749ce195dcddcf0e63c3bf2e751e9e273faa0125075c36a11f2ee231e7cf74abed2920be97fc373
- EOF
- chmod +x go.sh
- cat <<'EOF'>> nft.sh
- #!/bin/bash
- ./chia_plot -n 1 -r 4 -u 128 -t /media/Nvme/ -2 /media/Nvme/ -d /media/Partage/Plots-nft/ -c xch18c2jp56msc47yzww25wcnzz5fk9y268zl3zh357kftsp0n7l6m8scyqg4e -f 8ba5acd276b45fd0f749ce195dcddcf0e63c3bf2e751e9e273faa0125075c36a11f2ee231e7cf74abed2920be97fc373
- EOF
- chmod +x nft.sh
- echo -e "\e[97mDone.\e[0m"
- echo -e "$(tput setaf 2)\nBuild Chia-Pos:$(tput sgr0)"
- cd /home/wareck/
- if [ ! -d /home/wareck/chia-pos ]
- then
- git clone https://github.com/Chia-Network/chiapos.git chia-pos
- cd /home/wareck/chia-pos
- else
- cd /home/wareck/chia-pos
- git pull
- fi
- if [ ! -d build ]; then mkdir build;fi
- cd build
- cmake ..
- make -j4
- echo -e "\e[97mDone.\e[0m"
- if [ $Gui = "YES" ]
- then
- echo -e "$(tput setaf 2)\nBuild Chia-Gui :$(tput sgr0)"
- cd /home/wareck
- if [ ! -d /home/wareck/chia-pos ]
- then
- git clone https://github.com/Chia-Network/chia-blockchain.git -b latest --recurse-submodules
- cd chia-blockchain
- else
- cd chia-blockchain
- git pull
- fi
- sh install.sh
- source ./activate
- sh install-gui.sh
- fi
- echo -e "\n\e[97mEnd of process...\e[0m"
|