-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·91 lines (76 loc) · 2.68 KB
/
install.sh
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Moving to a temporary directory...
cd `mktemp -d`
printf "\n Setting proxy...\n"
export http_proxy=http://10.3.100.207:8080
export https_proxy=http://10.3.100.207:8080
printf "\n Updating the apt-get repositories. Please provide permissions...\n"
sudo add-apt-repository universe
sudo apt-get install build-essential
sudo -E apt-get update
if command -v geth 1>/dev/null 2>/dev/null; then
printf "\n ethereum already installed. \n"
else
printf "\n Installing ethereum...\n"
sudo -E apt-get install -y software-properties-common
sudo -E add-apt-repository -y ppa:ethereum/ethereum
sudo -E apt-get update
sudo -E apt-get install -y ethereum
fi
if command -v nodejs 1>/dev/null 2>/dev/null; then
printf "\n nodejs already installed\n"
else
printf "\n Installing nodejs...\n"
sudo -E apt-get install -y nodejs
fi
if command -v node 1>/dev/null 2>/dev/null; then
printf "\n node already installed\n"
else
printf "\n Installing node...\n"
sudo -E apt-get install -y nodejs-legacy # Required on some versions
fi
if command -v npm 1>/dev/null 2>/dev/null; then
printf "\n npm already installed\n"
else
printf "\n Installing npm...\n"
sudo -E apt-get install -y npm
fi
printf "\n Configuring proxy for npm\n"
sudo npm config set http-proxy http://10.3.100.207:8080
sudo npm config set https-proxy http://10.3.100.207:8080
if command -v embark 1>/dev/null 2>/dev/null; then
printf "\n embark already installed\n"
else
printf "\n Installing embark...\n"
sudo -E npm install -g embark
fi
#printf "\nInstalling test-rpc...\n"
#sudo -E npm install -g [email protected]
# https://ipfs.io/docs/install/
if command -v ipfs 1>/dev/null 2>/dev/null; then
printf "\n ipfs already installed....\n"
else
printf "\n Installing IPFS...\n"
wget https://dist.ipfs.io/go-ipfs/v0.4.7/go-ipfs_v0.4.7_linux-amd64.tar.gz
tar xvfz go-ipfs_v0.4.7_linux-amd64.tar.gz
sudo mv go-ipfs/ipfs /usr/local/bin/ipfs
fi
# https://github.com/iurimatias/embark-framework/wiki/Install-on-Linux
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\"*\"]"
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials "[\"true\"]"
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"POST\", \"GET\"]"
if command -v mist 1>/dev/null 2>/dev/null; then
printf "\n Mist browser already installed\n"
else
printf "\n Installing mist browser...\n"
# https://github.com/ethereum/mist/releases
wget https://github.com/ethereum/mist/releases/download/v0.8.9/Mist-linux64-0-8-9.deb
sudo dpkg -i Mist-*.deb
fi
if command -v ntpd 1>/dev/null 2>/dev/null; then
printf "\n ntp already installed...\n"
else
printf "\n Installing ntp...\n"
sudo apt-get install ntp
fi
# Moving back to last directory
cd -