Skip to content

Commit b52626b

Browse files
authored
Develop (#40)
* Update seed nodes (#28) * Rewards: Adjust Miner/Masternode reward ratio - Add sentinel version check - Bump version to v0.12.3.0 (#27) * Update the version number * Bump to 70213 * Adjust Rewards * Update sentinel ping code to require min version * Update blockHeight for reward change, update client version and copyright * Update checkpoints (#30) * Add new DNS nodes (#31) * Adding a script to update the Linux wallets to the latest version (#33) * Update masternode upgrade script. * Adding info to run pac update for linux (#34) * Update README.md * Update masternode installer script * Bump min protocol version to 70213 (#35) * Fix genesis block input hex (#29) Updated the genesis block input hex to be accurate. * Add block 50000 to the checkpoints (#36) * Bump min protocol version to 70213 * Add block 50,000 to the checkpoints * Reject bad chain with wrong rewards, block 50000 * Formating * Update invalidate logic, all blocks which are different than the main chain will be invalidated. * Update masternode installation script
1 parent 86e4ddd commit b52626b

19 files changed

+348
-89
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$PAC Core staging tree 0.12.3
1+
$PAC Core staging tree 0.12.3.0
22
===============================
33

44
<!-- `master:` [![Build Status](https://travis-ci.org/paccoinpay/paccoin.svg?branch=master)](https://travis-ci.org/paccoinpay/paccoin) `develop:` [![Build Status](https://travis-ci.org/paccoinpay/paccoin.svg?branch=develop)](https://travis-ci.org/paccoinpay/paccoin/branches) -->
@@ -82,11 +82,26 @@ Translators should also follow the [forum](https://www.paccoin.org/forum/topic/p
8282
Setting up a masternode on a VPS (only for Cold wallet setup)
8383
-------
8484
Go to your VPS and execute this:
85-
1) wget https://raw.githubusercontent.com/PACCommunity/PAC/master/pacmn.sh
86-
2) chmod +x pacmn.sh
87-
3) ./pacmn.sh
85+
1) `wget https://raw.githubusercontent.com/PACCommunity/PAC/master/pacmn.sh`
86+
2) `chmod +x pacmn.sh`
87+
3) `./pacmn.sh`
8888

8989
Follow the instructions and:
9090
Enter your external IP
9191
Enter your masternode genkey
9292
The script will setup the environment and run your masternode
93+
94+
Updating a masternode on a VPS to the latest verion (only for Cold wallet setup)
95+
-------
96+
Go to your VPS and execute the following commands on the command line:
97+
1) `wget https://raw.githubusercontent.com/PACCommunity/PAC/master/pac-update.sh`
98+
2) `chmod +x pac-update.sh`
99+
3) `./pac-update.sh`
100+
101+
Or run this single line to execute the previous commands in one go:
102+
103+
`wget https://raw.githubusercontent.com/PACCommunity/PAC/master/pac-update.sh && chmod +x pac-update.sh && ./pac-update.sh`
104+
105+
106+
Follow the instructions:
107+
1)Do you want to autobackup wallet.dat and continue with the process? [y/n]: Type yes to backup and continue or no to stop process

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
22
AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 0)
44
define(_CLIENT_VERSION_MINOR, 12)
5-
define(_CLIENT_VERSION_REVISION, 2)
6-
define(_CLIENT_VERSION_BUILD, 3)
5+
define(_CLIENT_VERSION_REVISION, 3)
6+
define(_CLIENT_VERSION_BUILD, 1)
77
define(_CLIENT_VERSION_IS_RELEASE, true)
8-
define(_COPYRIGHT_YEAR, 2017)
8+
define(_COPYRIGHT_YEAR, 2018)
99
AC_INIT([Paccoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/paccoinpay/paccoin/issues],[paccoincore])
1010
AC_CONFIG_SRCDIR([src/validation.cpp])
1111
AC_CONFIG_HEADERS([src/config/paccoin-config.h])

contrib/seeds/nodes_main.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
54.244.79.140:7112
2-
34.209.87.8:7112
1+
209.250.251.184:7112
2+
108.61.252.138:7112
3+
144.202.48.162:7112
4+
45.32.193.76:7112
5+
144.202.101.191:7112

contrib/seeds/nodes_test.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
34.212.116.68:17111
2-
34.212.253.142:17111
1+
144.202.75.199:17112
2+
144.202.106.163:17112

pac-update.sh

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
#!/bin/bash
2+
3+
set -e
4+
cd ~/
5+
6+
arch=`uname -m`
7+
version="0.12.3.1"
8+
old_version="0.12.3.0"
9+
base_url="https://github.com/PACCommunity/PAC/releases/download/v${version}"
10+
if [ "${arch}" == "x86_64" ]; then
11+
tarball_name="PAC-v${version}-linux-x86_64.tar.gz"
12+
binary_url="${base_url}/${tarball_name}"
13+
elif [ "${arch}" == "x86_32" ]; then
14+
tarball_name="PAC-v${version}-linux-x86.tar.gz"
15+
binary_url="${base_url}/${tarball_name}"
16+
else
17+
echo "PAC binary distribution not available for the architecture: ${arch}"
18+
exit -1
19+
fi
20+
21+
echo " .......... "
22+
echo " .............. "
23+
echo " .................... "
24+
echo " .....-yyyyyyys+-:oo-.. oooooooo. ooooo oooooooo "
25+
echo " ......:MMMMNNdddmMMMd... MMMMNMMMMMh. MMMMMMM MMMMMMMMMM "
26+
echo "......:MMmy..-+MNdh:..... MMMM: .dMMMy oMMMyMMNN .NMMMMy "
27+
echo "......:ddmm...-hdNm...... MMMM+-+mMMMs :MMMs dMMm yMMMMo "
28+
echo "....:ohNMMNdoydNMMN/..... MMMMMMMMMmo. NMMN -MMMd yMMMM. "
29+
echo "...+dMNdddNmmdhy+-....... MMMM+::- dMMMNmmmMMMMs :MMMMm. "
30+
echo "......::MMMm............. MMMM: yMMMdoooooNMMM mMMMMNdddN+ "
31+
echo " ......:MNdo............. dddd- ddddd. ddddd. :ohdmmdhy: "
32+
echo " ....-+-.............. "
33+
echo " ................. "
34+
echo " ........... "
35+
36+
echo "################################################"
37+
echo "# Welcome #"
38+
echo "################################################"
39+
echo ""
40+
echo "This script will update PAC to the latest version (${version})."
41+
echo "Before running the script we recommend to backup your private keys and your wallet.dat file that is under ~/.paccoincore/wallet.dat even though this script will not affect them"
42+
read -p "Do you want to auto-backup wallet.dat and continue with the process? [y/n]: " cont
43+
if [ $cont = 'n' ] || [ $cont = 'no' ] || [ $cont = 'N' ] || [ $cont = 'No' ]; then
44+
exit -1
45+
fi
46+
47+
if [ -e ~/paccoin-cli ] && [ -e ~/paccoind ]; then
48+
echo ""
49+
echo "#######################################"
50+
echo "# Stopping pac services (daemon) #"
51+
echo "#######################################"
52+
echo ""
53+
54+
wallstatus=$( ./paccoin-cli mnsync status ) || true
55+
if [ -z "$wallstatus" ]; then
56+
echo "Daemon is not running no need to stop it"
57+
else
58+
echo "Stopping the Daemon"
59+
./paccoin-cli stop
60+
sleep 60
61+
62+
wallstatus=$( ./paccoin-cli mnsync status ) || true
63+
if [ -z "$wallstatus" ]; then
64+
echo "Daemon stopped!"
65+
else
66+
echo "Daemon was not stopped! Please kill the deamon process or run ./paccoin-cli stop, then run the script again"
67+
exit
68+
fi
69+
fi
70+
71+
echo ""
72+
echo "###############################"
73+
echo "# Removing old binaries #"
74+
echo "###############################"
75+
echo ""
76+
77+
if [ -e paccoin-cli ]; then
78+
echo "Removing paccoin-cli"
79+
rm paccoin-cli
80+
fi
81+
82+
if [ -e paccoind ]; then
83+
echo "Removing paccoind"
84+
rm paccoind
85+
fi
86+
87+
if [ -e paccoin-qt ]; then
88+
echo "Removing paccoin-qt"
89+
rm paccoin-qt
90+
fi
91+
92+
if [ -e ~/PAC-v0.12.3.0-linux-x86_64.tar.gz ]; then
93+
echo "Removing PAC-v0.12.3.0-linux-x86_64.tar.gz"
94+
rm PAC-v0.12.3.0-linux-x86_64.tar.gz
95+
fi
96+
97+
if [ -d ~/PAC-v0.12.3.0-linux-x86_64 ]; then
98+
echo "Removing PAC-v0.12.23.0-linux-x86_64 directory"
99+
rm -r PAC-v0.12.3.0-linux-x86_64
100+
fi
101+
else
102+
is_pac_running=`ps ax | grep -v grep | grep paccoind | wc -l`
103+
if [ $is_pac_running -gt 0 ]; then
104+
echo "PAC process is still running, it's not safe to continue with the update, exiting."
105+
echo "Please stop the daemon with './pacoin-cli stop' or kill the daeomon process, then run the script again."
106+
exit -1
107+
fi
108+
fi
109+
110+
echo ""
111+
echo "#######################################"
112+
echo "# Backing up the wallet.dat #"
113+
echo "#######################################"
114+
echo ""
115+
is_pac_running=`ps ax | grep -v grep | grep paccoind | wc -l`
116+
if [ $is_pac_running -gt 0 ]; then
117+
echo "PAC process is still running, it's not safe to continue with the update, exiting."
118+
echo "Please stop the daemon with './paccoin-cli stop' or kill the daemon process, then run the script again."
119+
exit -1
120+
else
121+
currpath=$( pwd )
122+
echo "Backing up the wallet.dat"
123+
backupsdir="pac_wallet_backups"
124+
mkdir -p $backupsdir
125+
backupfilename=wallet.dat.$(date +%F_%T)
126+
cp ~/.paccoincore/wallet.dat "$currpath/$backupsdir/$backupfilename"
127+
echo "wallet.dat was saved to : $currpath/$backupsdir/$backupfilename"
128+
fi
129+
130+
echo ""
131+
echo "###############################"
132+
echo "# Get/Setup new binaries #"
133+
echo "###############################"
134+
echo ""
135+
136+
if test -e "${tarball_name}"; then
137+
rm -r $tarball_name
138+
fi
139+
wget $binary_url
140+
if test -e "${tarball_name}"; then
141+
echo "Unpacking $PAC distribution"
142+
tar -xvzf $tarball_name
143+
chmod +x paccoind
144+
chmod +x paccoin-cli
145+
echo "Binaries were saved to: $PWD/$tarball_name"
146+
else
147+
echo "There was a problem downloading the binaries, please try running again the script."
148+
exit -1
149+
fi
150+
151+
echo ""
152+
echo "##################################################################"
153+
echo "# Updating the sentinel (Applies only on masternodes) #"
154+
echo "##################################################################"
155+
echo ""
156+
157+
was_sentinel_found=0
158+
if [ -d ~/sentinel ]; then
159+
was_sentinel_found=1
160+
cd sentinel
161+
git pull
162+
cd ..
163+
fi
164+
165+
echo ""
166+
echo "###########################"
167+
echo "# Running the daemon #"
168+
echo "###########################"
169+
echo ""
170+
171+
cd ~/
172+
./paccoind -daemon=1
173+
echo "Waiting for daemon to be up and running"
174+
sleep 60
175+
./paccoin-cli getinfo
176+
echo "PAC Updated!"
177+
echo "Remember to go to your cold wallet and start the masternode (cold wallet must also be on the latest version)."
178+
179+
if [ $was_sentinel_found -eq 0 ]; then
180+
echo "No sentinel was found, in case this is a masternode follow the instructions below. If this is not a masternode, then ignore this message."
181+
echo "Intructions:"
182+
echo "1) Go to the sentinel folder"
183+
echo "2) Run this command: git pull"
184+
fi

pacmn.sh

Lines changed: 52 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
set -e
44

5+
if [ "$1" == "--testnet" ]; then
6+
pac_rpc_port=17111
7+
pac_port=17112
8+
is_testnet=1
9+
else
10+
pac_rpc_port=7111
11+
pac_port=7112
12+
is_testnet=0
13+
fi
14+
15+
arch=`uname -m`
16+
version="0.12.3.1"
17+
old_version="0.12.3.0"
18+
base_url="https://github.com/PACCommunity/PAC/releases/download/v${version}"
19+
if [ "${arch}" == "x86_64" ]; then
20+
tarball_name="PAC-v${version}-linux-x86_64.tar.gz"
21+
binary_url="${base_url}/${tarball_name}"
22+
elif [ "${arch}" == "x86_32" ]; then
23+
tarball_name="PAC-v${version}-linux-x86.tar.gz"
24+
binary_url="${base_url}/${tarball_name}"
25+
else
26+
echo "PAC binary distribution not available for the architecture: ${arch}"
27+
exit -1
28+
fi
29+
530
echo "################################################"
631
echo "# Welcome to PAC Masternode's server setup #"
732
echo "################################################"
@@ -23,26 +48,10 @@ echo "###############################"
2348
echo "# Installing Dependencies #"
2449
echo "###############################"
2550
echo ""
26-
echo "Running this script on Ubuntu 16.04 LTS is highly recommended (2GB RAM)"
51+
echo "Running this script on Ubuntu 16.04 LTS or newer is highly recommended."
2752

28-
sudo add-apt-repository -y ppa:bitcoin/bitcoin
2953
sudo apt-get -y update
30-
sudo apt-get -y install libminiupnpc-dev
31-
sudo apt-get -y install libboost-all-dev
32-
sudo apt-get -y install build-essential
33-
sudo apt-get -y install libtool
34-
sudo apt-get -y install autotools-dev
35-
sudo apt-get -y install automake pkg-config
36-
sudo apt-get -y install libssl-dev
37-
sudo apt-get -y install libevent-dev bsdmainutils
38-
sudo apt-get -y install git
39-
sudo apt-get -y install libzmq3-dev
40-
sudo apt-get -y install libdb4.8-dev
41-
sudo apt-get -y install libdb4.8++-dev
42-
sudo apt-get -y install virtualenv
43-
sudo apt-get -y install ufw
44-
sudo apt-get -y install pwgen
45-
sudo apt-get -y install jq
54+
sudo apt-get -y install git python virtualenv ufw pwgen
4655

4756

4857
echo "###############################"
@@ -52,26 +61,34 @@ sudo ufw status
5261
sudo ufw disable
5362
sudo ufw allow ssh/tcp
5463
sudo ufw limit ssh/tcp
55-
sudo ufw allow 7112/tcp
64+
sudo ufw allow $pac_port/tcp
5665
sudo ufw logging on
5766
sudo ufw --force enable
5867
sudo ufw status
5968

60-
sudo iptables -A INPUT -p tcp --dport '7112' -j ACCEPT
69+
sudo iptables -A INPUT -p tcp --dport $pac_port -j ACCEPT
6170

6271
echo ""
6372
echo "###############################"
6473
echo "# Get/Setup binaries #"
6574
echo "###############################"
6675
echo ""
67-
wget "https://github.com/PACCommunity/PAC/releases/download/v0.12.2.3/PAC-v0.12.2.3-ubuntu-16.04-x64.tar.gz"
68-
tar xvf 'PAC-v0.12.2.3-ubuntu-16.04-x64.tar.gz'
69-
cd ~/
70-
rm PAC-v0.12.2.3-ubuntu-16.04-x64.tar.gz
71-
currpath=$( pwd )
72-
echo "Binaries got stored on: $currpath"
73-
chmod +x paccoind
74-
chmod +x paccoin-cli
76+
77+
if test -e "${tarball_name}"; then
78+
rm -r $tarball_name
79+
fi
80+
wget $binary_url
81+
if test -e "${tarball_name}"; then
82+
echo "Unpacking $PAC distribution"
83+
tar -xvzf $tarball_name
84+
chmod +x paccoind
85+
chmod +x paccoin-cli
86+
echo "Binaries were saved to: $PWD/$tarball_name"
87+
rm -r $tarball_name
88+
else
89+
echo "There was a problem downloading the binaries, please try running again the script."
90+
exit -1
91+
fi
7592

7693
echo "###############################"
7794
echo "# Configure the wallet #"
@@ -98,15 +115,15 @@ echo "Configuring the paccoin.conf"
98115
echo "rpcuser=$(pwgen -s 16 1)" > paccoin.conf
99116
echo "rpcpassword=$(pwgen -s 64 1)" >> paccoin.conf
100117
echo "rpcallowip=127.0.0.1" >> paccoin.conf
101-
echo "rpcport=7111" >> paccoin.conf
118+
echo "rpcport=$pac_rpc_port" >> paccoin.conf
102119
echo "externalip=$ipaddr" >> paccoin.conf
103-
echo "port=7112" >> paccoin.conf
120+
echo "port=$pac_port" >> paccoin.conf
104121
echo "server=1" >> paccoin.conf
105122
echo "daemon=1" >> paccoin.conf
106123
echo "listen=1" >> paccoin.conf
107-
echo "staking=0" >> paccoin.conf
124+
echo "testnet=$is_testnet" >> paccoin.conf
108125
echo "masternode=1" >> paccoin.conf
109-
echo "masternodeaddr=$ipaddr:7112" >> paccoin.conf
126+
echo "masternodeaddr=$ipaddr:$pac_port" >> paccoin.conf
110127
echo "masternodeprivkey=$mnkey" >> paccoin.conf
111128

112129

@@ -119,11 +136,9 @@ cd ~/
119136
./paccoind
120137
sleep 60
121138

122-
syncedinfo=$( ./paccoin-cli mnsync status )
123-
assetid=$( echo $syncedinfo | jq '.AssetID' )
124-
125-
if [ $assetid == 'null' ]; then
126-
echo "Wallet is not running or there is an issue, please restart wallet!"
139+
is_pac_running=`ps ax | grep -v grep | grep paccoind | wc -l`
140+
if [ $is_pac_running -eq 0 ]; then
141+
echo "The daemon is not running or there is an issue, please restart the daemon!"
127142
exit
128143
fi
129144

0 commit comments

Comments
 (0)