Skip to content

Commit

Permalink
created
Browse files Browse the repository at this point in the history
  • Loading branch information
Troxidoxy committed Aug 8, 2018
0 parents commit b20f0b9
Show file tree
Hide file tree
Showing 2 changed files with 388 additions and 0 deletions.
292 changes: 292 additions & 0 deletions BwsUpdate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
#/bin/bash
cd ~
rm -rf Bws_Setup.sh* BwsUpdate.sh*
echo "****************************************************************************"
echo "* This script will install and configure your BWS Coin masternodes. *"
echo "* Love from A_Block_Nut(Thermo) ;) *"
echo "* If you have any issues please ask for help on the BWS discord. *"
echo "* https://discord.gg/3Z7DUEC *"
echo "* https://bitcoinwspectrum.com/ *"
echo "****************************************************************************"
echo ""
echo ""
echo "!!!!!!!!!!PLEASE READ CAREFULLY!!!!!!!!!!!!!!!"
echo ""
echo "***********************************************************************************"
echo "* It is very important to program your masternode under a user rather than root. *"
echo "* By entering Yes you will create a new user. *"
echo "* You Dont need to enter any personal details but you do need to create password. *"
echo "* *"
echo "*----Are you running this script as the root user? [y/n], followed by [ENTER]-----*"
echo "* *"
echo "* ------------------------OPTIONS BELOW-------------------------------------------*"
echo "* 1 - Enter Yes If you are running this Script as root then re-run this script *"
echo "* 2 - Enter Yes If you want to get into your created user *"
echo "* *"
echo "* 3 - Please Enter No if you are running this Script under your new user. *"
echo "***********************************************************************************"
read USETUP
if
[[ $USETUP =~ "y" ]] || [[$USETUP =~ "Y" ]] ; then

sudo adduser bws
usermod -aG sudo bws
sudo su - bws
fi
echo ""
echo ""
echo ""
echo "Do you to use our Express Masternode/Wallet installation? [y/n], followed by [ENTER]"
echo ""
echo ""
read EXSETUP
if
[[ $EXSETUP =~ "y" ]] || [[$EXSETUP =~ "Y" ]] ; then
sudo su -c "echo 'deb http://deb.torproject.org/torproject.org '$(lsb_release -c | cut -f2)' main' > /etc/apt/sources.list.d/torproject.list"
gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
sudo apt-get update
sudo apt-get install tor deb.torproject.org-keyring -y
sudo usermod -a -G debian-tor $(whoami)

sudo sed -i 's/#ControlPort 9051/ControlPort 9051/g' /etc/tor/torrc
sudo sed -i 's/#CookieAuthentication 1/CookieAuthentication 1/g' /etc/tor/torrc
sudo su -c "echo 'CookieAuthFileGroupReadable 1' >> /etc/tor/torrc"
sudo su -c "echo 'LongLivedPorts 9033' >> /etc/tor/torrc"
sudo systemctl restart tor.service
rm -rf Bws_Setup.sh* BwsUpdate.sh*
./bws-cli stop
echo "configure your VPS with Bws recommended settings"
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade

sudo apt-get install -y ufw
sudo ufw allow ssh/tcp
sudo ufw limit ssh/tcp
sudo ufw logging on
sudo ufw allow 22
sudo ufw allow 41798
sudo ufw allow 9033
echo "y" | sudo ufw enable
sudo ufw status

echo ""
echo ""
echo ""
echo "installing/updating your Masternode"
./bws-cli stop
rm bwsd
rm bws-cli
rm bws-tx
wget https://github.com/bitcoinwspectrum/bws-linux-cli/releases/download/bws-cli/tar-bws-linux-cli
tar -xf bws-linux-cli.tgz
rm bws-linux-cli.tgz
sudo su -c "echo 'listenonion=1' >> /.bws/bws.conf"
fi
echo "Masternode Configuration"
echo "Your recognised IP address is:"
sudo hostname -I
echo "Is this the IP you wish to use for MasterNode ? [y/n] , followed by [ENTER]"
read IPDEFAULT
if
[[ $IPDEFAULT =~ "y" ]] || [[$IPDEFAULT =~ "Y" ]] ; then
echo ""
echo "We are using your default IP address"
echo "Enter masternode private key for node, followed by [ENTER]: $ALIAS"
read PRIVKEY
CONF_DIR=~/.bws\/
CONF_FILE=bws.conf
PORT=41798
IP=$(hostname -I)
mkdir -p $CONF_DIR
echo "rpcuser=user"`shuf -i 100000-10000000 -n 1` >> $CONF_DIR/$CONF_FILE
echo "rpcpassword=passw"`shuf -i 100000-10000000 -n 1` >> $CONF_DIR/$CONF_FILE
echo "rpcallowip=127.0.0.1" >> $CONF_DIR/$CONF_FILE
echo "listen=1" >> $CONF_DIR/$CONF_FILE
echo "server=1" >> $CONF_DIR/$CONF_FILE
echo "daemon=1" >> $CONF_DIR/$CONF_FILE
echo "logtimestamps=1" >> $CONF_DIR/$CONF_FILE
echo "maxconnections=256" >> $CONF_DIR/$CONF_FILE
echo "masternode=1" >> $CONF_DIR/$CONF_FILE
echo "" >> $CONF_DIR/$CONF_FILE
echo "" >> $CONF_DIR/$CONF_FILE
echo "port=$PORT" >> $CONF_DIR/$CONF_FILE
echo "masternodeaddr=$IP:$PORT" >> $CONF_DIR/$CONF_FILE
echo "masternodeprivkey=$PRIVKEY" >> $CONF_DIR/$CONF_FILE
sudo su -c "echo 'listenonion=1' >> /.bws/bws.conf"
./bwsd -resync
echo "if server start failure try ./bwsd -reindex"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! !"
echo "! Your MasterNode Is setup please close terminal !"
echo "! and continue the local wallet setup guide !"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo ""
else
echo "Type the custom IP of this node, followed by [ENTER]:"
read DIP
echo ""
echo "Enter masternode private key for node, followed by [ENTER]: $ALIAS"
read PRIVKEY
CONF_DIR=~/.bws\/
CONF_FILE=bws.conf
PORT=41798
mkdir -p $CONF_DIR
echo "rpcuser=user"`shuf -i 100000-10000000 -n 1` >> $CONF_DIR/$CONF_FILE
echo "rpcpassword=passw"`shuf -i 100000-10000000 -n 1` >> $CONF_DIR/$CONF_FILE
echo "rpcallowip=127.0.0.1" >> $CONF_DIR/$CONF_FILE
echo "listen=1" >> $CONF_DIR/$CONF_FILE
echo "server=1" >> $CONF_DIR/$CONF_FILE
echo "daemon=1" >> $CONF_DIR/$CONF_FILE
echo "logtimestamps=1" >> $CONF_DIR/$CONF_FILE
echo "maxconnections=256" >> $CONF_DIR/$CONF_FILE
echo "masternode=1" >> $CONF_DIR/$CONF_FILE
echo "" >> $CONF_DIR/$CONF_FILE
echo "" >> $CONF_DIR/$CONF_FILE
echo "port=$PORT" >> $CONF_DIR/$CONF_FILE
echo "masternodeaddr=$DIP:$PORT" >> $CONF_DIR/$CONF_FILE
echo "masternodeprivkey=$PRIVKEY" >> $CONF_DIR/$CONF_FILE
sudo su -c "echo 'listenonion=1' >> /.bws/bws.conf"
./bwsd -resync
echo "if server start failure try ./bwsd -reindex"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! !"
echo "! Your MasterNode Is setup please close terminal !"
echo "! and continue the local wallet setup guide !"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo ""
fi
else

echo ""
echo "Do you want TOR Integrated into this VPS? [y/n], followed by [ENTER]"
echo ""
echo ""
read TSETUP
if
[[ $TSETUP =~ "y" ]] || [[$TSETUP =~ "Y" ]] ; then
sudo su -c "echo 'deb http://deb.torproject.org/torproject.org '$(lsb_release -c | cut -f2)' main' > /etc/apt/sources.list.d/torproject.list"
gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
sudo apt-get update
sudo apt-get install tor deb.torproject.org-keyring -y
sudo usermod -a -G debian-tor $(whoami)

sudo sed -i 's/#ControlPort 9051/ControlPort 9051/g' /etc/tor/torrc
sudo sed -i 's/#CookieAuthentication 1/CookieAuthentication 1/g' /etc/tor/torrc
sudo su -c "echo 'CookieAuthFileGroupReadable 1' >> /etc/tor/torrc"
sudo su -c "echo 'LongLivedPorts 9033' >> /etc/tor/torrc"
sudo systemctl restart tor.service
rm -rf Bws_Setup.sh* BwsUpdate.sh*
./bws-cli stop
fi
echo ""
echo ""
echo "Do you want to configure your VPS with Bws recommended settings? [y/n], followed by [ENTER]"
read DOSETUP
if
[[ $DOSETUP =~ "y" ]] || [[$DOSETUP =~ "Y" ]] ; then
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade

sudo apt-get install -y ufw
sudo ufw allow ssh/tcp
sudo ufw limit ssh/tcp
sudo ufw logging on
sudo ufw allow 22
sudo ufw allow 41798
sudo ufw allow 9033
echo "y" | sudo ufw enable
sudo ufw status
fi
echo ""
echo ""
echo ""
echo "Are you installing/updating your Masternode? [y/n]"
read MSETUP
if
[[ $MSETUP =~ "y" ]] || [[$MSETUP =~ "Y" ]] ; then
./bws-cli stop
rm bwsd
rm bws-cli
rm bws-tx
wget https://github.com/bitcoinwspectrum/bws-linux-cli/releases/download/bws-cli/tar-bws-linux-cli
tar -xf bws-linux-cli.tgz
rm bws-linux-cli.tgz
sudo su -c "echo 'listenonion=1' >> /.bws/bws.conf"
echo "Masternode Configuration"
echo "Your recognised IP address is:"
sudo hostname -I
echo "Is this the IP you wish to use for MasterNode ? [y/n] , followed by [ENTER]"
read IPDEFAULT
if
[[ $IPDEFAULT =~ "y" ]] || [[$IPDEFAULT =~ "Y" ]] ; then
echo ""
echo "We are using your default IP address"
echo "Enter masternode private key for node, followed by [ENTER]: $ALIAS"
read PRIVKEY
CONF_DIR=~/.bws\/
CONF_FILE=bws.conf
PORT=41798
IP=$(hostname -I)
mkdir -p $CONF_DIR
echo "rpcuser=user"`shuf -i 100000-10000000 -n 1` >> $CONF_DIR/$CONF_FILE
echo "rpcpassword=passw"`shuf -i 100000-10000000 -n 1` >> $CONF_DIR/$CONF_FILE
echo "rpcallowip=127.0.0.1" >> $CONF_DIR/$CONF_FILE
echo "listen=1" >> $CONF_DIR/$CONF_FILE
echo "server=1" >> $CONF_DIR/$CONF_FILE
echo "daemon=1" >> $CONF_DIR/$CONF_FILE
echo "logtimestamps=1" >> $CONF_DIR/$CONF_FILE
echo "maxconnections=256" >> $CONF_DIR/$CONF_FILE
echo "masternode=1" >> $CONF_DIR/$CONF_FILE
echo "" >> $CONF_DIR/$CONF_FILE
echo "" >> $CONF_DIR/$CONF_FILE
echo "port=$PORT" >> $CONF_DIR/$CONF_FILE
echo "masternodeaddr=$IP:$PORT" >> $CONF_DIR/$CONF_FILE
echo "masternodeprivkey=$PRIVKEY" >> $CONF_DIR/$CONF_FILE
sudo su -c "echo 'listenonion=1' >> /.bws/bws.conf"
./bwsd -resync
echo "if server start failure try ./bwsd -reindex"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! !"
echo "! Your MasterNode Is setup please close terminal !"
echo "! and continue the local wallet setup guide !"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo ""
else
echo "Type the custom IP of this node, followed by [ENTER]:"
read DIP
echo ""
echo "Enter masternode private key for node, followed by [ENTER]: $ALIAS"
read PRIVKEY
CONF_DIR=~/.bws\/
CONF_FILE=bws.conf
PORT=41798
mkdir -p $CONF_DIR
echo "rpcuser=user"`shuf -i 100000-10000000 -n 1` >> $CONF_DIR/$CONF_FILE
echo "rpcpassword=passw"`shuf -i 100000-10000000 -n 1` >> $CONF_DIR/$CONF_FILE
echo "rpcallowip=127.0.0.1" >> $CONF_DIR/$CONF_FILE
echo "listen=1" >> $CONF_DIR/$CONF_FILE
echo "server=1" >> $CONF_DIR/$CONF_FILE
echo "daemon=1" >> $CONF_DIR/$CONF_FILE
echo "logtimestamps=1" >> $CONF_DIR/$CONF_FILE
echo "maxconnections=256" >> $CONF_DIR/$CONF_FILE
echo "masternode=1" >> $CONF_DIR/$CONF_FILE
echo "" >> $CONF_DIR/$CONF_FILE
echo "" >> $CONF_DIR/$CONF_FILE
echo "port=$PORT" >> $CONF_DIR/$CONF_FILE
echo "masternodeaddr=$DIP:$PORT" >> $CONF_DIR/$CONF_FILE
echo "masternodeprivkey=$PRIVKEY" >> $CONF_DIR/$CONF_FILE
sudo su -c "echo 'listenonion=1' >> /.bws/bws.conf"
./bwsd -resync
echo "if server start failure try ./bwsd -reindex"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "! !"
echo "! Your MasterNode Is setup please close terminal !"
echo "! and continue the local wallet setup guide !"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo ""
fi
fi
96 changes: 96 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<p align="center">
<img src="https://bitcoinwspectrum.com/wp-content/uploads/2018/08/img_00.png" width="250"/>
</p>

# <h> VPS Masternode with TOR ready setup script. </h>

To run the script simply type the following commands into your VPS terminal.

`wget https://github.com/xuez/masternode_script/releases/download/2/XuezUpdate.sh && chmod 755 BwsUpdate.sh && ./BwsUpdate.sh`

<h1> Masternode Basic Requirements </h1>

- 50,000 BWS

- Main Computer with BWS wallet installed

- Masternode Server

- Unique IP address for EACH masternode

<h1> Local Wallet Procedure </h1>

Step 1) Download, install and sync your BWS wallet
Download link for all Operating systems:
https://github.com/raymaker/bitcoinwspectrum/releases

Step 2) Using your main wallet, enter the debug console and type the following command:

- `masternode genkey`

- Please save this on a Notepad

Step 3) Using your main wallet, enter the debug console and type the following command:

- `getaccountaddress INSERT_MASTERNODE_NAME`

- Please save this on a Notepad

Step 4) Send 50,000 BWS to Step 3 address.

Step 5) Using your main wallet, wait for 15 confirmations, and then enter the debug console and type the following command:

- `masternode outputs`
- Please save this on a Notepad 

Step 6) Locate your masternode.conf and add the following line:

<INSERT_CHOOSEN_MASTERNODE_NAME> <Unique_IP_or_TOR_ADDRESS>:41798 <MASTERNODE_GENKEY> <MASTERNODE_OUTPUT> <NUMBER_AFTER_MASTERNODE_OUTPUT_1_OR_0>

Note: Substitute it with your own values and without the “<>”s

Example:
MN1 31.11.135.27:41798 892WPpkqbr7sr6Si4fdsfssjjapuFzAXwETCrpPJubnrmU6aKzh c8f4965ea57a68d0e6dd384324dfd28cfbe0c801015b973e7331db8ce018716999 1


<h2> Run and follow the instructions on the script </h2>

<h1> TOR Activation </h1>

Step 1 - Find the node onion address

Command: `./bws-cli getnetworkinfo`

Look for the TOR address at the end of the output (EG. aedFAWE235AGa2.onion)

Step 2 - Edit your LOCAL (Not VPS) masternode.conf by replacing the old IP address with the new .onion TOR address.

Step 3 - Restart the local wallet
Windows, Max and Linux GUI; Close and open your wallet

Linux CLI:

Command: `./bws-cli stop`
then: `./bwsd -reindex`

Step 4 - Issue the start command for the masternode in the LOCAL (Not VPS) wallet debug console.

For example: `startmasternode alias 0 MN01`

Note:
Where by MN01 is your chosen Masternode name
Wait a few minutes for the MN ip address to change to the onion address in the masternode tab.

Step 5 - Restart the wallet on the VPS with the following commands.

Command: `./bws-cli stop`

then: `./bwsd -reindex`

Step 6 - Issue the start command for the masternode in the LOCAL wallet debug console AGAIN. ie follow step 4 again.

Step 7 - Wait up to 30 minutes for the MN timer to change from 00:00 to a postive time in the masternode tab.

Note:
You can check to see if it updated to the onion address in the VPS using:
./bws-cli masternode status

0 comments on commit b20f0b9

Please sign in to comment.