-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·68 lines (55 loc) · 2 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
#!/bin/bash
set -e
#set -x
if [ -z "${L1_ENDPOINT_HTTP}" ]; then
echo "Lütfen L1_ENDPOINT_HTTP değişkenini atayın."
echo "Please export L1_ENDPOINT_HTTP"
exit
fi
if [[ -z "${L1_ENDPOINT_WS}" ]]; then
echo "Lütfen L1_ENDPOINT_WS değişkenini atayın."
echo "Please export L1_ENDPOINT_WS"
exit
fi
read -p "Do you want to enable prover? [y/n] Proverı etkinleştirmek istiyor musunuz? [y/n]: " enable_prover
if [ ${enable_prover} = "y" ]; then
if [[ -z "${L1_PROVER_PRIVATE_KEY}" ]]; then
echo "Lütfen L1_PROVER_PRIVATE_KEY değişkenini atayın."
echo "Please export L1_PROVER_PRIVATE_KEY"
exit
fi
else
echo "!!!Prover etkinleştirilmedi!!!"
echo "!!!Prover is not enabled!!!"
fi
# Install docker and docker compose plugin
apt -y update
apt -y install ca-certificates curl gnupg
set +e
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do apt -y remove $pkg; done
rm /etc/apt/keyrings/docker.gpg
rm simple-taiko-node
set -e
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt -y update
apt -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Install git
apt -y install git
git clone https://github.com/taikoxyz/simple-taiko-node.git
cd simple-taiko-node
cp .env.sample .env
sed -i "s,L1_ENDPOINT_HTTP=,L1_ENDPOINT_HTTP=${L1_ENDPOINT_HTTP},g" .env
sed -i "s,L1_ENDPOINT_WS=,L1_ENDPOINT_WS=${L1_ENDPOINT_WS},g" .env
if [ ${enable_prover} = "y" ]; then
sed -i "s,ENABLE_PROVER=false,ENABLE_PROVER=true,g" .env
sed -i "s,L1_PROVER_PRIVATE_KEY=,L1_PROVER_PRIVATE_KEY=${L1_PROVER_PRIVATE_KEY},g" .env
fi
docker compose up -d
#set +x
set +e