-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrpmlinknode.sh
More file actions
119 lines (95 loc) · 2.37 KB
/
rpmlinknode.sh
File metadata and controls
119 lines (95 loc) · 2.37 KB
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
#!/usr/bin/env sh
_user="$(id -u -n)"
echo ''
echo ''
echo ''
echo '**************************'
echo 'Installing misc dependencies'
echo '**************************'
echo ''
echo ''
echo ''
# install dependencies
sudo yum install unzip wget -y
echo ''
echo ''
echo ''
echo '**************************'
echo 'Installing XERO Node binary'
echo '**************************'
echo ''
echo ''
echo ''
# Download node binary
wget https://github.com/xero-official/go-xerom/releases/download/2.1.0/geth-linux.zip
# Unzip node binary
unzip geth-linux.zip
# Make node executable
chmod +x geth
echo ''
echo ''
echo ''
echo '**************************'
echo 'Creating and setting up system service'
echo '**************************'
echo ''
echo ''
echo ''
cat > /tmp/xerolinknode.service << EOL
[Unit]
Description=XERO Link Node
After=network.target
[Service]
User=$_user
Group=$_user
Type=simple
Restart=always
ExecStart=/usr/sbin/geth --syncmode=full --cache=512 -node --lightserv 50 --lightpeers 75
[Install]
WantedBy=default.target
EOL
sudo \mv /tmp/xerolinknode.service /etc/systemd/system
sudo \rm /usr/sbin/geth
sudo \mv geth /usr/sbin/
sudo systemctl enable xerolinknode && systemctl stop xerolinknode && systemctl start xerolinknode
systemctl status xerolinknode --no-pager --full
echo ''
echo ''
echo ''
echo '**************************'
echo 'Setting Up Node dashboard'
echo '**************************'
echo ''
echo ''
echo ''
# Download node Dashboard
wget https://github.com/xero-official/node-deployment-dashboard/raw/master/build/dashboard
# Make Dashboard executable
chmod +x dashboard
echo ''
echo ''
echo ''
echo '**************************'
echo 'Printing your Nodes ID - Please save this somewhere you might need it - the script will pause for 2 minute to allow you to copy the Node ID, after 1 minute it will resume'
echo '**************************'
echo ''
echo ''
echo ''
#Grab the Node ID
/usr/sbin/geth --exec "admin.nodeInfo.enode" attach ipc://./$HOME/.xerom/geth.ipc
sleep 1m
# Make Dashboard executable
chmod +x dashboard
echo ''
echo ''
echo ''
echo '**************************'
echo 'If you are going to setup your node manually - you can exit the dashboard by using option 5 - It is recommend you wait for the node to complete syncing before activating the dasboard'
echo '**************************'
echo ''
echo ''
echo ''
sleep 10s
# Activate Dashboard
./dashboard
echo 'Done.'