forked from xhinis/Wormholes-Testnet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
wormholes.sh
76 lines (62 loc) · 2.11 KB
/
wormholes.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
#!/bin/bash
echo -e "\033[0;35m"
echo " _ ___ ____ ____ _ _ ___ ____ _____ ";
echo " | | / _ \/ ___/ ___|| \ | |/ _ \| _ \| ____|";
echo " | | | | | \___ \___ \| \| | | | | | | | _| ";
echo " | |__| |_| |___) |__) | |\ | |_| | |_| | |___ ";
echo " |_____\___/|____/____/|_| \_|\___/|____/|_____|";
echo -e "\e[0m"
sleep 3
echo "Sistem guncellemesi yapiliyor.."
sleep 2
sudo apt update && apt upgrade -y
cd $HOME
echo "Docker kurulumu yapiliyor.."
sleep 2
sudo apt install docker.io -y
sudo systemctl enable --now docker
#check docker cmd
which docker >/dev/null 2>&1
if [ $? -ne 0 ] ; then
echo "docker bulunamadi, lutfen docker yukleyin.."
echo "->ubuntu:sudo apt install docker.io -y"
echo "->centos:yum install -y docker-ce "
echo "->fedora:sudo dnf install -y docker-ce"
exit
fi
#check docker service
docker ps > /dev/null 2>&1
if [ $? -ne 0 ] ; then
echo "docker servisi calismiyor, lutfen once servisi baslatin:"
echo "->sudo service docker start"
exit
fi
docker stop wormholes > /dev/null 2>&1
docker rm wormholes > /dev/null 2>&1
docker rmi wormholestech/wormholes:v1 > /dev/null 2>&1
if [ -d /wm/.wormholes/keystore ]; then
read -p "Wormholes blokchain veri gecmisini temizlemek istiyorsaniz “y”ye basin, istemiyorsaniz “enter.”a basin:" xyz
if [ "$xyz" = 'y' ]; then
rm -rf /wm/.wormholes
read -p "Private key'inizi girin:" ky
else
echo "Temizlenmedi"
fi
else
read -p "Private key'inizi import edin:" ky
fi
mkdir -p /wm/.wormholes/wormholes
if [ -n "$ky" ]; then
if [ ${#ky} -eq 64 ];then
echo $ky > /wm/.wormholes/wormholes/nodekey
elif [ ${#ky} -eq 66 ] && ([ ${ky:0:2} == "0x" ] || [ ${ky:0:2} == "0X" ]);then
echo ${ky:2:64} > /wm/.wormholes/wormholes/nodekey
else
echo "Nodekey formati yanlis!"
exit -1
fi
fi
docker run -id -e KEY=$ky -p 30303:30303 -p 8545:8545 -v /wm/.wormholes:/wm/.wormholes --name wormholes wormholestech/wormholes:v1
echo "Private key'iniz:"
sleep 5
docker exec -it wormholes /usr/bin/cat /wm/.wormholes/wormholes/nodekey