chia.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. #!/bin/bash
  2. #set -e
  3. Version=6.1.2
  4. Gui=Yes #can be Yes No or Only
  5. GigaHorse_farmer=Yes
  6. MadMax=Yes
  7. GigaHorse=Yes
  8. BladeBit=No
  9. ChiaPos=no
  10. H9_ChiaService=No
  11. H9_Miner=No
  12. H9_ChiaProxy=No
  13. FoxyPool=Yes
  14. FoxyPool_service=Yes
  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. NAME=$(curl -s https://api.github.com/repos/madMAx43v3r/chia-gigahorse/releases/latest | grep ".*x86_64.tar.gz" | grep "name" | awk {'print$2'} | cut -d : -f 2,3 | tr -d \",)
  148. curl -s https://api.github.com/repos/madMAx43v3r/chia-gigahorse/releases/latest | grep "browser_download_url.*x86_64.tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -q --show-progress -i -
  149. tar xfz $NAME --checkpoint=.1000
  150. rm $NAME
  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. rm ~/foxypool.sh
  271. echo -e "\e[97mDone.\e[0m"
  272. }
  273. function chiapos {
  274. echo -e "$(tput setaf 10)\nBuild Chia-Pos:$(tput sgr0)"
  275. sleep 1
  276. cd /home/wareck/chia
  277. if [ ! -d /home/wareck/chia/chia-pos ]
  278. then
  279. git clone https://github.com/Chia-Network/chiapos.git chia-pos
  280. cd /home/wareck/chia/chia-pos
  281. else
  282. cd /home/wareck/chia/chia-pos
  283. git pull
  284. fi
  285. if [ ! -d build ]; then mkdir build;fi
  286. cd build
  287. cmake ..
  288. cmake --build . -- -j 6
  289. echo -e "\e[97mDone.\e[0m"
  290. }
  291. function miner_ {
  292. echo -e "$(tput setaf 10)\nChia-Miner (hpool):$(tput sgr0)"
  293. sleep 1
  294. 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
  295. cp /home/wareck/Build_Cube/pack/chia-miner.tar.xz /home/wareck/miners
  296. cd /home/wareck/miners
  297. tar xvfJ chia-miner.tar.xz
  298. rm chia-miner.tar.xz
  299. echo -e "\e[97mDone.\e[0m"
  300. }
  301. function chia_blockchain {
  302. echo -e "$(tput setaf 10)\nBuild Chia-blockchain & Gui :$(tput sgr0)"
  303. sleep 1
  304. if ! [ -d /home/wareck/blockchain ];then mkdir /home/wareck/blockchain;fi
  305. cd /home/wareck/blockchain
  306. if [ ! -d /home/wareck/blockchain/chia-blockchain ]
  307. then
  308. git clone https://github.com/Chia-Network/chia-blockchain.git -b latest --recurse-submodules
  309. cd chia-blockchain
  310. else
  311. cd chia-blockchain
  312. git pull
  313. fi
  314. sh install.sh
  315. source ./activate
  316. sh install-gui.sh
  317. #if [ -f /Store/.chia ]
  318. #then
  319. #ln -s /Store/.chia /home/wareck/.chia
  320. #ln -s /Store/.chia_keys /home/wareck/.chia_keys
  321. #fi
  322. echo -e "\e[97mDone.\e[0m"
  323. }
  324. function chia_proxy {
  325. echo -e "$(tput setaf 10)\nChia-X-Proxy (Cuda):$(tput sgr0)"
  326. 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
  327. cp /home/wareck/Build_Cube/pack/chia-x-proxy.tar.xz /home/wareck/
  328. cd /home/wareck/chia/
  329. tar xvfJ /home/wareck/chia-x-proxy.tar.xz
  330. rm /home/wareck/chia-x-proxy.tar.xz
  331. sleep 1
  332. cat <<'EOF'>> x-proxy.service
  333. [Unit]
  334. Description=x-proxy
  335. After=network.target
  336. StartLimitIntervalSec=500
  337. StartLimitBurst=5
  338. [Service]
  339. #Restart=on-failure
  340. #RestartSec=5s
  341. WorkingDirectory=/home/wareck/chia/x-proxy/
  342. User=wareck
  343. Group=adm
  344. 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
  345. ExecStop=/usr/bin/screen -S x-proxy -X quit
  346. LimitNOFILE=999999
  347. [Install]
  348. WantedBy=multi-user.target
  349. EOF
  350. sudo mv x-proxy.service /etc/systemd/system/x-proxy.service
  351. sudo systemctl daemon-reload
  352. sudo systemctl start x-proxy.service
  353. sudo systemctl enable x-proxy.service
  354. echo -e "\e[97mDone.\e[0m"
  355. }
  356. function service_old {
  357. echo -e "$(tput setaf 10)\nInstall chia-miner service (hpool) :$(tput sgr0)"
  358. sleep 1
  359. echo "Generation du fichier /etc/init.d/chia-miner"
  360. cat <<'EOF'>> chia-miner.sh
  361. #!/bin/sh
  362. ### BEGIN INIT INFO
  363. # Provides: chiaminer
  364. # Required-Start: networking
  365. # Default-Start: 3 4 5
  366. # Default-Stop: 0 6
  367. ### END INIT INFO
  368. case "$1" in
  369. start)
  370. if pgrep -x "hpool-miner-chia" > /dev/null
  371. then
  372. sudo killall -9 hpool-miner-chia | true
  373. fi
  374. su wareck -c "screen -dmS chia-miner /home/wareck/miners/chia-miner/hpool-miner-chia -config /home/wareck/miners/chia-miner/config.yaml"
  375. ;;
  376. stop)
  377. if pgrep -x "hpool-miner-chia" > /dev/null
  378. then
  379. sudo killall -9 hpool-miner-chia | true
  380. fi
  381. ;;
  382. restart)
  383. $0 stop
  384. $0 start
  385. ;;
  386. *)
  387. echo "Usage: /etc/init.d/chia-miner {start|restart|stop}"
  388. exit 1
  389. ;;
  390. esac
  391. exit 0
  392. EOF
  393. chmod +x chia-miner.sh
  394. sudo cp chia-miner.sh /etc/init.d/chia-miner
  395. sudo update-rc.d chia-miner defaults
  396. sleep 1
  397. sudo /etc/init.d/chia-miner start
  398. sudo rm chia-miner.sh
  399. echo -e "\e[97mDone.\e[0m"
  400. }
  401. function service_ {
  402. echo -e "$(tput setaf 10)\nInstall chia-miner service (hpool) :$(tput sgr0)"
  403. sleep 1
  404. cat <<'EOF'>> chia-miner.service
  405. [Unit]
  406. Description=HPool miner
  407. After=network.target
  408. StartLimitIntervalSec=500
  409. StartLimitBurst=5
  410. [Service]
  411. #Restart=on-failure
  412. #RestartSec=5s
  413. WorkingDirectory=/home/wareck/miners/chia-miner/
  414. User=wareck
  415. Group=adm
  416. ExecStart=/usr/bin/screen -DmS hpool-miner /home/wareck/miners/chia-miner/hpool-miner-chia -config /home/wareck/miners/chia-miner/config.yaml
  417. ExecStop=/usr/bin/screen -S hpool-miner -X quit
  418. LimitNOFILE=999999
  419. [Install]
  420. WantedBy=multi-user.target
  421. EOF
  422. sudo mv chia-miner.service /etc/systemd/system/hpool-miner.service
  423. sudo systemctl daemon-reload
  424. sudo systemctl start hpool-miner.service
  425. sudo systemctl enable hpool-miner.service
  426. echo -e "\e[97mDone.\e[0m"
  427. }
  428. function foxypool_ {
  429. echo -e "$(tput setaf 10)\nInstall FoxyPool miner :$(tput sgr0)"
  430. cd /home/wareck/miners
  431. wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/foxypool.tar.xz
  432. tar xfJ foxypool.tar.xz --checkpoint=.100
  433. echo ""
  434. rm foxypool.tar.xz
  435. 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
  436. cat <<'EOF'>> foxypool.sh
  437. #!/bin/bash
  438. CTR=xch1hsadv5h4c6mvk2av8vg6pdmezu8rapmrsta8z7ds0yd24yt2xshshqrtsy
  439. FPK=b6d0c62c90338b2dc9c5c2368e4acd1cbf60cadb3b86c0bf58a3706d59b276b49520bf8bfb4e07735fdfb92b03053170
  440. OUT=/Partage/Plots/
  441. ./cuda_plot_k32 -g 0 -c $CTR -f $FPK -C 17 -n 2 -t /raid/ -3 /raid/ -d $OUT
  442. ProofOfSpace farm -t 8 -d 100 -f /Partage/Plots/*.plot
  443. EOF
  444. chmod +x foxypool.sh
  445. mv foxypool.sh /home/wareck/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh
  446. }
  447. function foxypool_service_ {
  448. echo -e "$(tput setaf 10)\nInstall FoxyPool service :$(tput sgr0)"
  449. cat > $HOME/foxypool.service << EOF
  450. # The foxypool service (part of systemd)
  451. # file: /etc/systemd/system/foxypool.service
  452. [Unit]
  453. Description = Foxypool Service
  454. After=network.target
  455. [Service]
  456. Type=simple
  457. User = $USER
  458. WorkingDirectory= $HOME/miners/foxy-gh-farmer
  459. ExecStart = $HOME/miners/foxy-gh-farmer/foxy-gh-farmer -c $HOME/miners/foxy-gh-farmer/foxy-gh-farmer.yaml
  460. Restart = on-failure
  461. RestartSec=30
  462. LimitNOFILE=99999
  463. StandardOutput=syslog
  464. StandardError=syslog
  465. SyslogIdentifier=foxypool
  466. [Install]
  467. WantedBy = multi-user.target
  468. EOF
  469. sudo mv $HOME/foxypool.service /etc/systemd/system/foxypool.service >/dev/null
  470. sudo chmod 644 /etc/systemd/system/foxypool.service
  471. cat <<'EOF'>> foxypool.conf
  472. if $programname == 'flexfarmer' then /var/log/foxypool.log
  473. & stop
  474. EOF
  475. sudo cp foxypool.conf /etc/rsyslog.d/foxypool.conf
  476. sudo rm foxypool.conf
  477. if [ ! -f /var/log/foxypool.log ]
  478. then
  479. sudo touch /var/log/foxypool.log
  480. sudo chown syslog:adm /var/log/foxypool.log
  481. fi
  482. cat <<'EOF'>> logrot
  483. /var/log/foxypool.log {
  484. daily
  485. rotate 7
  486. copytruncate
  487. notifempty
  488. missingok
  489. su root syslog
  490. }
  491. EOF
  492. sudo cp logrot /etc/logrotate.d/foxypool
  493. sudo rm logrot
  494. sudo systemctl restart rsyslog >/dev/null 2>&1
  495. sudo systemctl daemon-reload >/dev/null 2>&1
  496. sudo systemctl enable foxypool >/dev/null 2>&1
  497. sudo systemctl start foxypool >/dev/null 2>&1
  498. echo -e "\e[97mDone.\e[0m"
  499. }
  500. function cmake_ {
  501. if [ $BladeBit = "YES" ]
  502. then
  503. pids=""
  504. /home/wareck/Build_Cube/options/tools/_cmake.sh & pids="$pids $!"
  505. wait $pids
  506. fi
  507. }
  508. simplify_config
  509. intro_
  510. update_
  511. cmake_
  512. case $Gui in
  513. ONLY)
  514. chia_blockchain
  515. ;;
  516. *)
  517. if [ $GigaHorse = "YES" ];then gigahorse;fi
  518. if [ $MadMax = "YES" ];then chia_plotter;fi
  519. if [ $BladeBit = "YES" ];then bladebit;fi
  520. if [ $ChiaPos = "YES" ];then chiapos;fi
  521. if [ $H9_Miner = "YES" ];then miner_;fi
  522. if [ $H9_ChiaService = "YES" ];then service_;fi
  523. if [ $H9_ChiaProxy = "YES" ]; then chia_proxy;fi
  524. if [ $FoxyPool = "YES" ]; then foxypool_;fi
  525. if [ $FoxyPool_service = "YES" ]; then foxypool_service_;fi
  526. if [ $GigaHorse_farmer = "YES" ];then GigaHorse_farmer_;fi
  527. if [ $Gui = "YES" ]; then chia_blockchain;fi
  528. ;;
  529. esac
  530. echo -e "\n\e[97mEnd of process...\e[0m"