chia.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. #!/bin/bash
  2. #set -e
  3. Version=6.0.1
  4. Gui=Yes #can be Yes No or Only
  5. GigaHorse_farmer=Yes
  6. MadMax=Yes
  7. GigaHorse=Yes
  8. BladeBit=No
  9. ChiaPos=Yes
  10. H9_ChiaService=No
  11. H9_Miner=No
  12. H9_ChiaProxy=No
  13. FoxyPool=Yes
  14. FoxyPool_service=No
  15. function print_centered {
  16. [[ $# == 0 ]] && return 1
  17. declare -i TERM_COLS="$(tput cols)"
  18. declare -i str_len="${#1}"
  19. [[ $str_len -ge $TERM_COLS ]] && {
  20. echo "$1";
  21. return 0;
  22. }
  23. declare -i filler_len="$(( (TERM_COLS - str_len) / 2 ))"
  24. [[ $# -ge 2 ]] && ch="${2:0:1}" || ch=" "
  25. filler=""
  26. for (( i = 0; i < filler_len; i++ )); do
  27. filler="${filler}${ch}"
  28. done
  29. printf "%s%s%s" "$filler" "$1" "$filler"
  30. [[ $(( (TERM_COLS - str_len) % 2 )) -ne 0 ]] && printf "%s" "${ch}"
  31. printf "\n"
  32. return 0
  33. }
  34. #function jumpto
  35. #{
  36. # label=$1
  37. # cmd=$(sed -n "/$label:/{:a;n;p;ba};" $0 | grep -v ':$')
  38. # eval "$cmd"
  39. # exit
  40. #}
  41. function simplify_config {
  42. error_flag=0
  43. Gui=${Gui^^}
  44. H9_ChiaService=${H9_ChiaService^^}
  45. MadMax=${MadMax^^}
  46. GigaHorse=${GigaHorse^^}
  47. GigaHorse_farmer=${GigaHorse_farmer^^}
  48. BladeBit=${BladeBit^^}
  49. ChiaPos=${ChiaPos^^}
  50. H9_Miner=${H9_Miner^^}
  51. H9_ChiaProxy=${H9_ChiaProxy^^}
  52. FoxyPool=${FoxyPool^^}
  53. FoxyPool_service=${FoxyPool_service^^}
  54. if [[ "$Gui" == "YES" ]] || [[ "$Gui" == "NO" ]] || [[ "$Gui" == "ONLY" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1)) ;fi
  55. if [[ "$MadMax" == "YES" ]] || [[ "$MadMax" = "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1)) ;fi
  56. if [[ "$GigaHorse" == "YES" ]] || [[ "$GigaHorse" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
  57. if [[ "$GigaHorse_farmer" == "YES" ]] || [[ "$GigaHorse_farmer" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
  58. if [[ "$BladeBit" == "YES" ]] || [[ "$BladeBit" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
  59. if [[ "$ChiaPos" == "YES" ]] || [[ "$ChiaPos" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
  60. if [[ "$H9_ChiaService" == "YES" ]] || [[ "$H9_ChiaService" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
  61. if [[ "$H9_Miner" == "YES" ]] || [[ "$H9_Miner" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
  62. if [[ "$H9_ChiaProxy" == "YES" ]] || [[ "$H9_ChiaProxy" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
  63. if [[ "$FoxyPool" == "YES" ]] || [[ "$FoxyPool" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
  64. if [[ "$FoxyPool_service" == "YES" ]] || [[ "$FoxyPool_service" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
  65. }
  66. function intro_ {
  67. export TERM=xterm-256color
  68. print_centered "$(tput setaf 10)"
  69. print_centered " ______ __ __ "
  70. print_centered "| | |--.|__|.---.-."
  71. print_centered "| ---| || || _ |"
  72. print_centered "|______|__|__||__||___._|"
  73. echo -n "$(tput sgr0)"
  74. print_centered "Toolkit for Chia v$Version"
  75. echo ""
  76. if [ $error_flag -ne 0 ]
  77. then
  78. echo -n "$(tput setaf 1 ;tput blink;tput bold)"
  79. print_centered "Config Error !!! $error_flag"
  80. echo -n "$(tput sgr0)"
  81. exit 0
  82. fi
  83. case $Gui in
  84. YES)
  85. echo -n "$(tput setaf 40)"
  86. print_centered "Blockchain wallet + Gui"
  87. echo -n "$(tput sgr0)"
  88. echo -n "$(tput setaf 11)"
  89. print_centered "Chia Plotting Tools"
  90. echo -n "$(tput sgr0)"
  91. ;;
  92. NO)
  93. echo -n "$(tput setaf 11)"
  94. print_centered "Chia Plotting Tools"
  95. echo -n "$(tput sgr0)"
  96. ;;
  97. ONLY)
  98. echo -n "$(tput setaf 41)"
  99. print_centered "Blockchain + GUI wallet Only"
  100. echo -n "$(tput sgr0)"
  101. ;;
  102. *)
  103. echo -n "$(tput setaf 1 ;tput blink;tput bold)"
  104. print_centered "Config Error !!!"
  105. echo -n "$(tput sgr0)"
  106. exit 0
  107. ;;
  108. esac
  109. if [ $Gui = "NO" ] || [ $Gui = "YES" ]
  110. then
  111. case $GigaHorse_farmer in
  112. YES)
  113. echo -n "$(tput setaf 42)"
  114. print_centered "GigaHorse Farmer"
  115. echo -n "$(tput sgr0)"
  116. ;;
  117. esac
  118. case $H9_ChiaService in
  119. YES)
  120. echo -n "$(tput setaf 43)"
  121. print_centered "Mining service Enabled"
  122. echo -n "$(tput sgr0)"
  123. ;;
  124. esac
  125. case $H9_ChiaProxy in
  126. YES)
  127. echo -n "$(tput setaf 43)"
  128. print_centered "Hpool x-Proxy Enabled"
  129. echo -n "$(tput sgr0)"
  130. ;;
  131. esac
  132. case $FoxyPool in
  133. YES)
  134. echo -n "$(tput setaf 44)"
  135. print_centered "FoxyPool"
  136. echo -n "$(tput sgr0)"
  137. ;;
  138. esac
  139. fi
  140. sleep 2
  141. if ! [ -d /home/wareck/chia ];then mkdir /home/wareck/chia;fi
  142. }
  143. function GigaHorse_farmer_ {
  144. echo -e "$(tput setaf 10)\nInstall GigaHorse Farmer$(tput sgr0)"
  145. if ! [ -d /home/wareck/blockchain ];then mkdir /home/wareck/blockchain;fi
  146. cd /home/wareck/blockchain/
  147. GigaHorse_link=https://github.com/madMAx43v3r/chia-gigahorse/releases/download/v2.1.1.giga25/chia-gigahorse-farmer-2.1.1.giga25-x86_64.tar.gz
  148. wget -c -q --show-progress $GigaHorse_link -O chia-gigahorse-farmer.tar.gz
  149. tar xfz chia-gigahorse-farmer.tar.gz --checkpoint=.1000
  150. rm chia-gigahorse-farmer.tar.gz
  151. echo -e "\n\e[97mDone.\e[0m"
  152. }
  153. function update_ {
  154. echo -e "$(tput setaf 10)\nUpdate and install packages:$(tput sgr0)"
  155. extend="libgomp1 ocl-icd-opencl-dev libgmp-dev libnuma-dev"
  156. sudo apt-get install python3-venv python3-distutils python3-dev libsodium-dev $extend -y
  157. echo -e "\e[97mDone.\e[0m"
  158. }
  159. function chia_plotter {
  160. echo -e "$(tput setaf 10)\nBuild Chia-Plotter (MadMax4ever) :$(tput sgr0)"
  161. sleep 1
  162. cd /home/wareck/chia/
  163. if [ ! -d chia-plotter ]
  164. then
  165. git clone https://github.com/madMAx43v3r/chia-plotter.git
  166. else
  167. cd /home/wareck/chia/chia-plotter
  168. git pull
  169. fi
  170. cd /home/wareck/chia/chia-plotter
  171. git submodule init
  172. git submodule update
  173. ./make_devel.sh
  174. cd build
  175. if [ -f go.sh ];then rm go.sh ;fi
  176. cat <<'EOF'>> go.sh
  177. #!/bin/bash
  178. POOL=a99e72c49c5ed39bf793caab9e074a80dd61011a859e975842874aab47b783f9ce84282febe2ca275c0930149b67990a
  179. FARM=8ba5acd276b45fd0f749ce195dcddcf0e63c3bf2e751e9e273faa0125075c36a11f2ee231e7cf74abed2920be97fc373
  180. OUT=/media/Partage/Plots/
  181. ./chia_plot -p $POOL -f $FARM -n 1 -r 6 -u 128 -t /nvme0/plotting/ -2 /nvme0/plotting/ -d $OUT
  182. EOF
  183. chmod +x go.sh
  184. if [ -f foxy.sh ];then rm foxy.sh; fi
  185. cat <<'EOF'>> foxy.sh
  186. #!/bin/bash
  187. POOL=a99e72c49c5ed39bf793caab9e074a80dd61011a859e975842874aab47b783f9ce84282febe2ca275c0930149b67990a
  188. FARM=8ba5acd276b45fd0f749ce195dcddcf0e63c3bf2e751e9e273faa0125075c36a11f2ee231e7cf74abed2920be97fc373
  189. OUT=/media/Partage/Plots-nft/
  190. ./chia_plot -p $POOL -f $FARM -n 1 -r 4 -u 128 -t /nvme0/plotting/ -2 /nvme1/plotting/ -d $OUT
  191. EOF
  192. chmod +x foxy.sh
  193. echo -e "\e[97mDone.\e[0m"
  194. }
  195. function bladebit {
  196. echo -e "$(tput setaf 10)\nBuild Bladebit v2 :$(tput sgr0)"
  197. sleep 1
  198. cd /home/wareck/chia
  199. if [ ! -d bladebit ]
  200. then
  201. git clone https://github.com/Chia-Network/bladebit.git
  202. fi
  203. cd /home/wareck/chia/bladebit/
  204. if [ ! -d build ];then mkdir build;fi
  205. cd build
  206. sed -i "s/FatalIf( cfg.compressionLevel >/\/\/FatalIf( cfg.compressionLevel/g" /home/wareck/chia/bladebit/src/main.cpp
  207. cmake ..
  208. make -j 6
  209. if [ -f cuda.sh ]; then rm cuda.sh ;fi
  210. cat <<'EOF'>> cuda.sh
  211. #!/bin/bash
  212. POOL=a99e72c49c5ed39bf793caab9e074a80dd61011a859e975842874aab47b783f9ce84282febe2ca275c0930149b67990a
  213. FARM=8ba5acd276b45fd0f749ce195dcddcf0e63c3bf2e751e9e273faa0125075c36a11f2ee231e7cf74abed2920be97fc373
  214. OUT=/farm/farm0/Plots
  215. for i in {1..5}
  216. do
  217. ./bladebit_cuda --no-direct-io -p $POOL -f $FARM -z 7 cudaplot -d 0 --disk-16 -t1 /raid/plotting $OUT
  218. done
  219. #sudo reboot
  220. #/home/wareck/miners/chia-miner/hpool-miner-chia -config /home/wareck/miners/chia-miner/config.yaml
  221. EOF
  222. chmod +x cuda.sh
  223. echo -e "\e[97mDone.\e[0m"
  224. }
  225. function gigahorse {
  226. echo -e "$(tput setaf 10)\nMadMax4ever GigaHorse:$(tput sgr0)"
  227. sleep 1
  228. if [ -d /home/wareck/chia/chia-gigahorse ]
  229. then
  230. cd /home/wareck/chia/chia-gigahorse
  231. git pull
  232. else
  233. cd /home/wareck/chia/
  234. git clone https://github.com/madMAx43v3r/chia-gigahorse.git
  235. fi
  236. echo "generate bash files..."
  237. sudo cp ~/chia/chia-gigahorse/plot-sink/linux/x86_64/* /usr/local/bin/
  238. sudo cp ~/chia/chia-gigahorse/cpu-plotter/linux/x86_64/* /usr/local/bin/
  239. sudo cp ~/chia/chia-gigahorse/chiapos/linux/x86_64/ProofOfSpace /usr/local/bin/
  240. cd ~
  241. if [ -f distrib_chia.sh ];then sudo rm distrib_chia.sh;fi
  242. if [ -f /usr/local/bin/distrib_chia.sh ];then sudo rm /usr/local/bin/distrib_chia.sh;fi
  243. cat <<'EOF'>> distrib_chia.sh
  244. #!/bin/bash
  245. echo "IP : $(hostname -I)"
  246. chia_plot_sink /farm/farm0/Plots/ /farm/farm1/Plots/ /farm/farm2/Plots/ /farm/farm3/Plots/ /farm/farm4/Plots/ /Partage/Plots/
  247. EOF
  248. chmod +x distrib_chia.sh
  249. sudo mv distrib_chia.sh /usr/local/bin/
  250. if [ -f go.sh ];then rm go.sh;fi
  251. cat <<'EOF'>> ~/go.sh
  252. #!/bin/bash
  253. CRT=xch10yjksfwm8s66z32qy35x950608hk8l67vmsur4rwpaanpkd6ks3qhfw5nk
  254. FRM=8ba5acd276b45fd0f749ce195dcddcf0e63c3bf2e751e9e273faa0125075c36a11f2ee231e7cf74abed2920be97fc373
  255. OUT=@192.168.1.100
  256. ./chia_plot -c $CRT -f $FRM -G -r 6 -z 1447 -C 8 -n -1 -t /nvme0/plotting/ -2 /nvme1/plotting/ -d $OUT
  257. EOF
  258. chmod +x ~/go.sh
  259. cp ~/go.sh ~/chia/chia-gigahorse/cpu-plotter/linux/x86_64/
  260. rm ~/go.sh
  261. cat <<'EOF'>> ~/foxypool.sh
  262. CTR=xch1hsadv5h4c6mvk2av8vg6pdmezu8rapmrsta8z7ds0yd24yt2xshshqrtsy
  263. FPK=b6d0c62c90338b2dc9c5c2368e4acd1cbf60cadb3b86c0bf58a3706d59b276b49520bf8bfb4e07735fdfb92b03053170
  264. OUT=/Partage/Plots/
  265. ./cuda_plot_k32 -g 0 -c $CTR -f $FPK -C 17 -n 2 -t /raid/ -3 /raid/ -d $OUT
  266. ProofOfSpace farm -t 8 -d 100 -f /Partage/Plots/*.plot
  267. EOF
  268. chmod +x ~/foxypool.sh
  269. cp ~/foxypool.sh ~/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh
  270. echo -e "\e[97mDone.\e[0m"
  271. }
  272. function chiapos {
  273. echo -e "$(tput setaf 10)\nBuild Chia-Pos:$(tput sgr0)"
  274. sleep 1
  275. cd /home/wareck/chia
  276. if [ ! -d /home/wareck/chia/chia-pos ]
  277. then
  278. git clone https://github.com/Chia-Network/chiapos.git chia-pos
  279. cd /home/wareck/chia/chia-pos
  280. else
  281. cd /home/wareck/chia/chia-pos
  282. git pull
  283. fi
  284. if [ ! -d build ]; then mkdir build;fi
  285. cd build
  286. cmake ..
  287. cmake --build . -- -j 6
  288. echo -e "\e[97mDone.\e[0m"
  289. }
  290. function miner_ {
  291. echo -e "$(tput setaf 10)\nChia-Miner (hpool):$(tput sgr0)"
  292. sleep 1
  293. wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/chia-miner.tar.xz -O /home/wareck/Build_Cube/pack/chia-miner.tar.xz
  294. cp /home/wareck/Build_Cube/pack/chia-miner.tar.xz /home/wareck/miners
  295. cd /home/wareck/miners
  296. tar xvfJ chia-miner.tar.xz
  297. rm chia-miner.tar.xz
  298. echo -e "\e[97mDone.\e[0m"
  299. }
  300. function chia_blockchain {
  301. echo -e "$(tput setaf 10)\nBuild Chia-blockchain & Gui :$(tput sgr0)"
  302. sleep 1
  303. if ! [ -d /home/wareck/blockchain ];then mkdir /home/wareck/blockchain;fi
  304. cd /home/wareck/blockchain
  305. if [ ! -d /home/wareck/blockchain/chia-blockchain ]
  306. then
  307. git clone https://github.com/Chia-Network/chia-blockchain.git -b latest --recurse-submodules
  308. cd chia-blockchain
  309. else
  310. cd chia-blockchain
  311. git pull
  312. fi
  313. sh install.sh
  314. source ./activate
  315. sh install-gui.sh
  316. #if [ -f /Store/.chia ]
  317. #then
  318. #ln -s /Store/.chia /home/wareck/.chia
  319. #ln -s /Store/.chia_keys /home/wareck/.chia_keys
  320. #fi
  321. echo -e "\e[97mDone.\e[0m"
  322. }
  323. function chia_proxy {
  324. echo -e "$(tput setaf 10)\nChia-X-Proxy (Cuda):$(tput sgr0)"
  325. wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/chia-x-proxy.tar.xz -O /home/wareck/Build_Cube/pack/chia-x-proxy.tar.xz
  326. cp /home/wareck/Build_Cube/pack/chia-x-proxy.tar.xz /home/wareck/
  327. cd /home/wareck/chia/
  328. tar xvfJ /home/wareck/chia-x-proxy.tar.xz
  329. rm /home/wareck/chia-x-proxy.tar.xz
  330. sleep 1
  331. cat <<'EOF'>> x-proxy.service
  332. [Unit]
  333. Description=x-proxy
  334. After=network.target
  335. StartLimitIntervalSec=500
  336. StartLimitBurst=5
  337. [Service]
  338. #Restart=on-failure
  339. #RestartSec=5s
  340. WorkingDirectory=/home/wareck/chia/x-proxy/
  341. User=wareck
  342. Group=adm
  343. ExecStart=/usr/bin/screen -DmS x-proxy /home/wareck/chia/x-proxy/x-proxy-v1.9.1 -config /home/wareck/chia/x-proxy/config.yaml
  344. ExecStop=/usr/bin/screen -S x-proxy -X quit
  345. LimitNOFILE=999999
  346. [Install]
  347. WantedBy=multi-user.target
  348. EOF
  349. sudo mv x-proxy.service /etc/systemd/system/x-proxy.service
  350. sudo systemctl daemon-reload
  351. sudo systemctl start x-proxy.service
  352. sudo systemctl enable x-proxy.service
  353. echo -e "\e[97mDone.\e[0m"
  354. }
  355. function service_old {
  356. echo -e "$(tput setaf 10)\nInstall chia-miner service (hpool) :$(tput sgr0)"
  357. sleep 1
  358. echo "Generation du fichier /etc/init.d/chia-miner"
  359. cat <<'EOF'>> chia-miner.sh
  360. #!/bin/sh
  361. ### BEGIN INIT INFO
  362. # Provides: chiaminer
  363. # Required-Start: networking
  364. # Default-Start: 3 4 5
  365. # Default-Stop: 0 6
  366. ### END INIT INFO
  367. case "$1" in
  368. start)
  369. if pgrep -x "hpool-miner-chia" > /dev/null
  370. then
  371. sudo killall -9 hpool-miner-chia | true
  372. fi
  373. su wareck -c "screen -dmS chia-miner /home/wareck/miners/chia-miner/hpool-miner-chia -config /home/wareck/miners/chia-miner/config.yaml"
  374. ;;
  375. stop)
  376. if pgrep -x "hpool-miner-chia" > /dev/null
  377. then
  378. sudo killall -9 hpool-miner-chia | true
  379. fi
  380. ;;
  381. restart)
  382. $0 stop
  383. $0 start
  384. ;;
  385. *)
  386. echo "Usage: /etc/init.d/chia-miner {start|restart|stop}"
  387. exit 1
  388. ;;
  389. esac
  390. exit 0
  391. EOF
  392. chmod +x chia-miner.sh
  393. sudo cp chia-miner.sh /etc/init.d/chia-miner
  394. sudo update-rc.d chia-miner defaults
  395. sleep 1
  396. sudo /etc/init.d/chia-miner start
  397. sudo rm chia-miner.sh
  398. echo -e "\e[97mDone.\e[0m"
  399. }
  400. function service_ {
  401. echo -e "$(tput setaf 10)\nInstall chia-miner service (hpool) :$(tput sgr0)"
  402. sleep 1
  403. cat <<'EOF'>> chia-miner.service
  404. [Unit]
  405. Description=HPool miner
  406. After=network.target
  407. StartLimitIntervalSec=500
  408. StartLimitBurst=5
  409. [Service]
  410. #Restart=on-failure
  411. #RestartSec=5s
  412. WorkingDirectory=/home/wareck/miners/chia-miner/
  413. User=wareck
  414. Group=adm
  415. ExecStart=/usr/bin/screen -DmS hpool-miner /home/wareck/miners/chia-miner/hpool-miner-chia -config /home/wareck/miners/chia-miner/config.yaml
  416. ExecStop=/usr/bin/screen -S hpool-miner -X quit
  417. LimitNOFILE=999999
  418. [Install]
  419. WantedBy=multi-user.target
  420. EOF
  421. sudo mv chia-miner.service /etc/systemd/system/hpool-miner.service
  422. sudo systemctl daemon-reload
  423. sudo systemctl start hpool-miner.service
  424. sudo systemctl enable hpool-miner.service
  425. echo -e "\e[97mDone.\e[0m"
  426. }
  427. function foxypool_ {
  428. echo -e "$(tput setaf 10)\nInstall FoxyPool miner :$(tput sgr0)"
  429. cd /home/wareck/miners
  430. wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/foxypool.tar.xz
  431. tar xfJ foxypool.tar.xz --checkpoint=.100
  432. echo ""
  433. rm foxypool.tar.xz
  434. if [ -f /home/wareck/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh ];then rm /home/wareck/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh;fi
  435. cat <<'EOF'>> foxypool.sh
  436. #!/bin/bash
  437. CTR=xch1hsadv5h4c6mvk2av8vg6pdmezu8rapmrsta8z7ds0yd24yt2xshshqrtsy
  438. FPK=b6d0c62c90338b2dc9c5c2368e4acd1cbf60cadb3b86c0bf58a3706d59b276b49520bf8bfb4e07735fdfb92b03053170
  439. OUT=/Partage/Plots/
  440. ./cuda_plot_k32 -g 0 -c $CTR -f $FPK -C 17 -n 2 -t /raid/ -3 /raid/ -d $OUT
  441. ProofOfSpace farm -t 8 -d 100 -f /Partage/Plots/*.plot
  442. EOF
  443. chmod +x foxypool.sh
  444. mv foxypool.sh /home/wareck/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh
  445. }
  446. function foxypool_service_ {
  447. echo -e "$(tput setaf 10)\nInstall FoxyPool service :$(tput sgr0)"
  448. cat > $HOME/foxypool.service << EOF
  449. # The foxypool service (part of systemd)
  450. # file: /etc/systemd/system/foxypool.service
  451. [Unit]
  452. Description = Foxypool Service
  453. After=network.target
  454. [Service]
  455. Type=simple
  456. User = $USER
  457. WorkingDirectory= $HOME/miners/foxypool
  458. ExecStart = $HOME/miners/foxypool/foxy-gh-farmer -c $HOME/miners/foxypool/foxy-gh-farmer.yaml
  459. Restart = on-failure
  460. RestartSec=30
  461. LimitNOFILE=99999
  462. StandardOutput=syslog
  463. StandardError=syslog
  464. SyslogIdentifier=foxypool
  465. [Install]
  466. WantedBy = multi-user.target
  467. EOF
  468. sudo mv $HOME/foxypool.service /etc/systemd/system/foxypool.service >/dev/null
  469. sudo chmod 644 /etc/systemd/system/foxypool.service
  470. cat <<'EOF'>> foxypool.conf
  471. if $programname == 'flexfarmer' then /var/log/foxypool.log
  472. & stop
  473. EOF
  474. sudo cp foxypool.conf /etc/rsyslog.d/foxypool.conf
  475. sudo rm foxypool.conf
  476. if [ ! -f /var/log/foxypool.log ]
  477. then
  478. sudo touch /var/log/foxypool.log
  479. sudo chown syslog:adm /var/log/foxypool.log
  480. fi
  481. cat <<'EOF'>> logrot
  482. /var/log/foxypool.log {
  483. daily
  484. rotate 7
  485. copytruncate
  486. notifempty
  487. missingok
  488. su root syslog
  489. }
  490. EOF
  491. sudo cp logrot /etc/logrotate.d/foxypool
  492. sudo rm logrot
  493. sudo systemctl restart rsyslog >/dev/null 2>&1
  494. sudo systemctl daemon-reload >/dev/null 2>&1
  495. sudo systemctl enable foxypool >/dev/null 2>&1
  496. sudo systemctl start foxypool >/dev/null 2>&1
  497. echo -e "\e[97mDone.\e[0m"
  498. }
  499. function cmake_ {
  500. if [ $BladeBit = "YES" ]
  501. then
  502. pids=""
  503. /home/wareck/Build_Cube/options/tools/_cmake.sh & pids="$pids $!"
  504. wait $pids
  505. fi
  506. }
  507. simplify_config
  508. intro_
  509. update_
  510. cmake_
  511. case $Gui in
  512. ONLY)
  513. chia_blockchain
  514. ;;
  515. *)
  516. if [ $GigaHorse = "YES" ];then gigahorse;fi
  517. if [ $MadMax = "YES" ];then chia_plotter;fi
  518. if [ $BladeBit = "YES" ];then bladebit;fi
  519. if [ $ChiaPos = "YES" ];then chiapos;fi
  520. if [ $H9_Miner = "YES" ];then miner_;fi
  521. if [ $H9_ChiaService = "YES" ];then service_;fi
  522. if [ $H9_ChiaProxy = "YES" ]; then chia_proxy;fi
  523. if [ $FoxyPool = "YES" ]; then foxypool_;fi
  524. if [ $FoxyPool_service = "YES" ]; then foxypool_service_;fi
  525. if [ $GigaHorse_farmer = "YES" ];then GigaHorse_farmer_;fi
  526. if [ $Gui = "YES" ]; then chia_blockchain;fi
  527. ;;
  528. esac
  529. echo -e "\n\e[97mEnd of process...\e[0m"