Skip to content

Commit

Permalink
Develop (#40)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
devfsc authored Jul 25, 2018
1 parent 86e4ddd commit b52626b
Show file tree
Hide file tree
Showing 19 changed files with 348 additions and 89 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$PAC Core staging tree 0.12.3
$PAC Core staging tree 0.12.3.0
===============================

<!-- `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) -->
Expand Down Expand Up @@ -82,11 +82,26 @@ Translators should also follow the [forum](https://www.paccoin.org/forum/topic/p
Setting up a masternode on a VPS (only for Cold wallet setup)
-------
Go to your VPS and execute this:
1) wget https://raw.githubusercontent.com/PACCommunity/PAC/master/pacmn.sh
2) chmod +x pacmn.sh
3) ./pacmn.sh
1) `wget https://raw.githubusercontent.com/PACCommunity/PAC/master/pacmn.sh`
2) `chmod +x pacmn.sh`
3) `./pacmn.sh`

Follow the instructions and:
Enter your external IP
Enter your masternode genkey
The script will setup the environment and run your masternode

Updating a masternode on a VPS to the latest verion (only for Cold wallet setup)
-------
Go to your VPS and execute the following commands on the command line:
1) `wget https://raw.githubusercontent.com/PACCommunity/PAC/master/pac-update.sh`
2) `chmod +x pac-update.sh`
3) `./pac-update.sh`

Or run this single line to execute the previous commands in one go:

`wget https://raw.githubusercontent.com/PACCommunity/PAC/master/pac-update.sh && chmod +x pac-update.sh && ./pac-update.sh`


Follow the instructions:
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
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 12)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_BUILD, 3)
define(_CLIENT_VERSION_REVISION, 3)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2017)
define(_COPYRIGHT_YEAR, 2018)
AC_INIT([Paccoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/paccoinpay/paccoin/issues],[paccoincore])
AC_CONFIG_SRCDIR([src/validation.cpp])
AC_CONFIG_HEADERS([src/config/paccoin-config.h])
Expand Down
7 changes: 5 additions & 2 deletions contrib/seeds/nodes_main.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
54.244.79.140:7112
34.209.87.8:7112
209.250.251.184:7112
108.61.252.138:7112
144.202.48.162:7112
45.32.193.76:7112
144.202.101.191:7112
4 changes: 2 additions & 2 deletions contrib/seeds/nodes_test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
34.212.116.68:17111
34.212.253.142:17111
144.202.75.199:17112
144.202.106.163:17112
184 changes: 184 additions & 0 deletions pac-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
#!/bin/bash

set -e
cd ~/

arch=`uname -m`
version="0.12.3.1"
old_version="0.12.3.0"
base_url="https://github.com/PACCommunity/PAC/releases/download/v${version}"
if [ "${arch}" == "x86_64" ]; then
tarball_name="PAC-v${version}-linux-x86_64.tar.gz"
binary_url="${base_url}/${tarball_name}"
elif [ "${arch}" == "x86_32" ]; then
tarball_name="PAC-v${version}-linux-x86.tar.gz"
binary_url="${base_url}/${tarball_name}"
else
echo "PAC binary distribution not available for the architecture: ${arch}"
exit -1
fi

echo " .......... "
echo " .............. "
echo " .................... "
echo " .....-yyyyyyys+-:oo-.. oooooooo. ooooo oooooooo "
echo " ......:MMMMNNdddmMMMd... MMMMNMMMMMh. MMMMMMM MMMMMMMMMM "
echo "......:MMmy..-+MNdh:..... MMMM: .dMMMy oMMMyMMNN .NMMMMy "
echo "......:ddmm...-hdNm...... MMMM+-+mMMMs :MMMs dMMm yMMMMo "
echo "....:ohNMMNdoydNMMN/..... MMMMMMMMMmo. NMMN -MMMd yMMMM. "
echo "...+dMNdddNmmdhy+-....... MMMM+::- dMMMNmmmMMMMs :MMMMm. "
echo "......::MMMm............. MMMM: yMMMdoooooNMMM mMMMMNdddN+ "
echo " ......:MNdo............. dddd- ddddd. ddddd. :ohdmmdhy: "
echo " ....-+-.............. "
echo " ................. "
echo " ........... "

echo "################################################"
echo "# Welcome #"
echo "################################################"
echo ""
echo "This script will update PAC to the latest version (${version})."
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"
read -p "Do you want to auto-backup wallet.dat and continue with the process? [y/n]: " cont
if [ $cont = 'n' ] || [ $cont = 'no' ] || [ $cont = 'N' ] || [ $cont = 'No' ]; then
exit -1
fi

if [ -e ~/paccoin-cli ] && [ -e ~/paccoind ]; then
echo ""
echo "#######################################"
echo "# Stopping pac services (daemon) #"
echo "#######################################"
echo ""

wallstatus=$( ./paccoin-cli mnsync status ) || true
if [ -z "$wallstatus" ]; then
echo "Daemon is not running no need to stop it"
else
echo "Stopping the Daemon"
./paccoin-cli stop
sleep 60

wallstatus=$( ./paccoin-cli mnsync status ) || true
if [ -z "$wallstatus" ]; then
echo "Daemon stopped!"
else
echo "Daemon was not stopped! Please kill the deamon process or run ./paccoin-cli stop, then run the script again"
exit
fi
fi

echo ""
echo "###############################"
echo "# Removing old binaries #"
echo "###############################"
echo ""

if [ -e paccoin-cli ]; then
echo "Removing paccoin-cli"
rm paccoin-cli
fi

if [ -e paccoind ]; then
echo "Removing paccoind"
rm paccoind
fi

if [ -e paccoin-qt ]; then
echo "Removing paccoin-qt"
rm paccoin-qt
fi

if [ -e ~/PAC-v0.12.3.0-linux-x86_64.tar.gz ]; then
echo "Removing PAC-v0.12.3.0-linux-x86_64.tar.gz"
rm PAC-v0.12.3.0-linux-x86_64.tar.gz
fi

if [ -d ~/PAC-v0.12.3.0-linux-x86_64 ]; then
echo "Removing PAC-v0.12.23.0-linux-x86_64 directory"
rm -r PAC-v0.12.3.0-linux-x86_64
fi
else
is_pac_running=`ps ax | grep -v grep | grep paccoind | wc -l`
if [ $is_pac_running -gt 0 ]; then
echo "PAC process is still running, it's not safe to continue with the update, exiting."
echo "Please stop the daemon with './pacoin-cli stop' or kill the daeomon process, then run the script again."
exit -1
fi
fi

echo ""
echo "#######################################"
echo "# Backing up the wallet.dat #"
echo "#######################################"
echo ""
is_pac_running=`ps ax | grep -v grep | grep paccoind | wc -l`
if [ $is_pac_running -gt 0 ]; then
echo "PAC process is still running, it's not safe to continue with the update, exiting."
echo "Please stop the daemon with './paccoin-cli stop' or kill the daemon process, then run the script again."
exit -1
else
currpath=$( pwd )
echo "Backing up the wallet.dat"
backupsdir="pac_wallet_backups"
mkdir -p $backupsdir
backupfilename=wallet.dat.$(date +%F_%T)
cp ~/.paccoincore/wallet.dat "$currpath/$backupsdir/$backupfilename"
echo "wallet.dat was saved to : $currpath/$backupsdir/$backupfilename"
fi

echo ""
echo "###############################"
echo "# Get/Setup new binaries #"
echo "###############################"
echo ""

if test -e "${tarball_name}"; then
rm -r $tarball_name
fi
wget $binary_url
if test -e "${tarball_name}"; then
echo "Unpacking $PAC distribution"
tar -xvzf $tarball_name
chmod +x paccoind
chmod +x paccoin-cli
echo "Binaries were saved to: $PWD/$tarball_name"
else
echo "There was a problem downloading the binaries, please try running again the script."
exit -1
fi

echo ""
echo "##################################################################"
echo "# Updating the sentinel (Applies only on masternodes) #"
echo "##################################################################"
echo ""

was_sentinel_found=0
if [ -d ~/sentinel ]; then
was_sentinel_found=1
cd sentinel
git pull
cd ..
fi

echo ""
echo "###########################"
echo "# Running the daemon #"
echo "###########################"
echo ""

cd ~/
./paccoind -daemon=1
echo "Waiting for daemon to be up and running"
sleep 60
./paccoin-cli getinfo
echo "PAC Updated!"
echo "Remember to go to your cold wallet and start the masternode (cold wallet must also be on the latest version)."

if [ $was_sentinel_found -eq 0 ]; then
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."
echo "Intructions:"
echo "1) Go to the sentinel folder"
echo "2) Run this command: git pull"
fi
89 changes: 52 additions & 37 deletions pacmn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

set -e

if [ "$1" == "--testnet" ]; then
pac_rpc_port=17111
pac_port=17112
is_testnet=1
else
pac_rpc_port=7111
pac_port=7112
is_testnet=0
fi

arch=`uname -m`
version="0.12.3.1"
old_version="0.12.3.0"
base_url="https://github.com/PACCommunity/PAC/releases/download/v${version}"
if [ "${arch}" == "x86_64" ]; then
tarball_name="PAC-v${version}-linux-x86_64.tar.gz"
binary_url="${base_url}/${tarball_name}"
elif [ "${arch}" == "x86_32" ]; then
tarball_name="PAC-v${version}-linux-x86.tar.gz"
binary_url="${base_url}/${tarball_name}"
else
echo "PAC binary distribution not available for the architecture: ${arch}"
exit -1
fi

echo "################################################"
echo "# Welcome to PAC Masternode's server setup #"
echo "################################################"
Expand All @@ -23,26 +48,10 @@ echo "###############################"
echo "# Installing Dependencies #"
echo "###############################"
echo ""
echo "Running this script on Ubuntu 16.04 LTS is highly recommended (2GB RAM)"
echo "Running this script on Ubuntu 16.04 LTS or newer is highly recommended."

sudo add-apt-repository -y ppa:bitcoin/bitcoin
sudo apt-get -y update
sudo apt-get -y install libminiupnpc-dev
sudo apt-get -y install libboost-all-dev
sudo apt-get -y install build-essential
sudo apt-get -y install libtool
sudo apt-get -y install autotools-dev
sudo apt-get -y install automake pkg-config
sudo apt-get -y install libssl-dev
sudo apt-get -y install libevent-dev bsdmainutils
sudo apt-get -y install git
sudo apt-get -y install libzmq3-dev
sudo apt-get -y install libdb4.8-dev
sudo apt-get -y install libdb4.8++-dev
sudo apt-get -y install virtualenv
sudo apt-get -y install ufw
sudo apt-get -y install pwgen
sudo apt-get -y install jq
sudo apt-get -y install git python virtualenv ufw pwgen


echo "###############################"
Expand All @@ -52,26 +61,34 @@ sudo ufw status
sudo ufw disable
sudo ufw allow ssh/tcp
sudo ufw limit ssh/tcp
sudo ufw allow 7112/tcp
sudo ufw allow $pac_port/tcp
sudo ufw logging on
sudo ufw --force enable
sudo ufw status

sudo iptables -A INPUT -p tcp --dport '7112' -j ACCEPT
sudo iptables -A INPUT -p tcp --dport $pac_port -j ACCEPT

echo ""
echo "###############################"
echo "# Get/Setup binaries #"
echo "###############################"
echo ""
wget "https://github.com/PACCommunity/PAC/releases/download/v0.12.2.3/PAC-v0.12.2.3-ubuntu-16.04-x64.tar.gz"
tar xvf 'PAC-v0.12.2.3-ubuntu-16.04-x64.tar.gz'
cd ~/
rm PAC-v0.12.2.3-ubuntu-16.04-x64.tar.gz
currpath=$( pwd )
echo "Binaries got stored on: $currpath"
chmod +x paccoind
chmod +x paccoin-cli

if test -e "${tarball_name}"; then
rm -r $tarball_name
fi
wget $binary_url
if test -e "${tarball_name}"; then
echo "Unpacking $PAC distribution"
tar -xvzf $tarball_name
chmod +x paccoind
chmod +x paccoin-cli
echo "Binaries were saved to: $PWD/$tarball_name"
rm -r $tarball_name
else
echo "There was a problem downloading the binaries, please try running again the script."
exit -1
fi

echo "###############################"
echo "# Configure the wallet #"
Expand All @@ -98,15 +115,15 @@ echo "Configuring the paccoin.conf"
echo "rpcuser=$(pwgen -s 16 1)" > paccoin.conf
echo "rpcpassword=$(pwgen -s 64 1)" >> paccoin.conf
echo "rpcallowip=127.0.0.1" >> paccoin.conf
echo "rpcport=7111" >> paccoin.conf
echo "rpcport=$pac_rpc_port" >> paccoin.conf
echo "externalip=$ipaddr" >> paccoin.conf
echo "port=7112" >> paccoin.conf
echo "port=$pac_port" >> paccoin.conf
echo "server=1" >> paccoin.conf
echo "daemon=1" >> paccoin.conf
echo "listen=1" >> paccoin.conf
echo "staking=0" >> paccoin.conf
echo "testnet=$is_testnet" >> paccoin.conf
echo "masternode=1" >> paccoin.conf
echo "masternodeaddr=$ipaddr:7112" >> paccoin.conf
echo "masternodeaddr=$ipaddr:$pac_port" >> paccoin.conf
echo "masternodeprivkey=$mnkey" >> paccoin.conf


Expand All @@ -119,11 +136,9 @@ cd ~/
./paccoind
sleep 60

syncedinfo=$( ./paccoin-cli mnsync status )
assetid=$( echo $syncedinfo | jq '.AssetID' )

if [ $assetid == 'null' ]; then
echo "Wallet is not running or there is an issue, please restart wallet!"
is_pac_running=`ps ax | grep -v grep | grep paccoind | wc -l`
if [ $is_pac_running -eq 0 ]; then
echo "The daemon is not running or there is an issue, please restart the daemon!"
exit
fi

Expand Down
Loading

0 comments on commit b52626b

Please sign in to comment.