-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswap_cold_wallet.sh
99 lines (80 loc) · 2.91 KB
/
swap_cold_wallet.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
echo
echo "MASTERCOIN - Masternode updater"
echo
echo "Welcome to the MASTERCOIN Masternode update script."
echo
IP=$(hostname -I | cut -f1 -d' ')
file="/$USER/.MasterCoinV2/mastercoin.conf"
cd ~
sudo killall -9 mastercoind
sudo rm -rdf /usr/bin/mastercoind
cd
mkdir -p MASTERCOINONE_TMP
cd MASTERCOINONE_TMP
wget https://github.com/MasterCoinOne/MasterCoinV2/releases/download/v1.0.5.0/mastercoin-1.0.5-linux.tar.gz -O mastercoin-linux.tar.gz
sudo chmod 775 mastercoin-linux.tar.gz
tar -xvzf mastercoin-linux.tar.gz
sudo chmod 755 *
sudo rm -f mastercoin-linux.tar.gz
sudo mv * /usr/bin
cd ~
rm -d MASTERCOINONE_TMP
mkdir -p ~/.mastercoin
if [ -f "$file" ]
then
cp ~/.MasterCoinV2/mastercoin.conf ~/.mastercoin
sed -i 's/masternodeaddress/#masternodeaddress/g' ~/.mastercoin/mastercoin.conf
else
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get install -y nano htop git dos2unix
sudo apt-get install -y software-properties-common
sudo apt-get install -y build-essential libtool autotools-dev pkg-config libssl-dev
sudo apt-get install -y libboost-all-dev
sudo apt-get install -y libevent-dev
sudo apt-get install -y libminiupnpc-dev
sudo apt-get install -y autoconf
sudo apt-get install -y automake unzip
sudo add-apt-repository -y ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install -y libdb4.8-dev libdb4.8++-dev
sudo apt-get install -y libzmq5-dev
cd /var
sudo touch swap.img
sudo chmod 600 swap.img
sudo dd if=/dev/zero of=/var/swap.img bs=1024k count=2000
sudo mkswap /var/swap.img
sudo swapon /var/swap.img
sudo free
sudo echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
cd ~
sudo apt-get install -y ufw
sudo ufw allow ssh/tcp
sudo ufw limit ssh/tcp
sudo ufw logging on
echo "y" | sudo ufw enable
sudo ufw status
mkdir -p ~/bin
echo 'export PATH=~/bin:$PATH' > ~/.bash_aliases
source ~/.bashrc
echo "rpcuser=user"`shuf -i 100000-10000000 -n 1` > ~/.mastercoin/mastercoin.conf
echo "rpcpassword=pass"`shuf -i 100000-10000000 -n 1` >> ~/.mastercoin/mastercoin.conf
echo "listen=1" >> ~/.mastercoin/mastercoin.conf
echo "server=1" >> ~/.mastercoin/mastercoin.conf
echo "daemon=1" >> ~/.mastercoin/mastercoin.conf
echo "maxconnections=256" >> ~/.mastercoin/mastercoin.conf
echo "port=16000" >> ~/.mastercoin/mastercoin.conf
echo "masternode=1" >> ~/.mastercoin/mastercoin.conf
echo "Please enter the 'masternode private key' followed by [ENTER]:"
echo "You can generate 'masternode private key' in hot wallet console with command masternode genkey"
read MN_PRIVATE_KEY
echo "masternodeprivkey=$MN_PRIVATE_KEY" >> ~/.mastercoin/mastercoin.conf
fi
echo "rpcallowip=127.0.0.1" >> ~/.mastercoin/mastercoin.conf
echo "rpcport=17301" >> ~/.mastercoin/mastercoin.conf
echo "masternodeaddress=$IP" >> ~/.mastercoin/mastercoin.conf
ufw allow 16000
ufw allow 17301
mastercoind
echo "Your masternode is now updated!"