This repository was archived by the owner on Mar 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
70 lines (60 loc) · 2.23 KB
/
setup.sh
File metadata and controls
70 lines (60 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
exists()
{
command -v "$1" >/dev/null 2>&1
}
if exists curl; then
echo ''
else
sudo apt update && sudo apt install curl -y < "/dev/null"
fi
bash_profile=$HOME/.bash_profile
if [ -f "$bash_profile" ]; then
. $HOME/.bash_profile
fi
sudo apt update && sudo apt install ocl-icd-opencl-dev libopencl-clang-dev libgomp1 jq -y
RELEASE_INFO=$(curl --silent https://api.github.com/repos/subspace/pulsar/releases/latest)
TAG_NAME=$(echo $RELEASE_INFO | jq -r '.tag_name')
cd $HOME
wget -O pulsar https://github.com/subspace/pulsar/releases/download/${TAG_NAME}/pulsar-ubuntu-x86_64-skylake-${TAG_NAME}
sudo chmod +x pulsar
sudo mv pulsar /usr/local/bin/
sudo rm -rf $HOME/.config/pulsar
/usr/local/bin/pulsar init
source ~/.bash_profile
sleep 1
echo "[Unit]
Description=Subspace Node
After=network.target
[Service]
User=$USER
Type=simple
ExecStart=/usr/local/bin/pulsar farm --verbose
Restart=on-failure
LimitNOFILE=1024000
[Install]
WantedBy=multi-user.target" > $HOME/subspaced.service
sudo mv $HOME/subspaced.service /etc/systemd/system/
sudo systemctl restart systemd-journald
sudo systemctl daemon-reload
sudo systemctl enable subspaced
sudo systemctl restart subspaced
if [ "$language" = "uk" ]; then
echo -e '\n\e[94mСтатус ноди\e[0m\n' && sleep 1
if [[ `service subspaced status | grep active` =~ "running" ]]; then
echo -e "Ваша Subspace нода \e[92mвстановлена та працює\e[0m!"
echo -e "Перевірити статус Вашої ноди можна командою \e[92mservice subspaced status\e[0m"
echo -e "Натисніть \e[92mQ\e[0m щоб вийти з статус меню"
else
echo -e "Ваша Subspace нода \e[91mбула встановлена неправильно\e[39m, виконайте перевстановлення."
fi
else
echo -e '\n\e[94mNode Status\e[0m\n' && sleep 1
if [[ `service subspaced status | grep active` =~ "running" ]]; then
echo -e "Your Subspace node \e[92msuccessfully installed and running\e[0m!"
echo -e "Check your node status: \e[92mservice subspaced status\e[0m"
echo -e "Press \e[92mQ\e[0m to exit menu"
else
echo -e "Your Subspace Node \e[91mwas not installed correctly\e[39m, please reinstall."
fi
fi