-
Notifications
You must be signed in to change notification settings - Fork 2
/
hubble
198 lines (134 loc) · 3.48 KB
/
hubble
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#定义变量
ALL_SATEA_VARS="Eth_Rpc_Url,Op_Rrc_Url,FID"
Eth_Rpc_Url={{SATEA_VARS_Eth_Rpc_Url}}
Op_Rrc_Url={{SATEA_VARS_Op_Rrc_Url}}
FID={{SATEA_VARS_FID}}
function VadVars(){
echo "$ALL_SATEA_VARS"
}
function Manual() {
>.env.sh
chmod +x .env.sh
for i in `echo $ALL_SATEA_VARS | tr ',' '\n' `;do
i_split=`echo $i |tr -d "{" | tr -d "}"`
read -p "$i_split =" i_split_vars
echo "$i_split=$i_split_vars" >>.env.sh
done
}
function WgetPackages(){
curl -sSL https://download.thehubble.xyz/bootstrap.sh | bash
}
function Makeenvfile() {
cat <<EOL >> .env
FC_NETWORK_ID=1
STATSD_METRICS_SERVER=statsd:8125
# Set this to your L1 Mainnet ETH RPC URL
ETH_MAINNET_RPC_URL=your-ETH-mainnet-RPC-URL
# Set this to your L2 Optimism Mainnet RPC URL
OPTIMISM_L2_RPC_URL=your-L2-optimism-RPC-URL
# Set this to your Farcaster FID
HUB_OPERATOR_FID=your-fid
EOL
sed -i "s|your-ETH-mainnet-RPC-URL|$Eth_Rpc_Url|g" .env
sed -i "s|your-L2-optimism-RPC-URL|$Op_Rrc_Url|g" .env
sed -i "s|your-fid|$FID|g" .env
}
function mkdirDir() {
mkdir /root/hubble
cd /root/hubble
}
function stop() {
cd /root/hubble;./hubble.sh down
}
function clean() {
echo "WARN: This operation will result in data/node loss,start in 5s"
sleep 5
cd /root/hubble;./hubble.sh down;rm -rf /root/hubble
}
function resetData() {
echo "WARN: This operation will result in data/node loss,start in 5s"
sleep 5
cd /root/hubble; rm -rf .rock
}
function upgrade() {
cd /root/hubble; ./hubble.sh upgrade
}
function logs() {
cd /root/hubble; ./hubble.sh logs
}
function check() {
dokcer_num=`docker ps | grep hubble | wc -l`
if [ $dokcer_num -eq 3 ]
then
echo "All hubble docker running (Status: ok )"
else
echo "some hubble docker Not running (Status: bad )"
fi
}
function About() {
echo ' _____ ___ ______ ______ ___
/ ___/ / | /_ __/ / ____/ / |
\__ \ / /| | / / / __/ / /| |
___/ / / ___ | / / / /___ / ___ |
/____/ /_/ |_| /_/ /_____/ /_/ |_|'
echo
echo -e "\xF0\x9F\x9A\x80 Satea Node Installer
Website: https://www.satea.io/
Twitter: https://x.com/SateaLabs
Discord: https://discord.com/invite/satea
Gitbook: https://satea.gitbook.io/satea
Version: V1.0.0
Introduction: Satea is a DePINFI aggregator dedicated to breaking down the traditional barriers that limits access to computing resources. "
echo""
}
case $1 in
install)
if [ "$2" = "--auto" ]
then
echo "-> Automatic mode, please ensure that ALL SATEA_VARS(`VadVars`) have been replaced !"
sleep 3
mkdirDir
Makeenvfile
WgetPackages
else
echo "Unrecognized variable(`VadVars`) being replaced, manual mode"
# Manual
# . .env.sh
mkdirDir
WgetPackages
fi
;;
check)
checkStarted_success
;;
vars)
VadVars
;;
clean)
clean
;;
stop)
stop
;;
resetData)
resetData
;;
upgrade)
upgrade
;;
logs)
logs
;;
**)
About
echo " Flag:
install Install Hubble with manual mode, If carrying the --auto parameter, start Automatic mode
stop Stop all Hubble docker
up Start all Hubble docker
upgrade Upgrade an existing installation of Hubble
logs Show the logs of the Hubble service
clean Remove the Hubble from your server
resetData Reset rockData,This will cause a resynchronization
version Show Script Version"
;;
esac