-
Notifications
You must be signed in to change notification settings - Fork 59
/
p2pool.deploy.sh
executable file
·153 lines (141 loc) · 4.24 KB
/
p2pool.deploy.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
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
#!/bin/bash
# Author: Chris Har, AXErunners
# Thanks to all who published information on the Internet!
#
# Disclaimer: Your use of this script is at your sole risk.
# This script and its related information are provided "as-is", without any warranty,
# whether express or implied, of its accuracy, completeness, fitness for a particular
# purpose, title or non-infringement, and none of the third-party products or information
# mentioned in the work are authored, recommended, supported or guaranteed by The Author.
# Further, The Author shall not be liable for any damages you may sustain by using this
# script, whether direct, indirect, special, incidental or consequential, even if it
# has been advised of the possibility of such damages.
#
# NOTE:
# This script is based on:
# - Git Commit: 18dc987 => https://github.com/dashpay/p2pool-dash
# - Git Commit: 20bacfa => https://github.com/dashpay/dash
#
# You may have to perform your own validation / modification of the script to cope with newer
# releases of the above software.
#
# Tested with Ubuntu 17.10
#
cat << "EOF"
______ __ __ ______
/\ __ \ /\_\_\_\ /\ ___\
\ \ __ \ \/_/\_\/_ \ \ __\
\ \_\ \_\ /\_\/\_\ \ \_____\
\/_/\/_/ \/_/\/_/ \/_____/
______ ______ ______ ______
/\ ___\ /\ __ \ /\ == \ /\ ___\
\ \ \____ \ \ \/\ \ \ \ __< \ \ __\
\ \_____\ \ \_____\ \ \_\ \_\ \ \_____\
\/_____/ \/_____/ \/_/ /_/ \/_____/
EOF
#
# Variables
# UPDATE THEM TO MATCH YOUR SETUP !!
#
PUBLIC_IP=<your public IP address>
EMAIL=<your email address>
PAYOUT_ADDRESS=<your AXE wallet address to receive fees>
USER_NAME=<linux user name>
RPCUSER=<your random rpc user name>
RPCPASSWORD=<your random rpc password>
FEE=0.5
DONATION=0.0
AXE_WALLET_URL=https://github.com/AXErunners/axe/releases/download/v1.6.1.1/axecore-1.6.1.1-x86_64-linux-gnu.tar.gz
AXE_WALLET_ZIP=axecore-1.6.1.1-x86_64-linux-gnu.tar.gz
AXE_WALLET_LOCAL=axecore-1.6.1
P2POOL_FRONTEND=https://github.com/justino/p2pool-ui-punchy
P2POOL_FRONTEND3=https://github.com/hardcpp/P2PoolExtendedFrontEnd
#
# Install Prerequisites
#
cd ~
sudo apt-get --yes install python-zope.interface python-twisted python-twisted-web python-dev
sudo apt-get --yes install gcc g++
sudo apt-get --yes install git
#
# Get latest p2pool-axe
#
mkdir git
cd git
git clone https://github.com/axerunners/p2pool-axe
cd p2pool-axe
git submodule init
git submodule update
cd axe_hash
python setup.py install --user
#
# Install Web Frontends
#
cd ..
mv web-static web-static.old
git clone $P2POOL_FRONTEND web-static
mv web-static.old web-static/legacy
cd web-static
git clone $P2POOL_FRONTEND3 ext
#
# Get specific version of AXE wallet for Linux
#
cd ~
mkdir axe
cd axe
wget $AXE_WALLET_URL
tar -xvzf $AXE_WALLET_ZIP
rm $AXE_WALLET_ZIP
#
# Copy AXE daemon
#
sudo cp ~/axe/$AXE_WALLET_LOCAL/bin/axed /usr/bin/axed
sudo cp ~/axe/$AXE_WALLET_LOCAL/bin/axe-cli /usr/bin/axe-cli
sudo chown -R $USER_NAME:$USER_NAME /usr/bin/axed
sudo chown -R $USER_NAME:$USER_NAME /usr/bin/axe-cli
#
# Prepare AXE configuration
#
mkdir ~/.axecore
cat <<EOT >> ~/.axecore/axe.conf
rpcuser=$RPCUSER
rpcpassword=$RPCPASSWORD
alertnotify=echo %s | mail -s "AXE Alert" $EMAIL
server=1
daemon=1
EOT
#
# Get latest AXE core
#
cd ~/git
git clone https://github.com/axerunners/axe
#
# Install AXE daemon service and set to Auto Start
#
cd /etc/systemd/system
sudo ln -s /home/$USER_NAME/git/axe/contrib/init/axed.service axed.service
sudo sed -i 's/User=axecore/User='"$USER_NAME"'/g' axed.service
sudo sed -i 's/Group=axecore/Group='"$USER_NAME"'/g' axed.service
sudo sed -i 's/\/var\/lib\/axed/\/home\/'"$USER_NAME"'\/.axecore/g' axed.service
sudo sed -i 's/\/etc\/axecore\/axe.conf/\/home\/'"$USER_NAME"'\/.axecore\/axe.conf/g' axed.service
sudo systemctl daemon-reload
sudo systemctl enable axed
sudo service axed start
#
# Prepare p2pool startup script
#
cat <<EOT >> ~/p2pool.start.sh
python ~/git/p2pool-axe/run_p2pool.py --external-ip $PUBLIC_IP -f $FEE --give-author $DONATION -a $PAYOUT_ADDRESS
EOT
if [ $? -eq 0 ]
then
echo
echo Installation Completed.
echo You can start p2pool instance by command:
echo
echo bash ~/p2pool.start.sh
echo
echo NOTE: you will need to wait until AXE daemon has finished
echo blockchain synchronization before the p2pool instance is usable.
echo
fi