-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtezd-install-alphanet.sh
54 lines (46 loc) · 1.72 KB
/
tezd-install-alphanet.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
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root or using sudo!"
exit
fi
HPATH=/usr/lib/tezd
echo "Installing TezTech Tezos Daemon (tezd)..."
echo "Installing deps..."
if ! grep -q "^deb .*ansible/bubblewrap" /etc/apt/sources.list /etc/apt/sources.list.d/*; then
echo "Installing bubblewrap PPA..."
echo -e "\n" | sudo add-apt-repository -y ppa:ansible/bubblewrap
fi
if ! grep -q "^deb .*git-core/ppa" /etc/apt/sources.list /etc/apt/sources.list.d/*; then
echo "Installing git-core PPA..."
echo -e "\n" | sudo add-apt-repository -y ppa:git-core/ppa
fi
sudo apt-get update
sudo apt-get install -y wget liblz4-tool patch unzip make gcc m4 git g++ aspcud bubblewrap curl bzip2 rsync libev-dev libgmp-dev pkg-config libhidapi-dev
echo "Installing opam..."
wget https://github.com/ocaml/opam/releases/download/2.0.0/opam-2.0.0-x86_64-linux
sudo mv opam-2.0.0-x86_64-linux /usr/local/bin/opam
sudo chmod a+x /usr/local/bin/opam
echo "Creating tezd user..."
useradd -r tezd --shell /bin/bash --home $HPATH -m
adduser tezd sudo
su tezd -c "opam init -y --compiler=4.06.1"
su tezd -c "eval \$(opam env)"
cd $HPATH
echo "Building tezos-core..."
su tezd -c "git clone -b alphanet https://gitlab.com/tezos/tezos.git"
sleep 5
cd $HPATH/tezos
su tezd -c "sh -c '$(curl -sL https://raw.githubusercontent.com/TezTech/tezd-install/master/custom_install_build_deps.sh)' && eval \$(opam env) && make"
cd $HPATH
sh -c "$(curl -sL https://raw.githubusercontent.com/TezTech/tezd-install/master/tezd-update-scripts.sh)"
if [ ! -d "$HPATH/.tezos-node" ]; then
mkdir $HPATH/.tezos-node
cd $HPATH/.tezos-node
cat > version.json << EOF
{ "version": "0.0.1" }
EOF
cd $HPATH
chown -Rf tezd:tezd $HPATH/.tezos-node
fi
tezd setup
echo "tezd install complete!"