From 9a1b0769b6d0d88edcde49162b3fee175daeda75 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 16:50:19 +0100 Subject: [PATCH 01/23] Add files via upload --- LICENSE | 21 ++ Readme.md | 94 ++++++++ check-masternode.sh | 143 +++++++++++ install.sh | 570 ++++++++++++++++++++++++++++++++++++++++++++ update.sh | 517 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1345 insertions(+) create mode 100644 LICENSE create mode 100644 Readme.md create mode 100644 check-masternode.sh create mode 100644 install.sh create mode 100644 update.sh diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f22e0ba --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 PostJoke + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..9af69fe --- /dev/null +++ b/Readme.md @@ -0,0 +1,94 @@ +# Commercium-Masternode-Single/Multi-Installer + +> **Version 1.0.1:** + +Login to your vps as root, download and run the install.sh file using this command: + +``` +curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/install.sh > install.sh +bash install.sh +``` + + +------ + +### Bash Updater for masternode on Ubuntu 16.04 LTS x64 + +------ + +> **Version 1.0.1:** + +- Auto-update for update/install scripts Added. +- Update time becomes random for each vps. +- Debug log cleared every 2 days. +- Log file to UpdateNode shell added. +- This shell script can now be used either for a single update or Multi-vps update. + +> **This shell script has 4 cronjobs:** + +1. Scripts auto-update: [Check-scripts.sh](https://github.com/PostJoke/masternode/blob/master/Masternode/Check-scripts.sh) +2. Ensuring that the daemon never gets stuck: [daemon_check.sh](https://github.com/PostJoke/masternode/blob/master/Masternode/daemon_check.sh) +3. Log file clearing: [clearlog.sh](https://github.com/PostJoke/masternode/blob/master/Masternode/clearlog.sh) +4. Auto-update for Commercium Core: [UpdateNode.sh](https://github.com/PostJoke/masternode/blob/master/Masternode/UpdateNode.sh) + +> **How to use:** + +Login to your vps as root, download and run the Update.sh file using this command: + +``` +curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/update.sh > update.sh +bash update.sh +``` + +> **Available options:** + +1. **Update Masternode & Auto-update script** +2. **Update only the Auto-update script** +3. **Exit** + +>#### **1. Update Masternode & Auto-update script:** + +Updates the Commercium core & the update script, PS.available for both single and multi-vps update: + +**1.1-Update a Single Masternode:** + +``` +Updates only the vps that runs the shell script. +``` + +**1.2- Update Multi-vps Masternode** + +``` +Updates all the vps that you will add using these two options here: + + 1.2.1. Use the same SSH Port and Password for all vps's: + + Enter your vps ip's: (Exemple: 111.111.111.111-222.222.222.222-... ) + + SSH port: (Exemple: 22 ) + + password: (Exemple: Des53G2v3P ) + + 1.2.2. Use a different SSH Port and Password for each vps: + + Enter your vps data: 'Host:Password:SSHPort' ( Exemple: 111.111.111.111:ERdX5h64dSer:22-222.222.222.222:Wz65D232Fty:165-... ) +``` + +>#### **2. Update the Auto-update script only:** + +Updates only the shell scripts in your vps, PS.available for both single and multi-vps update. + +>#### **3. Exit:** + +Ends the Shell script. + +------ + +### Bash Checker for Masternodes on Ubuntu 16.04 LTS x64 + +------ + +``` +curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/check-masternode.sh > check-masternode.sh +bash check-masternode.sh +``` diff --git a/check-masternode.sh b/check-masternode.sh new file mode 100644 index 0000000..fe02796 --- /dev/null +++ b/check-masternode.sh @@ -0,0 +1,143 @@ +#!/bin/bash +RED='\033[0;97;41m' +STD='\033[0;0;39m' +GREEN='\e[1;97;42m' +BLUE='\e[1;97;44m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color +LOG='Masternodes-check.log' + +function valid_ip() +{ + local ip=$1 + local stat=1 + + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} + +clear +echo "" +echo -e "${BLUE} C H E C K C O M M E R C I U M M A S T E R N O D E S ${STD}" +echo "" +read -p "Same SSH Port and Password for all vps's? (Y/N)" -n 1 -r +echo "" # (optional) move to a new line +if [[ $REPLY =~ ^[Yy]$ ]]; then +sleep 2 +echo -e "Please enter your vps ip's: ${RED}( Exemple: 111.111.111.111-222.222.222.222-... )${STD}" + +unset ip +while [ -z ${ip} ]; do +read -p "IP HERE: " ip +done + +unset port +while [ -z ${port} ]; do +read -p "SSH PORT: " port +done + +unset rootpass +while [ -z ${rootpass} ]; do +read -s -p "PASSWORD: " rootpass +done + +vpsip=$(echo $ip | tr "-" " ") +echo > $LOG +for i in $vpsip +do +if valid_ip $i; +then +dt=`date '+%d/%m/%Y %H:%M:%S'` +echo "" # (optional) move to a new line +echo "" # (optional) move to a new line +echo -e "${GREEN} Connexion Vps ip $i ${STD}\n" +echo -e "${RED} Commercium Core Vps ip $i Data ${STD}" +sshpass -p $rootpass ssh -p$port -o StrictHostKeyChecking=no root@$i " +printf '${YELLOW}Commercium Core Last Block: ${NC}' +commercium-cli getblockcount || { echo 'Commercium core not running'; } +printf '${YELLOW}Commercium Core RPC client version: ${NC}' +commercium-cli -version | awk -F'"' '"' '"'{print $NF}'"' | cut -d '-' -f1 +printf '${RED} ------------------------------------------------ ${STD}\n' +echo '' +sleep 2 +exit;" + +sshpass -p $rootpass ssh -p$port -o StrictHostKeyChecking=no root@$i " +echo '[$dt] ==============================================================' +echo '[$dt]==> Info: Vps ip: $i ' +echo '[$dt] ==============================================================' +printf '[$dt]==> Info: Commercium Core Last Block: $blook'; commercium-cli getblockcount || { echo 'Commercium core not running'; } +printf '[$dt]==> Info: Commercium Core RPC client version: '; commercium-cli -version | awk -F'"' '"' '"'{print $NF}'"' | cut -d '-' -f1 +echo '[$dt] ==============================================================' +echo '' +sleep 2 +exit;" >> $LOG || { echo "[$dt]==> Error: VPS IP $i connexion failed" >> $LOG && echo " " >> $LOG; } + +else +echo "" +echo "" +echo -e "${RED} $i invalid IP ................... ${STD}" +fi + +done +elif [[ $REPLY =~ ^[Nn]$ ]]; then + +sleep 2 +echo -e "Please enter your vps's data: 'Host:Password:SSHPort' ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22-222.222.222.222:Wz65D232Fty:165-... )${STD}" + +unset ip +while [ -z ${ip} ]; do +read -p "DATA HERE: " ip +done + +data=$(echo $ip | tr "-" " ") +echo > $LOG +for i in $data +do +vpsdata=$(echo $i | tr ":" "\n") +declare -a array=($vpsdata) +host=${array[0]} +pass=${array[1]} +port=${array[2]} +if [ -z "$pass" ] || [ -z "$port" ] || [ -z "$host" ] +then +echo -e "Please enter a correct vps's data ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22 222.222.222.222:Wz65D232Fty:165 ... )${STD}" +else +dt=`date '+%d/%m/%Y %H:%M:%S'` +echo "" # (optional) move to a new line +echo "" # (optional) move to a new line +echo -e "${GREEN} Connexion Vps ip $host ${STD}\n" +echo -e "${RED} Commercium Core Vps ip $host Data ${STD}" +sshpass -p $pass ssh -p$port -o StrictHostKeyChecking=no root@$host " +printf '${YELLOW} Commercium Core Last Block: ${NC}' +commercium-cli getblockcount || { echo 'Commercium core not running'; } +printf '${YELLOW} Commercium Core RPC client version: ${NC}' +commercium-cli -version | awk -F'"' '"' '"'{print $NF}'"' | cut -d '-' -f1 +printf '${RED} ------------------------------------------------ ${STD}\n' +echo '' +sleep 2 +exit;" + +sshpass -p $pass ssh -p$port -o StrictHostKeyChecking=no root@$host " +echo '[$dt] ==============================================================' +echo '[$dt]==> Info: Vps ip: $host ' +echo '[$dt] ==============================================================' +printf '[$dt]==> Info: Commercium Core Last Block: $blook'; commercium-cli getblockcount || { echo 'Commercium core not running'; } +printf '[$dt]==> Info: Commercium Core RPC client version: '; commercium-cli -version | awk -F'"' '"' '"'{print $NF}'"' | cut -d '-' -f1 +echo '[$dt] ==============================================================' +echo '' +sleep 2 +exit;" >> $LOG || { echo "[$dt]==> Error: VPS IP $host connexion failed" >> $LOG && echo " " >> $LOG; } +fi +done +else +exit; +fi diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..b5bf855 --- /dev/null +++ b/install.sh @@ -0,0 +1,570 @@ +#!/bin/bash +##################################################################################### +# Automatic installation for Commercium nodes # +##################################################################################### +RED='\033[0;97;41m' +STD='\033[0;0;39m' +GREEN='\e[1;97;42m' +BLUE='\e[1;97;44m' + +pause(){ + read -p "Press [Enter] key to continue - Press [CRTL+C] key to Exit..." fackEnterKey +} + +show_menus() { + clear + echo "" + echo -e "\e[1;97;44m C O M M E R C I U M N O D E S A U T O I N S T A L L ${STD}" + echo "" + echo "1. Install Node" + echo "2. Install Masternode" + echo "3. Exit" + echo "" + echo -e "\e[1;97;41m ${STD}" + echo -e "\e[1;97;41m CAUTION!!: ${STD}" + echo -e "\e[1;97;41m For a successful setup, please clear your vps from any ${STD}" + echo -e "\e[1;97;41m previous Commercium core installation ${STD}" + echo -e "\e[1;97;41m ${STD}" + echo "" + +} + +Config_Full_Node(){ +nodeIpAddress=`curl ifconfig.me/ip` +if [[ ${nodeIpAddress} =~ ^[0-9]+.[0-9]+.[0-9]+.[0-9]+$ ]]; then + external_ip_line="externalip=${nodeIpAddress}" +else + external_ip_line="#externalip=external_IP_goes_here" +fi + +rpcUserName=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 12 ; echo '') + +rpcPassword=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32 ; echo '') + +config="#---- +rpcuser=$rpcUserName +rpcpassword=$rpcPassword +rpcallowip=127.0.0.1 +#---- +listen=1 +server=1 +daemon=1 +maxconnections=64 +#---- +$external_ip_line +#---- +txindex=1 +addressindex=1 +timestampindex=1 +spentindex=1 +addnode=seed01.commercium.net +addnode=seed02.commercium.net +addnode=seed03.commercium.net +addnode=seed04.commercium.net +addnode=explorer.commercium.net" +} + +Config_Full_Node_Multi(){ +rpcUserName=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 12 ; echo '') + +rpcPassword=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32 ; echo '') + +config="#---- +\nrpcuser=\"'$rpcUserName'\" +\nrpcpassword=\"'$rpcPassword'\" +\nrpcallowip=127.0.0.1 +\n#---- +\nlisten=1 +\nserver=1 +\ndaemon=1 +\nmaxconnections=64 +\n#---- +\nexternalip=\"'$i'\" +\n#---- +\ntxindex=1 +\naddressindex=1 +\ntimestampindex=1 +\nspentindex=1 +\naddnode=seed01.commercium.net +\naddnode=seed02.commercium.net +\naddnode=seed03.commercium.net +\naddnode=seed04.commercium.net +\naddnode=explorer.commercium.net" +} + +Config_Masternode(){ +nodeIpAddress=`curl ifconfig.me/ip` +if [[ ${nodeIpAddress} =~ ^[0-9]+.[0-9]+.[0-9]+.[0-9]+$ ]]; then + external_ip_line="externalip=${nodeIpAddress}" +else + external_ip_line="#externalip=external_IP_goes_here" +fi + +rpcUserName=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 12 ; echo '') + +rpcPassword=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32 ; echo '') + +config="#---- +rpcuser=$rpcUserName +rpcpassword=$rpcPassword +rpcallowip=127.0.0.1 +#---- +listen=1 +server=1 +daemon=1 +maxconnections=64 +#---- +txindex=1 +masternode=1 +masternodeprivkey=$pv +$external_ip_line +#---- +addnode=seed01.commercium.net +addnode=seed02.commercium.net +addnode=seed03.commercium.net +addnode=seed04.commercium.net +addnode=explorer.commercium.net" +} + +Config_Masternode_Multi(){ +nodeIpAddress=`curl ifconfig.me/ip` +if [[ ${nodeIpAddress} =~ ^[0-9]+.[0-9]+.[0-9]+.[0-9]+$ ]]; then + external_ip_line="externalip=${nodeIpAddress}" +else + external_ip_line="#externalip=external_IP_goes_here" +fi + +rpcUserName=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 12 ; echo '') + +rpcPassword=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32 ; echo '') + +config="#---- +\nrpcuser=\"'$rpcUserName'\" +\nrpcpassword=\"'$rpcPassword'\" +\nrpcallowip=127.0.0.1 +\n#---- +\nlisten=1 +\nserver=1 +\ndaemon=1 +\nmaxconnections=64 +\n#---- +\ntxindex=1 +\nmasternode=1 +\nmasternodeprivkey=\"'$pv'\" +\nexternalip=\"'$i'\" +\n#---- +\naddnode=seed01.commercium.net +\naddnode=seed02.commercium.net +\naddnode=seed03.commercium.net +\naddnode=seed04.commercium.net +\naddnode=explorer.commercium.net" +} + +install_Commercium_core(){ +echo "" +echo -e "${GREEN} Start Installation Commercium core ${STD}" +sleep 1 +h=$(( RANDOM % 23 + 1 )); +echo "" +echo -e "${GREEN} Install packages..... ${STD}" +yes | apt-get update +yes | apt-get install ufw python virtualenv git unzip pv nano htop libwww-perl +echo "" +echo -e "${GREEN} Firewall/Swapfile setup..... ${STD}" +sudo ufw allow ssh/tcp +sudo ufw limit ssh/tcp +sudo ufw allow 2019/tcp +sudo ufw logging on +yes | sudo ufw enable +sudo fallocate -l 4G /swapfile +sudo chmod 600 /swapfile +sudo mkswap /swapfile +sudo swapon /swapfile +echo "/swapfile none swap sw 0 0" >> /etc/fstab +sleep 2 +echo "" +echo -e "${GREEN} Building Commercium core from source..... ${STD}" +rm -rf /usr/local/bin/Masternode +cd ~ +latestrelease=$(curl --silent https://api.github.com/repos/CommerciumBlockchain/CommerciumContinuum/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') +link="https://github.com/CommerciumBlockchain/CommerciumContinuum/archive/$latestrelease.tar.gz" +wget $link +tar -xvzf $latestrelease.tar.gz +file=${latestrelease//[v]/CommerciumContinuum-} +yes | sudo apt-get update +export LC_ALL=en_US.UTF-8 +yes | sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl +yes | sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev +yes | sudo apt-get install software-properties-common +yes | sudo add-apt-repository ppa:bitcoin/bitcoin +yes | sudo apt-get update +yes | sudo apt-get install libdb4.8-dev libdb4.8++-dev +yes | sudo apt-get install libminiupnpc-dev +yes | sudo apt-get install libzmq3-dev +yes | sudo apt-get install libgomp1 +sleep 2 +echo "" +echo -e "${GREEN} Compile Commercium core ..... ${STD}" +cd $file +./zcutil/fetch-params.sh +echo -e "${GREEN} Compile ${STD}" +echo "" +./zcutil/build.sh +cd ~ +cp $file/src/commerciumd /usr/local/bin +cp $file/src/commercium-cli /usr/local/bin +cp $file/src/commercium-tx /usr/local/bin +cp $file/src/commercium-gtest /usr/local/bin +echo "" +echo -e "${GREEN} Configure Commercium core ..... ${STD}" +cd ~ +mkdir ./.commercium +echo "$config" > ./.commercium/commercium.conf +cd ~ +cd /usr/local/bin +mkdir Masternode +cd Masternode +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount +chmod 755 daemon_check.sh +chmod 755 UpdateNode.sh +chmod 755 Check-scripts.sh +chmod 755 Update-scripts.sh +chmod 755 clearlog.sh +cd ~ +crontab -r +line="@reboot /usr/local/bin/commerciumd +0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh +*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh +0 $h * * * /usr/local/bin/Masternode/UpdateNode.sh +* * */2 * * /usr/local/bin/Masternode/clearlog.sh" +echo "$line" | crontab -u root - +echo -e "${GREEN} Commercium core Configured successfully ..... ${STD}" +echo "" +cd ~ +rm $latestrelease.tar.gz +rm -rf \$file +echo -e "${GREEN} Rebooting ..... ${STD}" +reboot +} + +install_Commercium_core_Multi(){ +echo "" +echo -e "${GREEN} Connexion Vps ip $i ${STD}" +echo "" +sshpass -p $rootpass ssh -p$sshport -o StrictHostKeyChecking=no root@$i ' +STD="\033[0;0;39m" +BLUE="\e[1;97;44m" +echo "#!/bin/bash +HOME=/root +LOGNAME=root +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +LANG=en_US.UTF-8 +SHELL=/bin/sh +PWD=/root +h=\$(( RANDOM % 23 + 1 )); +configdata=\"'$config'\" +rm -rf /usr/local/bin/Masternode +yes | apt-get update +yes | apt-get install ufw python virtualenv git unzip pv nano htop libwww-perl +sudo ufw allow ssh/tcp +sudo ufw limit ssh/tcp +sudo ufw allow 2019/tcp +sudo ufw logging on +yes | sudo ufw enable +sudo fallocate -l 4G /swapfile +sudo chmod 600 /swapfile +sudo mkswap /swapfile +sudo swapon /swapfile +echo \"/swapfile none swap sw 0 0\" >> /etc/fstab +sleep 4 +cd ~ +yes | sudo apt-get update +export LC_ALL=en_US.UTF-8 +yes | sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl +yes | sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev +yes | sudo apt-get install software-properties-common +yes | sudo add-apt-repository ppa:bitcoin/bitcoin +yes | sudo apt-get update +yes | sudo apt-get install libdb4.8-dev libdb4.8++-dev +yes | sudo apt-get install libminiupnpc-dev +yes | sudo apt-get install libzmq3-dev +yes | sudo apt-get install libgomp1 +sleep 2 +latestrelease=\$(curl --silent https://api.github.com/repos/CommerciumBlockchain/CommerciumContinuum/releases/latest | grep '"'"\\$"\"tag_name"\\$"\":'"' | sed -E '"'s/.*"\\$"\"([^"\\$"\"]+)"\\$"\".*/\1/'"') +link=\"https://github.com/CommerciumBlockchain/CommerciumContinuum/archive/$latestrelease.tar.gz\" +wget \$link +tar -xvzf \$latestrelease.tar.gz +file=\${latestrelease//[v]/CommerciumContinuum-} +cd \$file +./zcutil/fetch-params.sh +./zcutil/build.sh +cd ~ +cp $file/src/commerciumd /usr/local/bin +cp $file/src/commercium-cli /usr/local/bin +cp $file/src/commercium-tx /usr/local/bin +cp $file/src/commercium-gtest /usr/local/bin +cd ~ +mkdir ./.commercium +echo -e \"\$configdata\" > ./.commercium/commercium.conf +cd ~ +cd /usr/local/bin +mkdir Masternode +cd Masternode +wget https://raw.githubusercontent.com/PostJoke/masternod/master/Masternode/Check-scripts.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount +chmod 755 daemon_check.sh +chmod 755 UpdateNode.sh +chmod 755 Check-scripts.sh +chmod 755 Update-scripts.sh +chmod 755 clearlog.sh +cd ~ +crontab -r +line=\"@reboot /usr/local/bin/commerciumd +0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh +*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh +0 \$h * * * /usr/local/bin/Masternode/UpdateNode.sh +* * */2 * * /usr/local/bin/Masternode/clearlog.sh\" +echo \"\$line\" | crontab -u root - +cd ~ +rm \$latestrelease.tar.gz +rm -rf \$file +reboot" > /root/install.sh +chmod 755 install.sh +install="@reboot /root/install.sh" +echo "$install" | crontab -u root - +echo "" +echo -e "${BLUE} ${STD}" +echo -e "${BLUE} Script Installation launched on Vps,be patient few minutes and will be ready to use. ${STD}" +echo -e "${BLUE} ${STD}" +echo "" +reboot' +} + +read_options(){ + local choice + read -p "Enter choice [ 1 - 3] " choice + case $choice in + +#### Commercium Node installation +1)type="Node" + echo "" + echo -e "${BLUE} Start Install Commercium ${type} ${STD}" + echo "" + echo "Do you want to start the Commercium ${type} installation?" + pause + echo "" + echo -e "${GREEN} Single (Local vps) - Multi (Multi vps's) ${STD}" + + PS3='Please enter your choice: ' + options=("Install Single ${type}" "Install Multi ${type}") + select opt in "${options[@]}" + do + case $opt in + "Install Single ${type}") + break + ;; + "Install Multi ${type}") + break + ;; + *) echo invalid option;; + esac + done + #### Commercium Single Node installation + if [ "$opt" == "Install Single ${type}" ]; then + Config_Full_Node + install_Commercium_core + else + #### 3Dcoin Multi Nodes installation + echo "" + echo "" + read -p "Same SSH Port and Password for all vps's? (Y/N)" -n 1 -r + echo "" # (optional) move to a new line + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "" + echo -e "${GREEN} Enter Vps ip's ${STD}" + echo "" + sleep 2 + echo -e "Please enter your vps ip's: ${RED}(Exemple: 111.111.111.111-222.222.222.222-... ) ${STD}" + unset ip + while [ -z ${ip} ]; do + read -p "IP HERE: " ip + done + unset sshport + while [ -z ${sshport} ]; do + read -p "SSH Port: " sshport + done + unset rootpass + while [ -z ${rootpass} ]; do + read -s -p "Password: " rootpass + done + echo "" + vpsip=$(echo $ip | tr "-" " ") + apt-get update + yes | apt-get install sshpass + for i in $vpsip + do + Config_Full_Node_Multi + install_Commercium_core_Multi + done + elif [[ $REPLY =~ ^[Nn]$ ]]; then + sleep 2 + echo -e "Please enter your vps's data: 'Host:Password:SSHPort' ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22-222.222.222.222:Wz65D232Fty:165-... )${STD}" + unset ip + while [ -z ${ip} ]; do + read -p "DATA HERE: " ip + done + apt-get update + yes | apt-get install sshpass + data=$(echo $ip | tr "-" " ") + for ipdata in $data + do + vpsdata=$(echo $ipdata | tr ":" "\n") + declare -a array=($vpsdata) + i=${array[0]} + rootpass=${array[1]} + sshport=${array[2]} + if [ -z "$rootpass" ] || [ -z "$sshport" ] || [ -z "$i" ] + then + echo -e "Please enter a correct vps's data ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22 222.222.222.222:Wz65D232Fty:165 ... )${STD}" + else + Config_Full_Node_Multi + install_Commercium_core_Multi + fi + done + else + exit; + fi +fi +exit 0;; + +#### Commercium Masternode installation +2) type="Masternode" + echo "" + echo -e "${BLUE} Start Install Commercium ${type} ${STD}" + echo "" + echo "Do you want to start the Commercium ${type} installation?" + pause + + echo "" + echo -e "${GREEN} Single (Local vps) - Multi (Multi vps's) ${STD}" + + PS3='Please enter your choice: ' + options=("Install Single ${type}" "Install Multi ${type}") + select opt in "${options[@]}" + do + case $opt in + "Install Single ${type}") + break + ;; + "Install Multi ${type}") + break + ;; + *) echo invalid option;; + esac + done + #### Commercium Single Masternode installation + if [ "$opt" == "Install Single ${type}" ]; then + unset pv + while [ -z ${pv} ]; do + read -p "Please Enter Masternode Private key: " pv + done + Config_Masternode + install_Commercium_core + else + #### Commercium Multi Masternodes installation + echo "" + echo "" + read -p "Same SSH Port and Password for all vps's? (Y/N)" -n 1 -r + echo "" # (optional) move to a new line + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "" + echo -e "${GREEN} Enter Vps ip's ${STD}" + echo "" + sleep 2 + echo -e "Please enter your vps ip's: ${RED}(Exemple: 111.111.111.111-222.222.222.222-... ) ${STD}" + unset ip + while [ -z ${ip} ]; do + read -p "IP HERE: " ip + done + unset sshport + while [ -z ${sshport} ]; do + read -p "SSH Port: " sshport + done + unset rootpass + while [ -z ${rootpass} ]; do + read -s -p "Password: " rootpass + done + echo "" + vpsip=$(echo $ip | tr "-" " ") + apt-get update + yes | apt-get install sshpass + for i in $vpsip + do + echo "" + echo -e "${GREEN} Masternode Private key ${STD}" + unset pv + while [ -z ${pv} ]; do + read -p "Please Enter Masternode Private key: " pv + done + Config_Masternode_Multi + install_Commercium_core_Multi + done + elif [[ $REPLY =~ ^[Nn]$ ]]; then + sleep 2 + echo -e "Please enter your vps's data: 'Host:Password:SSHPort' ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22-222.222.222.222:Wz65D232Fty:165-... )${STD}" + unset ip + while [ -z ${ip} ]; do + read -p "DATA HERE: " ip + done + apt-get update + yes | apt-get install sshpass + data=$(echo $ip | tr "-" " ") + for ipdata in $data + do + vpsdata=$(echo $ipdata | tr ":" "\n") + declare -a array=($vpsdata) + i=${array[0]} + rootpass=${array[1]} + sshport=${array[2]} + if [ -z "$rootpass" ] || [ -z "$sshport" ] || [ -z "$i" ] + then + echo -e "Please enter a correct vps's data ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22 222.222.222.222:Wz65D232Fty:165 ... )${STD}" + else + echo "" + echo -e "${GREEN} Masternode Private key ${STD}" + unset pv + while [ -z ${pv} ]; do + read -p "Please Enter Masternode Private key: " pv + done + Config_Masternode_Multi + install_Commercium_core_Multi + fi + done + else + exit; + fi +fi +exit 0;; + +3) exit 0;; + +*) echo -e "${RED}Invalid option...${STD}" && sleep 2 +esac +} + +while true +do + show_menus + read_options +done diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..4435b84 --- /dev/null +++ b/update.sh @@ -0,0 +1,517 @@ +#!/bin/bash +##################################################################################### +# Update Commercium Core # +##################################################################################### +RED='\033[0;97;41m' +STD='\033[0;0;39m' +GREEN='\e[1;97;42m' +BLUE='\e[1;97;44m' + +show_menus() { + clear + echo "" + echo -e "${BLUE} U P D A T E C O M M E R C I U M M A S T E R N O D E ${STD}" + echo "" + echo "1. Update Masternode & Auto-update script" + echo "2. Update only Auto-update script" + echo "3. Exit" + echo "" + echo -e "\e[1;97;41m Note!!: Update Commercium Core & Update for Auto-update ${STD}" + echo "" +} + +Update_Masternode_And_Script_Single() { + echo "" + h=$(( RANDOM % 23 + 1 )); + echo -e "${BLUE} Start ${Update} ${STD}" + rm -f /usr/local/bin/check.sh + rm -f /usr/local/bin/update.sh + rm -f /usr/local/bin/UpdateNode.sh + rm -rf /usr/local/bin/Masternode + echo "" + cd ~ + echo -e "${GREEN} Get latest release ${STD}" + latestrelease=$(curl --silent 'https://api.github.com/repos/CommerciumBlockchain/CommerciumContinuum/releases/latest' | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + link="https://github.com/CommerciumBlockchain/CommerciumContinuum/archive/$latestrelease.tar.gz" + wget $link + tar -xvzf $latestrelease.tar.gz + file=${latestrelease//[Vv]/CommerciumContinuum-} + echo "" + echo -e "${GREEN} Stop Cron ${STD}" + sudo /etc/init.d/cron stop + echo "" + echo -e "${GREEN} Compiling Commercium core ${STD}" + cd $file + echo -e "${GREEN} Stop Commercium core ${STD}" + echo "" + commercium-cli stop + sleep 10 + echo -e "${GREEN} Make install ${STD}" + echo "" + ./zcutil/fetch-params.sh + ./zcutil/build.sh + cd ~ + cp $file/src/commerciumd /usr/local/bin + cp $file/src/commercium-cli /usr/local/bin + cp $file/src/commercium-tx /usr/local/bin + cp $file/src/commercium-gtest /usr/local/bin + echo "" + echo -e "${GREEN} Update crontab ${STD}" + cd ~ + cd /usr/local/bin + mkdir Masternode + cd Masternode + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount + chmod 755 daemon_check.sh + chmod 755 UpdateNode.sh + chmod 755 Check-scripts.sh + chmod 755 Update-scripts.sh + chmod 755 clearlog.sh + cd ~ + crontab -r + line="@reboot /usr/local/bin/commerciumd +0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh +*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh +0 $h * * * /usr/local/bin/Masternode/UpdateNode.sh +* * */2 * * /usr/local/bin/Masternode/clearlog.sh" + echo "$line" | crontab -u root - + echo "Crontab updated successfully" + echo "" + echo -e "${GREEN} Start Cron ${STD}" + sudo /etc/init.d/cron start + echo "" + echo -e "${GREEN} Update Finished,rebooting server ${STD}" + cd ~ + rm $latestrelease.tar.gz + rm -rf $file + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed01.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed02.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed03.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed04.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=explorer.commercium.net") -eq 0 ]; then + echo "addnode=explorer.commercium.net" >> /root/.commercium/commercium.conf + fi + reboot +} +Update_Masternode_And_Script_Multi() { + sshpass -p $rootpass ssh -p$sshport -o StrictHostKeyChecking=no root@$ipserver ' + h=$(( RANDOM % 23 + 1 )); + rm -f /usr/local/bin/check.sh + rm -f /usr/local/bin/update.sh + rm -f /usr/local/bin/UpdateNode.sh + rm -rf /usr/local/bin/Masternode + cd ~ + echo "-----------------------------------------------------" + echo -e "${GREEN} Git checkout master ${STD}" + echo "-----------------------------------------------------" + latestrelease=$(curl --silent https://api.github.com/repos/CommerciumBlockchain/CommerciumContinuum/releases/latest | grep '"'"\\$"\"tag_name"\\$"\":'"' | sed -E '"'s/.*"\\$"\"([^"\\$"\"]+)"\\$"\".*/\1/'"') +link="https://github.com/CommerciumBlockchain/CommerciumContinuum/archive/$latestrelease.tar.gz" +wget $link +tar -xvzf $latestrelease.tar.gz + file=${latestrelease//[Vv]/CommerciumContinuum-} + echo "" + echo "-----------------------------------------------------" + echo -e "${GREEN} Stop Cron ${STD}" + echo "-----------------------------------------------------" + sudo /etc/init.d/cron stop + echo "" + echo "-----------------------------------------------------" + echo -e "${GREEN} Compiling Commercium core ${STD}" + echo "-----------------------------------------------------" + cd $file + echo "" + echo "-----------------------------------------------------" + echo -e "${GREEN} Stop 3Dcoin core ${STD}" + echo "-----------------------------------------------------" + commercium-cli stop + sleep 10 + echo "" + echo "-----------------------------------------------------" + echo -e "${GREEN} Make install ${STD}" + echo "-----------------------------------------------------" + ./zcutil/fetch-params.sh + ./zcutil/build.sh + cd ~ + cp $file/src/commerciumd /usr/local/bin + cp $file/src/commercium-cli /usr/local/bin + cp $file/src/commercium-tx /usr/local/bin + cp $file/src/commercium-gtest /usr/local/bin + echo "" + echo "-----------------------------------------------------" + echo -e "${GREEN} Update crontab ${STD}" + echo "-----------------------------------------------------" + cd ~ + cd /usr/local/bin + mkdir Masternode + cd Masternode + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount + chmod 755 daemon_check.sh + chmod 755 UpdateNode.sh + chmod 755 Check-scripts.sh + chmod 755 Update-scripts.sh + chmod 755 clearlog.sh + cd ~ + crontab -r + line="@reboot /usr/local/bin/commerciumd +0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh +0 $h * * * /usr/local/bin/Masternode/UpdateNode.sh +*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh +* * */2 * * /usr/local/bin/Masternode/clearlog.sh" + echo "$line" | crontab -u root - + echo "Crontab updated successfully" + echo "" + echo "-----------------------------------------------------" + echo -e "${GREEN} Update Finished,rebooting server ${STD}" + echo "-----------------------------------------------------" + cd ~ + rm $latestrelease.tar.gz + rm -rf $file + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed01.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed02.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed03.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed04.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=explorer.commercium.net") -eq 0 ]; then + echo "addnode=explorer.commercium.net" >> /root/.commercium/commercium.conf + fi + reboot' +} + +Update_Script_Single() { + echo "" + h=$(( RANDOM % 23 + 1 )); + echo -e "${BLUE} Start ${Update} ${STD}" + rm -f /usr/local/bin/check.sh + rm -f /usr/local/bin/update.sh + rm -f /usr/local/bin/UpdateNode.sh + rm -rf /usr/local/bin/Masternode + echo "" + cd ~ + echo -e "${GREEN} Stop Cron ${STD}" + sudo /etc/init.d/cron stop + echo "" + echo -e "${GREEN} Update crontab ${STD}" + cd ~ + cd /usr/local/bin + mkdir Masternode + cd Masternode + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount + chmod 755 daemon_check.sh + chmod 755 UpdateNode.sh + chmod 755 Check-scripts.sh + chmod 755 Update-scripts.sh + chmod 755 clearlog.sh + cd ~ + crontab -r + line="@reboot /usr/local/bin/commerciumd +0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh +*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh +0 $h * * * /usr/local/bin/Masternode/UpdateNode.sh +* * */2 * * /usr/local/bin/Masternode/clearlog.sh" + echo "$line" | crontab -u root - + echo "Crontab updated successfully" + echo "" + echo -e "${GREEN} Start Cron ${STD}" + sudo /etc/init.d/cron start + echo "" + echo -e "${GREEN} Update Finished ${STD}" + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed01.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed02.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed03.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conff | grep -c "addnode=seed04.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=explorer.commercium.net") -eq 0 ]; then + echo "addnode=explorer.commercium.net" >> /root/.commercium/commercium.conf + fi + echo "" +} + +Update_Script_Multi() { + sshpass -p $rootpass ssh -p$sshport -o StrictHostKeyChecking=no root@$ipserver ' + h=$(( RANDOM % 23 + 1 )); + rm -f /usr/local/bin/check.sh + rm -f /usr/local/bin/update.sh + rm -f /usr/local/bin/UpdateNode.sh + rm -rf /usr/local/bin/Masternode + cd ~ + echo "" + echo "-----------------------------------------------------" + echo -e "${GREEN} Stop Cron ${STD}" + echo "-----------------------------------------------------" + sudo /etc/init.d/cron stop + echo "" + echo "-----------------------------------------------------" + echo -e "${GREEN} Update crontab ${STD}" + echo "-----------------------------------------------------" + cd ~ + cd /usr/local/bin + mkdir Masternode + cd Masternode + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version + wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount + chmod 755 daemon_check.sh + chmod 755 UpdateNode.sh + chmod 755 Check-scripts.sh + chmod 755 Update-scripts.sh + chmod 755 clearlog.sh + cd ~ + crontab -r + line="@reboot /usr/local/bin/commerciumd +0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh +*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh +0 $h * * * /usr/local/bin/Masternode/UpdateNode.sh +* * */2 * * /usr/local/bin/Masternode/clearlog.sh" + echo "$line" | crontab -u root - + echo "Crontab updated successfully" + sudo /etc/init.d/cron start + echo "" + echo "-----------------------------------------------------" + echo -e "${GREEN} Update Finished ${STD}" + echo "-----------------------------------------------------" + echo "" + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed01.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed02.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed03.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conff | grep -c "addnode=seed04.commercium.net") -eq 0 ]; then + echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf + fi + if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=explorer.commercium.net") -eq 0 ]; then + echo "addnode=explorer.commercium.net" >> /root/.commercium/commercium.conf + fi' +} + +read_options(){ + local choice + read -p "Enter choice [ 1 - 3] " choice + case $choice in + 1) Update="Update Masternode & Auto-update" + echo "" + echo -e "${GREEN} Choose Type of Update ${STD}" + PS3='Please enter your choice: ' + options=("Update Single Masternode" "Update Multi Masternode") + select opt in "${options[@]}" + do + case $opt in + "Update Single Masternode") + break + ;; + "Update Multi Masternode") + break + ;; + *) echo invalid option;; + esac + done + #### Commercium Single Node installation + if [ "$opt" == "Update Single Masternode" ]; then + Update_Masternode_And_Script_Single + else + #### Commercium Multi Node updatw + echo "" + echo -e "${BLUE} Start ${Update} ${STD}" + echo "" + read -p "Same SSH Port and Password for all vps's? (Y/N)" -n 1 -r + echo "" # (optional) move to a new line + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "" + echo -e "${GREEN} Enter Vps ip's ${STD}" + echo "" + sleep 2 + echo -e "Please enter your vps ip's: ${RED}(Exemple: 111.111.111.111-222.222.222.222-... ) ${STD}" + unset ip + while [ -z ${ip} ]; do + read -p "IP HERE: " ip + done + unset sshport + while [ -z ${sshport} ]; do + read -p "SSH Port: " sshport + done + unset rootpass + while [ -z ${rootpass} ]; do + read -s -p "Password: " rootpass + done + echo "" + vpsip=$(echo $ip | tr "-" " ") + apt-get update + yes | apt-get install sshpass + for ipserver in $vpsip + do + echo -e "${GREEN} Connexion Vps ip $ipserver ${STD}" + echo "" + Update_Masternode_And_Script_Multi + done + elif [[ $REPLY =~ ^[Nn]$ ]]; then + sleep 2 + echo -e "Please enter your vps's data: 'Host:Password:SSHPort' ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22-222.222.222.222:Wz65D232Fty:165-... )${STD}" + unset ip + while [ -z ${ip} ]; do + read -p "DATA HERE: " ip + done + apt-get update + yes | apt-get install sshpass + data=$(echo $ip | tr "-" " ") + for i in $data + do + vpsdata=$(echo $i | tr ":" "\n") + declare -a array=($vpsdata) + ipserver=${array[0]} + rootpass=${array[1]} + sshport=${array[2]} + if [ -z "$rootpass" ] || [ -z "$sshport" ] || [ -z "$ipserver" ] + then + echo -e "Please enter a correct vps's data ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22 222.222.222.222:Wz65D232Fty:165 ... )${STD}" + else + Update_Masternode_And_Script_Multi + fi + done + else + exit; + fi + fi + exit 0;; + + 2) Update="Update only Auto-update script" + echo "" + echo -e "${GREEN} Choose Type of Update ${STD}" + PS3='Please enter your choice: ' + options=("Update Single Masternode" "Update Multi Masternode") + select opt in "${options[@]}" + do + case $opt in + "Update Single Masternode") + break + ;; + "Update Multi Masternode") + break + ;; + *) echo invalid option;; + esac + done + #### Commercium Single Node installation + if [ "$opt" == "Update Single Masternode" ]; then + Update_Script_Single + else + echo "" + echo -e "${BLUE} Start ${Update} ${STD}" + echo "" + read -p "Same SSH Port and Password for all vps's? (Y/N)" -n 1 -r + echo "" # (optional) move to a new line + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "" + echo -e "${GREEN} Enter Vps ip's ${STD}" + echo "" + sleep 2 + echo -e "Please enter your vps ip's: ${RED}(Exemple: 111.111.111.111-222.222.222.222-... ) ${STD}" + unset ip + while [ -z ${ip} ]; do + read -p "IP HERE: " ip + done + unset sshport + while [ -z ${sshport} ]; do + read -p "SSH Port: " sshport + done + unset rootpass + while [ -z ${rootpass} ]; do + read -s -p "Password: " rootpass + done + echo "" + vpsip=$(echo $ip | tr "-" " ") + apt-get update + yes | apt-get install sshpass + for ipserver in $vpsip + do + echo -e "${GREEN} Connexion Vps ip $ipserver ${STD}" + echo "" + Update_Script_Multi + done + elif [[ $REPLY =~ ^[Nn]$ ]]; then + sleep 2 + echo -e "Please enter your vps's data: 'Host:Password:SSHPort' ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22-222.222.222.222:Wz65D232Fty:165-... )${STD}" + unset ip + while [ -z ${ip} ]; do + read -p "DATA HERE: " ip + done + apt-get update + yes | apt-get install sshpass + data=$(echo $ip | tr "-" " ") + for i in $data + do + vpsdata=$(echo $i | tr ":" "\n") + declare -a array=($vpsdata) + ipserver=${array[0]} + rootpass=${array[1]} + sshport=${array[2]} + if [ -z "$rootpass" ] || [ -z "$sshport" ] || [ -z "$ipserver" ] + then + echo -e "Please enter a correct vps's data ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22 222.222.222.222:Wz65D232Fty:165 ... )${STD}" + else + Update_Script_Multi + fi + done + else + exit; + fi + fi + exit 0;; + + + 3) exit 0;; + *) echo -e "${RED} Please choose the right choice... ${STD}" && sleep 2 + esac +} + +while true +do +show_menus +read_options +done From c384e6d0bb13e5295819543f320df98e5f8ca5ba Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 16:50:40 +0100 Subject: [PATCH 02/23] Create new --- Masternode/new | 1 + 1 file changed, 1 insertion(+) create mode 100644 Masternode/new diff --git a/Masternode/new b/Masternode/new new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Masternode/new @@ -0,0 +1 @@ + From aa445c2e1583163635c603a50c7f4f36ec77b655 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 16:52:00 +0100 Subject: [PATCH 03/23] Add files via upload --- Masternode/Check-scripts.sh | 18 ++++++++++++ Masternode/Update-scripts.sh | 13 +++++++++ Masternode/UpdateNode.sh | 53 ++++++++++++++++++++++++++++++++++++ Masternode/Version | 5 ++++ Masternode/blockcount | 1 + Masternode/clearlog.sh | 9 ++++++ Masternode/daemon_check.sh | 23 ++++++++++++++++ 7 files changed, 122 insertions(+) create mode 100644 Masternode/Check-scripts.sh create mode 100644 Masternode/Update-scripts.sh create mode 100644 Masternode/UpdateNode.sh create mode 100644 Masternode/Version create mode 100644 Masternode/blockcount create mode 100644 Masternode/clearlog.sh create mode 100644 Masternode/daemon_check.sh diff --git a/Masternode/Check-scripts.sh b/Masternode/Check-scripts.sh new file mode 100644 index 0000000..b4f7d0a --- /dev/null +++ b/Masternode/Check-scripts.sh @@ -0,0 +1,18 @@ + +#!/bin/bash +HOME=/root +LOGNAME=root +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +LANG=en_US.UTF-8 +SHELL=/bin/sh +PWD=/root +latestversion=$(curl --silent https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/') +localversion=$(cat /usr/local/bin/Masternode/Version | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/') +if [ -z "$latestversion" ] || [ "$latestversion" == "$localversion" ]; then +exit; +else +cd /usr/local/bin/Masternode +rm -f Update-scripts.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh +bash Update-scripts.sh +fi diff --git a/Masternode/Update-scripts.sh b/Masternode/Update-scripts.sh new file mode 100644 index 0000000..8a968d3 --- /dev/null +++ b/Masternode/Update-scripts.sh @@ -0,0 +1,13 @@ +#!/bin/bash +HOME=/root +LOGNAME=root +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +LANG=en_US.UTF-8 +SHELL=/bin/sh +PWD=/root +cd /usr/local/bin/Masternode +rm -f Version +rm -f UpdateNode.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh +wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version +chmod 755 UpdateNode.sh diff --git a/Masternode/UpdateNode.sh b/Masternode/UpdateNode.sh new file mode 100644 index 0000000..00bcb72 --- /dev/null +++ b/Masternode/UpdateNode.sh @@ -0,0 +1,53 @@ +#!/bin/bash +HOME=/root +LOGNAME=root +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +LANG=en_US.UTF-8 +SHELL=/bin/sh +PWD=/root +LOGFILE='/usr/local/bin/Masternode/update.log' +dt=`date '+%d/%m/%Y %H:%M:%S'` +latestrelease=$(curl --silent https://api.github.com/repos/CommerciumBlockchain/CommerciumContinuum/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') +localrelease=$(commercium-cli -version | awk -F' ' '{print $NF}' | cut -d "-" -f1) +if [ -z "$latestrelease" ] || [ "$latestrelease" == "$localrelease" ]; then +echo >> $LOGFILE +echo "[$dt] ==============================================================" >> $LOGFILE +echo "[$dt]==> Info: There is no New Update latest release is $latestrelease" >> $LOGFILE +echo "[$dt] ==============================================================" >> $LOGFILE +exit; +else +echo >> $LOGFILE +echo "[$dt] ==============================================================" >> $LOGFILE +echo "[$dt]==> Info: Starting Update 3DCoin core to $latestrelease" >> $LOGFILE +echo "[$dt] ==============================================================" >> $LOGFILE +cd ~ +localfile=${localrelease//[Vv]/CommerciumContinuum-} +echo "[$dt]==> Info: Remove file $localfile" >> $LOGFILE +rm -rf $localfile +link="https://github.com/CommerciumBlockchain/CommerciumContinuum/archive/$latestrelease.tar.gz" +echo "[$dt]==> Info: Download Last Update $link" >> $LOGFILE +wget $link || { echo "[$dt]==> Error: When Download $link" >> $LOGFILE && exit; } +echo "[$dt]==> Info: Extract $latestrelease.tar.gz" >> $LOGFILE +tar -xvzf $latestrelease.tar.gz || { echo "[$dt]==> Error: When Extracting $latestrelease.tar.gz" >> $LOGFILE && exit; } +file=${latestrelease//[Vv]/Commercium-Continuum-} +cd $file || { echo "[$dt]==> Error: File $file not found" >> $LOGFILE && exit; } +echo "[$dt]==> Info: Start Compiling Commercium core $latestrelease" >> $LOGFILE +./zcutil/fetch-params.sh || { echo "[$dt]==> Error: When Compiling Commerciumn core" >> $LOGFILE && exit; } +echo "[$dt]==> Info: Stop Commercium core $localrelease" >> $LOGFILE +commercium-cli stop +sleep 10 +echo "[$dt]==> Info: Make install " >> $LOGFILE +./zcutil/build.sh || { echo "[$dt]==> Error: When make install" >> $LOGFILE && exit && commerciumd; } +cd ~ +cp $file/src/commerciumd /usr/local/bin +cp $file/src/commercium-cli /usr/local/bin +cp $file/src/commercium-tx /usr/local/bin +cp $file/src/commercium-gtest /usr/local/bin +echo "[$dt]==> Info: Remove $latestrelease.tar.gz" >> $LOGFILE +rm $latestrelease.tar.gz +echo "[$dt]==> Info: Remove $file" >> $LOGFILE +rm -rf $file +echo "[$dt]==> Info: Rebooting " >> $LOGFILE +echo "[$dt] ==============================================================" >> $LOGFILE +reboot +fi diff --git a/Masternode/Version b/Masternode/Version new file mode 100644 index 0000000..9827bd9 --- /dev/null +++ b/Masternode/Version @@ -0,0 +1,5 @@ +{ + "name": "Masternode Commercium", + "version": "1.0.1", + "description": "Bash install & update Masternode Commercium on Ubuntu 16.04 LTS x64" +} diff --git a/Masternode/blockcount b/Masternode/blockcount new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Masternode/blockcount @@ -0,0 +1 @@ + diff --git a/Masternode/clearlog.sh b/Masternode/clearlog.sh new file mode 100644 index 0000000..a2a01df --- /dev/null +++ b/Masternode/clearlog.sh @@ -0,0 +1,9 @@ +#!/bin/bash +HOME=/root +LOGNAME=root +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +LANG=en_US.UTF-8 +SHELL=/bin/sh +PWD=/root + +/bin/date > ~/.commercium/debug.log diff --git a/Masternode/daemon_check.sh b/Masternode/daemon_check.sh new file mode 100644 index 0000000..e4c62c8 --- /dev/null +++ b/Masternode/daemon_check.sh @@ -0,0 +1,23 @@ +#!/bin/bash +HOME=/root +LOGNAME=root +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +LANG=en_US.UTF-8 +SHELL=/bin/sh +PWD=/root + +previousBlock=$(cat /usr/local/bin/Masternode/blockcount) +currentBlock=$(commercium-cli getblockcount) + +commercium-cli getblockcount > /usr/local/bin/Masternode/blockcount + +if [ "$previousBlock" == "$currentBlock" ]; then + commercium-cli stop + sleep 60 + rm -f /root/.Commercium/banlist.dat + rm -f /root/.Commercium/mncache.dat + rm -f /root/.Commercium/mnpayments.dat + rm -f /root/.Commercium/netfulfilled.dat + rm -f /root/.Commercium/debug.log + commerciumd -reindex +fi From 9e3082d947563a4d658a48bf25832f1a04237dd8 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:03:49 +0100 Subject: [PATCH 04/23] Delete update.sh --- update.sh | 517 ------------------------------------------------------ 1 file changed, 517 deletions(-) delete mode 100644 update.sh diff --git a/update.sh b/update.sh deleted file mode 100644 index 4435b84..0000000 --- a/update.sh +++ /dev/null @@ -1,517 +0,0 @@ -#!/bin/bash -##################################################################################### -# Update Commercium Core # -##################################################################################### -RED='\033[0;97;41m' -STD='\033[0;0;39m' -GREEN='\e[1;97;42m' -BLUE='\e[1;97;44m' - -show_menus() { - clear - echo "" - echo -e "${BLUE} U P D A T E C O M M E R C I U M M A S T E R N O D E ${STD}" - echo "" - echo "1. Update Masternode & Auto-update script" - echo "2. Update only Auto-update script" - echo "3. Exit" - echo "" - echo -e "\e[1;97;41m Note!!: Update Commercium Core & Update for Auto-update ${STD}" - echo "" -} - -Update_Masternode_And_Script_Single() { - echo "" - h=$(( RANDOM % 23 + 1 )); - echo -e "${BLUE} Start ${Update} ${STD}" - rm -f /usr/local/bin/check.sh - rm -f /usr/local/bin/update.sh - rm -f /usr/local/bin/UpdateNode.sh - rm -rf /usr/local/bin/Masternode - echo "" - cd ~ - echo -e "${GREEN} Get latest release ${STD}" - latestrelease=$(curl --silent 'https://api.github.com/repos/CommerciumBlockchain/CommerciumContinuum/releases/latest' | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') - link="https://github.com/CommerciumBlockchain/CommerciumContinuum/archive/$latestrelease.tar.gz" - wget $link - tar -xvzf $latestrelease.tar.gz - file=${latestrelease//[Vv]/CommerciumContinuum-} - echo "" - echo -e "${GREEN} Stop Cron ${STD}" - sudo /etc/init.d/cron stop - echo "" - echo -e "${GREEN} Compiling Commercium core ${STD}" - cd $file - echo -e "${GREEN} Stop Commercium core ${STD}" - echo "" - commercium-cli stop - sleep 10 - echo -e "${GREEN} Make install ${STD}" - echo "" - ./zcutil/fetch-params.sh - ./zcutil/build.sh - cd ~ - cp $file/src/commerciumd /usr/local/bin - cp $file/src/commercium-cli /usr/local/bin - cp $file/src/commercium-tx /usr/local/bin - cp $file/src/commercium-gtest /usr/local/bin - echo "" - echo -e "${GREEN} Update crontab ${STD}" - cd ~ - cd /usr/local/bin - mkdir Masternode - cd Masternode - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount - chmod 755 daemon_check.sh - chmod 755 UpdateNode.sh - chmod 755 Check-scripts.sh - chmod 755 Update-scripts.sh - chmod 755 clearlog.sh - cd ~ - crontab -r - line="@reboot /usr/local/bin/commerciumd -0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh -*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh -0 $h * * * /usr/local/bin/Masternode/UpdateNode.sh -* * */2 * * /usr/local/bin/Masternode/clearlog.sh" - echo "$line" | crontab -u root - - echo "Crontab updated successfully" - echo "" - echo -e "${GREEN} Start Cron ${STD}" - sudo /etc/init.d/cron start - echo "" - echo -e "${GREEN} Update Finished,rebooting server ${STD}" - cd ~ - rm $latestrelease.tar.gz - rm -rf $file - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed01.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed02.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed03.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed04.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=explorer.commercium.net") -eq 0 ]; then - echo "addnode=explorer.commercium.net" >> /root/.commercium/commercium.conf - fi - reboot -} -Update_Masternode_And_Script_Multi() { - sshpass -p $rootpass ssh -p$sshport -o StrictHostKeyChecking=no root@$ipserver ' - h=$(( RANDOM % 23 + 1 )); - rm -f /usr/local/bin/check.sh - rm -f /usr/local/bin/update.sh - rm -f /usr/local/bin/UpdateNode.sh - rm -rf /usr/local/bin/Masternode - cd ~ - echo "-----------------------------------------------------" - echo -e "${GREEN} Git checkout master ${STD}" - echo "-----------------------------------------------------" - latestrelease=$(curl --silent https://api.github.com/repos/CommerciumBlockchain/CommerciumContinuum/releases/latest | grep '"'"\\$"\"tag_name"\\$"\":'"' | sed -E '"'s/.*"\\$"\"([^"\\$"\"]+)"\\$"\".*/\1/'"') -link="https://github.com/CommerciumBlockchain/CommerciumContinuum/archive/$latestrelease.tar.gz" -wget $link -tar -xvzf $latestrelease.tar.gz - file=${latestrelease//[Vv]/CommerciumContinuum-} - echo "" - echo "-----------------------------------------------------" - echo -e "${GREEN} Stop Cron ${STD}" - echo "-----------------------------------------------------" - sudo /etc/init.d/cron stop - echo "" - echo "-----------------------------------------------------" - echo -e "${GREEN} Compiling Commercium core ${STD}" - echo "-----------------------------------------------------" - cd $file - echo "" - echo "-----------------------------------------------------" - echo -e "${GREEN} Stop 3Dcoin core ${STD}" - echo "-----------------------------------------------------" - commercium-cli stop - sleep 10 - echo "" - echo "-----------------------------------------------------" - echo -e "${GREEN} Make install ${STD}" - echo "-----------------------------------------------------" - ./zcutil/fetch-params.sh - ./zcutil/build.sh - cd ~ - cp $file/src/commerciumd /usr/local/bin - cp $file/src/commercium-cli /usr/local/bin - cp $file/src/commercium-tx /usr/local/bin - cp $file/src/commercium-gtest /usr/local/bin - echo "" - echo "-----------------------------------------------------" - echo -e "${GREEN} Update crontab ${STD}" - echo "-----------------------------------------------------" - cd ~ - cd /usr/local/bin - mkdir Masternode - cd Masternode - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount - chmod 755 daemon_check.sh - chmod 755 UpdateNode.sh - chmod 755 Check-scripts.sh - chmod 755 Update-scripts.sh - chmod 755 clearlog.sh - cd ~ - crontab -r - line="@reboot /usr/local/bin/commerciumd -0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh -0 $h * * * /usr/local/bin/Masternode/UpdateNode.sh -*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh -* * */2 * * /usr/local/bin/Masternode/clearlog.sh" - echo "$line" | crontab -u root - - echo "Crontab updated successfully" - echo "" - echo "-----------------------------------------------------" - echo -e "${GREEN} Update Finished,rebooting server ${STD}" - echo "-----------------------------------------------------" - cd ~ - rm $latestrelease.tar.gz - rm -rf $file - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed01.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed02.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed03.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed04.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=explorer.commercium.net") -eq 0 ]; then - echo "addnode=explorer.commercium.net" >> /root/.commercium/commercium.conf - fi - reboot' -} - -Update_Script_Single() { - echo "" - h=$(( RANDOM % 23 + 1 )); - echo -e "${BLUE} Start ${Update} ${STD}" - rm -f /usr/local/bin/check.sh - rm -f /usr/local/bin/update.sh - rm -f /usr/local/bin/UpdateNode.sh - rm -rf /usr/local/bin/Masternode - echo "" - cd ~ - echo -e "${GREEN} Stop Cron ${STD}" - sudo /etc/init.d/cron stop - echo "" - echo -e "${GREEN} Update crontab ${STD}" - cd ~ - cd /usr/local/bin - mkdir Masternode - cd Masternode - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount - chmod 755 daemon_check.sh - chmod 755 UpdateNode.sh - chmod 755 Check-scripts.sh - chmod 755 Update-scripts.sh - chmod 755 clearlog.sh - cd ~ - crontab -r - line="@reboot /usr/local/bin/commerciumd -0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh -*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh -0 $h * * * /usr/local/bin/Masternode/UpdateNode.sh -* * */2 * * /usr/local/bin/Masternode/clearlog.sh" - echo "$line" | crontab -u root - - echo "Crontab updated successfully" - echo "" - echo -e "${GREEN} Start Cron ${STD}" - sudo /etc/init.d/cron start - echo "" - echo -e "${GREEN} Update Finished ${STD}" - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed01.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed02.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed03.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conff | grep -c "addnode=seed04.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=explorer.commercium.net") -eq 0 ]; then - echo "addnode=explorer.commercium.net" >> /root/.commercium/commercium.conf - fi - echo "" -} - -Update_Script_Multi() { - sshpass -p $rootpass ssh -p$sshport -o StrictHostKeyChecking=no root@$ipserver ' - h=$(( RANDOM % 23 + 1 )); - rm -f /usr/local/bin/check.sh - rm -f /usr/local/bin/update.sh - rm -f /usr/local/bin/UpdateNode.sh - rm -rf /usr/local/bin/Masternode - cd ~ - echo "" - echo "-----------------------------------------------------" - echo -e "${GREEN} Stop Cron ${STD}" - echo "-----------------------------------------------------" - sudo /etc/init.d/cron stop - echo "" - echo "-----------------------------------------------------" - echo -e "${GREEN} Update crontab ${STD}" - echo "-----------------------------------------------------" - cd ~ - cd /usr/local/bin - mkdir Masternode - cd Masternode - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version - wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount - chmod 755 daemon_check.sh - chmod 755 UpdateNode.sh - chmod 755 Check-scripts.sh - chmod 755 Update-scripts.sh - chmod 755 clearlog.sh - cd ~ - crontab -r - line="@reboot /usr/local/bin/commerciumd -0 0 * * * /usr/local/bin/Masternode/Check-scripts.sh -*/10 * * * * /usr/local/bin/Masternode/daemon_check.sh -0 $h * * * /usr/local/bin/Masternode/UpdateNode.sh -* * */2 * * /usr/local/bin/Masternode/clearlog.sh" - echo "$line" | crontab -u root - - echo "Crontab updated successfully" - sudo /etc/init.d/cron start - echo "" - echo "-----------------------------------------------------" - echo -e "${GREEN} Update Finished ${STD}" - echo "-----------------------------------------------------" - echo "" - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed01.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed02.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=seed03.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conff | grep -c "addnode=seed04.commercium.net") -eq 0 ]; then - echo "addnode=seed01.commercium.net" >> /root/.commercium/commercium.conf - fi - if [ $(cat /root/.commercium/commercium.conf | grep -c "addnode=explorer.commercium.net") -eq 0 ]; then - echo "addnode=explorer.commercium.net" >> /root/.commercium/commercium.conf - fi' -} - -read_options(){ - local choice - read -p "Enter choice [ 1 - 3] " choice - case $choice in - 1) Update="Update Masternode & Auto-update" - echo "" - echo -e "${GREEN} Choose Type of Update ${STD}" - PS3='Please enter your choice: ' - options=("Update Single Masternode" "Update Multi Masternode") - select opt in "${options[@]}" - do - case $opt in - "Update Single Masternode") - break - ;; - "Update Multi Masternode") - break - ;; - *) echo invalid option;; - esac - done - #### Commercium Single Node installation - if [ "$opt" == "Update Single Masternode" ]; then - Update_Masternode_And_Script_Single - else - #### Commercium Multi Node updatw - echo "" - echo -e "${BLUE} Start ${Update} ${STD}" - echo "" - read -p "Same SSH Port and Password for all vps's? (Y/N)" -n 1 -r - echo "" # (optional) move to a new line - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "" - echo -e "${GREEN} Enter Vps ip's ${STD}" - echo "" - sleep 2 - echo -e "Please enter your vps ip's: ${RED}(Exemple: 111.111.111.111-222.222.222.222-... ) ${STD}" - unset ip - while [ -z ${ip} ]; do - read -p "IP HERE: " ip - done - unset sshport - while [ -z ${sshport} ]; do - read -p "SSH Port: " sshport - done - unset rootpass - while [ -z ${rootpass} ]; do - read -s -p "Password: " rootpass - done - echo "" - vpsip=$(echo $ip | tr "-" " ") - apt-get update - yes | apt-get install sshpass - for ipserver in $vpsip - do - echo -e "${GREEN} Connexion Vps ip $ipserver ${STD}" - echo "" - Update_Masternode_And_Script_Multi - done - elif [[ $REPLY =~ ^[Nn]$ ]]; then - sleep 2 - echo -e "Please enter your vps's data: 'Host:Password:SSHPort' ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22-222.222.222.222:Wz65D232Fty:165-... )${STD}" - unset ip - while [ -z ${ip} ]; do - read -p "DATA HERE: " ip - done - apt-get update - yes | apt-get install sshpass - data=$(echo $ip | tr "-" " ") - for i in $data - do - vpsdata=$(echo $i | tr ":" "\n") - declare -a array=($vpsdata) - ipserver=${array[0]} - rootpass=${array[1]} - sshport=${array[2]} - if [ -z "$rootpass" ] || [ -z "$sshport" ] || [ -z "$ipserver" ] - then - echo -e "Please enter a correct vps's data ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22 222.222.222.222:Wz65D232Fty:165 ... )${STD}" - else - Update_Masternode_And_Script_Multi - fi - done - else - exit; - fi - fi - exit 0;; - - 2) Update="Update only Auto-update script" - echo "" - echo -e "${GREEN} Choose Type of Update ${STD}" - PS3='Please enter your choice: ' - options=("Update Single Masternode" "Update Multi Masternode") - select opt in "${options[@]}" - do - case $opt in - "Update Single Masternode") - break - ;; - "Update Multi Masternode") - break - ;; - *) echo invalid option;; - esac - done - #### Commercium Single Node installation - if [ "$opt" == "Update Single Masternode" ]; then - Update_Script_Single - else - echo "" - echo -e "${BLUE} Start ${Update} ${STD}" - echo "" - read -p "Same SSH Port and Password for all vps's? (Y/N)" -n 1 -r - echo "" # (optional) move to a new line - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "" - echo -e "${GREEN} Enter Vps ip's ${STD}" - echo "" - sleep 2 - echo -e "Please enter your vps ip's: ${RED}(Exemple: 111.111.111.111-222.222.222.222-... ) ${STD}" - unset ip - while [ -z ${ip} ]; do - read -p "IP HERE: " ip - done - unset sshport - while [ -z ${sshport} ]; do - read -p "SSH Port: " sshport - done - unset rootpass - while [ -z ${rootpass} ]; do - read -s -p "Password: " rootpass - done - echo "" - vpsip=$(echo $ip | tr "-" " ") - apt-get update - yes | apt-get install sshpass - for ipserver in $vpsip - do - echo -e "${GREEN} Connexion Vps ip $ipserver ${STD}" - echo "" - Update_Script_Multi - done - elif [[ $REPLY =~ ^[Nn]$ ]]; then - sleep 2 - echo -e "Please enter your vps's data: 'Host:Password:SSHPort' ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22-222.222.222.222:Wz65D232Fty:165-... )${STD}" - unset ip - while [ -z ${ip} ]; do - read -p "DATA HERE: " ip - done - apt-get update - yes | apt-get install sshpass - data=$(echo $ip | tr "-" " ") - for i in $data - do - vpsdata=$(echo $i | tr ":" "\n") - declare -a array=($vpsdata) - ipserver=${array[0]} - rootpass=${array[1]} - sshport=${array[2]} - if [ -z "$rootpass" ] || [ -z "$sshport" ] || [ -z "$ipserver" ] - then - echo -e "Please enter a correct vps's data ${RED}( Exemple: 111.111.111.111:ERdX5h64dSer:22 222.222.222.222:Wz65D232Fty:165 ... )${STD}" - else - Update_Script_Multi - fi - done - else - exit; - fi - fi - exit 0;; - - - 3) exit 0;; - *) echo -e "${RED} Please choose the right choice... ${STD}" && sleep 2 - esac -} - -while true -do -show_menus -read_options -done From d2adf8f1ef2b7ccab7d6c1c2f77433df403d0230 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:11:25 +0100 Subject: [PATCH 05/23] Version 1.0.1 --- install.sh | 48 ++++++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/install.sh b/install.sh index b5bf855..61ab068 100644 --- a/install.sh +++ b/install.sh @@ -194,14 +194,8 @@ file=${latestrelease//[v]/CommerciumContinuum-} yes | sudo apt-get update export LC_ALL=en_US.UTF-8 yes | sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl -yes | sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev -yes | sudo apt-get install software-properties-common -yes | sudo add-apt-repository ppa:bitcoin/bitcoin -yes | sudo apt-get update -yes | sudo apt-get install libdb4.8-dev libdb4.8++-dev -yes | sudo apt-get install libminiupnpc-dev -yes | sudo apt-get install libzmq3-dev yes | sudo apt-get install libgomp1 +yes | sudo apt-get update sleep 2 echo "" echo -e "${GREEN} Compile Commercium core ..... ${STD}" @@ -224,13 +218,13 @@ cd ~ cd /usr/local/bin mkdir Masternode cd Masternode -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Check-scripts.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/Check-scripts.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/Masternode/Update-scripts.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/Masternode/UpdateNode.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/Masternode/clearlog.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/Masternode/daemon_check.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/Masternode/Version +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/Masternode/blockcount chmod 755 daemon_check.sh chmod 755 UpdateNode.sh chmod 755 Check-scripts.sh @@ -286,15 +280,9 @@ sleep 4 cd ~ yes | sudo apt-get update export LC_ALL=en_US.UTF-8 -yes | sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl -yes | sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev -yes | sudo apt-get install software-properties-common -yes | sudo add-apt-repository ppa:bitcoin/bitcoin -yes | sudo apt-get update -yes | sudo apt-get install libdb4.8-dev libdb4.8++-dev -yes | sudo apt-get install libminiupnpc-dev -yes | sudo apt-get install libzmq3-dev -yes | sudo apt-get install libgomp1 +yes | sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl +yes | sudo apt-get install libgomp1 +yes | sudo apt-get update sleep 2 latestrelease=\$(curl --silent https://api.github.com/repos/CommerciumBlockchain/CommerciumContinuum/releases/latest | grep '"'"\\$"\"tag_name"\\$"\":'"' | sed -E '"'s/.*"\\$"\"([^"\\$"\"]+)"\\$"\".*/\1/'"') link=\"https://github.com/CommerciumBlockchain/CommerciumContinuum/archive/$latestrelease.tar.gz\" @@ -316,13 +304,13 @@ cd ~ cd /usr/local/bin mkdir Masternode cd Masternode -wget https://raw.githubusercontent.com/PostJoke/masternod/master/Masternode/Check-scripts.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/clearlog.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/daemon_check.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/blockcount +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/Check-scripts.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/Update-scripts.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/UpdateNode.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/clearlog.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/daemon_check.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/Version +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/blockcount chmod 755 daemon_check.sh chmod 755 UpdateNode.sh chmod 755 Check-scripts.sh From fa018883ce93c86cdb19cfdcd6bcf32b7165a65b Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:23:38 +0100 Subject: [PATCH 06/23] Version 1.0.1 --- README.md | 352 +++++------------------------------------------------- 1 file changed, 29 insertions(+), 323 deletions(-) diff --git a/README.md b/README.md index f881717..a281fc2 100644 --- a/README.md +++ b/README.md @@ -1,345 +1,51 @@ # Commercium Masternode Setup -A step by step guide howto setup your Commercium Masternode on Windows/Linux/MacOS local wallet & Linux VPS as remote MN. +A step by step guide how to setup your Commercium Masternode on Windows/Linux/MacOS local wallet & Linux VPS as remote MN. +# Install script 1 # -You also can run your masternode at your own computer, but it must be operational 24/7 and have a dedicated IP address. When you run your masternode your funds are safe and stored at your local wallet, not at the VPS (linux machine most cases). +Install script 1 /part2_linux_vps_setup.sh/ will install the precompiled Commercium daemon +Visit +https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-da7361c2e47a for Windows guide +https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-in-linux-14d42e536dfb for Linux guide -## Requirements: +# Install script 2 # -- 100000 CMM + 0.001 CMM to pay transaction fees -- VPS with at least 1024 RAM, 1 CPU, >20 GB HDD or more -- Commercium wallet at local Windows/Linux/MacOs PC and VPS -- VPS: better to use latest ubunty (18.04). If you run 16.04 just install: `apt-get install libgomp1` -- `putty` remote shell client (putty.org) +Install script 2 /install.sh/ will install the Commercium daemon with all dependencies from the source code -## Masternode info +## Features: ## -Masternode reward is completely random. One masternode out of -total MN numbers are picked at random. There is no seniority, no weighting, just -random. So each minute you have a one in (total MN) chance of getting the -reward. +- Auto update to newer versions +- Auto daemon-check and restart if stuck +- Log file clearing +- Auto script check +- Runs commerciumd on startup +- Single/Multi MN install -- 1440 * 8 = 11,520 CMM mined per day -- 1440 * 5.0 = 7,200 goes to miners -- 1440 * 2.4 = **3,456** goes to all masternodes -- 1440 * 0.6 = 864 goes to founders fund +> **This shell script has 4 cronjobs:** +1. [Check-scripts.sh](https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/Masternode/Check-scripts.sh) +2. [daemon_check.sh](https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/Masternode/daemon_check.sh) +3. [clearlog.sh](https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/Masternode/clearlog.sh) +4. [UpdateNode.sh](https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/Masternode/UpdateNode.sh) -# PART 1: Local machine setup +As this script must be run as Root, make sure to secure your VPS with additional security measurements. -### Fresh wallet installation: +> **Version 1.0.1:** -#### 1. Install latest Commercium wallet at your local machine from this link: - -https://github.com/CommerciumBlockchain/CommerciumContinuum/releases - -Follow this video instructions for help: - -https://youtu.be/AQMogS3Enjs (Windows) - -https://youtu.be/xuLRBuvaSgU (MacOS) - - -##### Upgrade old wallet - -If you are already have old Commercium wallet then backup your data and export your private keys. You will import them later to new wallet: - -_Video instruction about how to migrate to new Commercium wallet:_ `https://youtu.be/xuLRBuvaSgU?t=166` - -Buckup `~/.commercium` - directory for MacOs/Linux - -Windows users (use command shell `cmd.exe`). - -Press `Win+r` -> write `cmd` -> press Enter -> copy&paste this commands into the shell: - -``` -move %APPDATA%/ZcashParams %APPDATA%/ZcashParams.backup -move %APPDATA%/Commercium %APPDATA%/Commercium.backup -``` - - -#### 2. We must edit our local wallet configuration file `commercium.conf`.You can find `commercium.conf` here: - -- Linux: `~/.commercium` directory -- Windows: `%appdata%/Commercium` folder -- MAC: `~/Library/Application Support/Commercium` - -Open your shell. _How to do this described at previous step under "Upgrade old wallet"._ Enter this commands at Windows shell: - -``` -cd %appdata%/Commercium -notepad commercium.conf -or better alternative: -open `commercium.conf` for editing with other editor. -I suggest to edit it with external editor like Notepad++, -because the default notepad on Windows 7 -did not recognize and break unix wrapping at this file. -``` - -Append this new line to the end of the file (`commercium.conf`): - -`txindex=1` - -Save & Close editor. - -#### 3. Exit windows wallet. Next we will do a full blockchain rescan to create transaction index. - -Run this command at Windows shell: `commerciumd.exe -reindex` - -Linux shell: `./commercium -reindex` - -**OR ALTERNATIVE:** - -Windows: - -``` -del %APPDATA%\Commercium\peers.dat -del %APPDATA%\Commercium\budget.dat -del %APPDATA%\Commercium\mn*.dat -del %APPDATA%\Commercium\sporks /Q -del %APPDATA%\Commercium\chainstate /Q -del %APPDATA%\Commercium\blocks /Q -del %APPDATA%\Commercium\blocks\index /Q -del %APPDATA%\Commercium\database /Q -``` - -Linux: - -``` -rm -rf ~/.commercium/blocks -rm -rf ~/.commercium/database -rm -rf ~/.commercium/chainstate -rm -rf ~/.commercium/sporks -rm ~/.commercium/mn*.dat -rm ~/.commercium/budget.dat -rm ~/.commercium/peers.dat -``` - -MacOSX: - -``` -rm -rf Library/Application\ Support/Commercium/blocks -rm -rf Library/Application\ Support/Commercium/database -rm -rf Library/Application\ Support/Commercium/chainstate -rm -rf Library/Application\ Support/Commercium/sporks -rm Library/Application\ Support/Commercium/mn*.dat -rm Library/Application\ Support/Commercium/budget.dat -rm Library/Application\ Support/Commercium/peers.dat -``` - -Run new wallet release and wait until all block will be resynced. At QT Windows wallet check the tap "commerciumd" and wait until "Downloading blocks" will be 100% done. If you run `-reindex` at command line shell then close your `cmd` shell and run QT wallet. - -#### 4. At this step we will send your CMM masternode coins to some new collateral address (you'll receive masternode reward to this address). - -Create new `t-Addr`. You can do this at "Receive" tab. Then send coins to this address from "send" tab. - -Transfer _exactly_ 100000 CMM to this address. - -**WARNING:** save new private key for this new address and make `wallet.dat` backup now! - - -#### 5. Then need to edit masternode config file to setup masternode: - -Open `masternode.conf` for editing as you do it before with other config file. - -``` -Format: alias IP:port masternodeprivkey(NODEKEY) collateral_output_txid(OUTPUTTXID) collateral_output_index(OUTPUTINDEX) -# Example: mn1 127.0.0.2:51474 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0 -``` - -As you see above to setup masternode we must have the following data: - -* **ALIAS** - masternode alias -* **IP** - VPS IP -* **PORT** - always the same 2019 -* **NODEKEY** - masternode private key (looks like generated numbers and charts) -* **OUTPUTTXID** - collateral output txid -* **OUTPUTINDEX** - collateral output index (is usually `0`) - - - -#### 6. Bellow is where all this requested information comes from: - - -##### 6.1 Generating **NODEKEY** masternode private key. Run this at _local_ wallet where you store your coins: - -`commercium-cli.exe masternode genkey ` - -Output of this command is your Masternode Private Key (**NODEKEY**) - -##### 6.2 **OUTPUTTXID** and **OUTPUTINDEX** - -`commercium-cli.exe masternode outputs` - -show "txhash" and "outputidx". txhash is your **OUTPUTTXID** / outputid is **OUTPUTINDEX** - -##### 6.3 Now you are ready to add all this information to `masternode.conf`. - -Format: `ALIAS IP:2019 NODEKEY OUTPUTTXID OUTPUTINDEX` (separated with spaces, only IP and PORT separated with `:`) - -##### 6.4 Save your `masternode.conf` changes. - - - - - - - -# PART 2 (VPS Setup) - -All local wallet configuration done. Now, we will setup VPS commercium wallet. - -### Masternode setup process (VPS): - -Connect with `Putty` to your VPS. Just enter IP address of your VPS at the Putty windows and login with your VPS username/password. - -If you need video instruction check this video: https://youtu.be/vVVhtQ5Wd3g - -![Putty Connect](https://i1.wp.com/www.codingepiphany.com/wp-content/uploads/2014/04/putty_initial_connection.png?resize=466%2C446) - -After connection enter your username and password then you will see linux shell. - -#### _0. (not neccessory step). Run as regular user not root. - -For securety purposes you can run your masternode as regular linux user, not `root`. If you want this then create new user `adduser cmmuser` (run as root) and then connect to your VPS with Putty again and login with this new user login and password._ - -#### Automatic VPS setup script: - -If you do not want to follow **part 2. Vps install mannualy** you can use our automatic VPS setup script `part2_linux_vps_setup.sh`: - -``` -wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/part2_linux_vps_setup.sh -chmod +x part2_linux_vps_setup.sh -./part2_linux_vps_setup.sh -``` - -###### Troubles and notes about this script - -- You can use it to install your commercium daemon as user (not root) for better securety. -- Because of this you must install dependences manually as root with following command: `sudo apt-get install wget nano libgomp1 -y` or check that your system has this packages. -- If you choose this automatic method, then skip 1-3 steps and go to __step 4__ below to activate your masternode and you are done! - - - -#### 1. Enter this commands at linux shell: - -`cd ~` _(to be sure that you are at user home directory)_ - -It will download archive with commercium to current directory. - -`wget https://github.com/CommerciumBlockchain/CommerciumContinuum/releases/download/v1.0.5/commercium_continuum-v1.0.5-linux.tar.gz` - -_Hint: You can check available files at the current directory with `ls` command to check that `commercium_continuum-v1.0.5-linux.tar.gz` is here! _ - -#### 2. Extract files with following commands: - -`tar -xzvf commercium_continuum-v1.0.5-linux.tar.gz` - -_Note: It will extract all commercium files to `commercium_continuum-v1.0.5-linux` directory_ - -#### 3. Make directiry for configuration files and database: - -`mkdir .commercium` - -And then we will create `commercium.conf`: - -`echo -e "txindex=1\ndaemon=1\nrpcuser=CHANGEthisPASSWORD]\nrpcpassword=CHANGEthisPASSWORD\nmasternode=1\nmasternodeprivkey=NODEKEY" > .commercium/commercium.conf` - -or create new config file at `.commercium` directory with the following command: - -`nano ~/.commercium/commercium.conf` - -add following: +Login to your vps as root, download and run the install.sh file using this command: ``` -txindex=1 -daemon=1 -rpcuser=[RANDOM USERNAME] -rpcpassword=[[RANDOM PASSWORD] -masternode=1 -masternodeprivkey=[NODEKEY] +curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/install.sh > install.sh +bash install.sh ``` -Hint: to paste text at `nano` you can use `ctrl+shift+v`, or `middle mouse click`, or `shift+insert` - -`NODEKEY` - is the key from previous part (6.1) - -`PASSWORD` - random password. Use at least 10 charts secure password. - -`[]` -- must be also removed. - - -**NOW YOU MASTERNODE IS READY TO START!** - -#### 4. Masternode Activation - -on local wallet windows `cmd` shell: `commercium-cli.exe startmasternode all missing` alternative command: `commercium-cli.exe startalias MASTERNODEALIAS` - - -Success start example output: -``` -{ - "overall": "Successfully started 1 masternodes, failed to start 0, total 1", - "detail": [ - { - "alias": "mn1", - "result": "success", - "error": "" - } - ] -} -``` - -on vps `./commercium-cli masternode debug` must display "Masternode successfully started." if not, wait 20 minutes and start the masternode again using the command above. - -To activate a masternode the local wallet and masternode must have the masternode list synced -`./commercium-cli mnsync status` to check it. - -There are 2 sync; one is blockchain and one is masternode. In some cases need to wait for full sync ~30 mins. +### Bash Checker for Masternodes on Ubuntu 16.04 LTS x64 -If you have troubles with syncing (it stop syncking) then it's possible to resync: Part 1) 3. - -#### 5. How to add commercium daemon to start automatically after VPS reboot - -Create new file `nano cmmstartup.sh` -with following text: +------ ``` -#!/bin/sh -cd ~/commercium_continuum-v1.0.5-linux -./commerciumd +curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/check-masternode.sh > check-masternode.sh +bash check-masternode.sh ``` -then -`chmod +x cmmstartup.sh` - -`crontab -e` - -add this line to the bottom: -`@reboot bash ~/cmmstartup.sh` - -To test it just reboot your vps. - - -#### Securety tips: - -If you want to secure your vps with firewall rules just remember to keep port 2019 open. -Secure vps tips: https://www.eurovps.com/blog/20-ways-to-secure-linux-vps/ - -#### Masternode reward. - - -You can leave your MN rewards in the MN address for as long as you want. But before you can move your reward coins anyway all MN rewards must be **shielded** by sending to a transparent Z address. Its called shielding. Its because the MN rewards were mined. The rule is that all mined coins must be shielded before they can be sent to a transparent C address. - -Just copy the z_addr. Go to balances and right click the address with the masternode collateral which shouldn’t show the balance of 100,000 which is used for the masternode. Then click send from, then paste the z_addr and click send maximum or input the amount and click send. Shielding is sending from a t-addr (transparent address, which for Commercium starts with C) to a z_addr starting with a z. - -The coins generated from a masternode can only be shielded after 100 confirmations. Bacause of that block explorer can show difference between the balance on MN address in the explorer and in the qt wallet. - -What happens if someone doesn't shield those coins and just tries to send them to another T-address? Nothing ;) You would simply get an error and no transaction would happen. - - -#### Usefull links - -- http://master.cmm.coininsta.com/ - network masternode list -- https://mntrend.com/en/currencies/CMM - ms stats, profitability From f9ae8e77a0ce3a044de3885f20996df14e8754b1 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:26:11 +0100 Subject: [PATCH 07/23] Version 1.0.1 --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a281fc2..b3b6112 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,12 @@ A step by step guide how to setup your Commercium Masternode on Windows/Linux/MacOS local wallet & Linux VPS as remote MN. +Choose one of the 2 available script options. + # Install script 1 # -Install script 1 /part2_linux_vps_setup.sh/ will install the precompiled Commercium daemon +Install script 1 will install the precompiled Commercium daemon +[part2_linux_vps_setup.sh](https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/part2_linux_vps_setup.sh) Visit https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-da7361c2e47a for Windows guide @@ -13,6 +16,7 @@ https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-in-li # Install script 2 # Install script 2 /install.sh/ will install the Commercium daemon with all dependencies from the source code +[install.sh]https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/install.sh ## Features: ## From c642f531e204a8f8c0a504b4e84f44daf01e8c91 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:27:34 +0100 Subject: [PATCH 08/23] Version 1.0.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b3b6112..a048cc9 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-in-li # Install script 2 # -Install script 2 /install.sh/ will install the Commercium daemon with all dependencies from the source code +Install script 2 will install the Commercium daemon with all dependencies from the source code [install.sh]https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/install.sh ## Features: ## From 7374476ddb39aaaf3c7eac4f3116b48515b884cc Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:28:31 +0100 Subject: [PATCH 09/23] Delete Readme.md --- Readme.md | 94 ------------------------------------------------------- 1 file changed, 94 deletions(-) delete mode 100644 Readme.md diff --git a/Readme.md b/Readme.md deleted file mode 100644 index 9af69fe..0000000 --- a/Readme.md +++ /dev/null @@ -1,94 +0,0 @@ -# Commercium-Masternode-Single/Multi-Installer - -> **Version 1.0.1:** - -Login to your vps as root, download and run the install.sh file using this command: - -``` -curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/install.sh > install.sh -bash install.sh -``` - - ------- - -### Bash Updater for masternode on Ubuntu 16.04 LTS x64 - ------- - -> **Version 1.0.1:** - -- Auto-update for update/install scripts Added. -- Update time becomes random for each vps. -- Debug log cleared every 2 days. -- Log file to UpdateNode shell added. -- This shell script can now be used either for a single update or Multi-vps update. - -> **This shell script has 4 cronjobs:** - -1. Scripts auto-update: [Check-scripts.sh](https://github.com/PostJoke/masternode/blob/master/Masternode/Check-scripts.sh) -2. Ensuring that the daemon never gets stuck: [daemon_check.sh](https://github.com/PostJoke/masternode/blob/master/Masternode/daemon_check.sh) -3. Log file clearing: [clearlog.sh](https://github.com/PostJoke/masternode/blob/master/Masternode/clearlog.sh) -4. Auto-update for Commercium Core: [UpdateNode.sh](https://github.com/PostJoke/masternode/blob/master/Masternode/UpdateNode.sh) - -> **How to use:** - -Login to your vps as root, download and run the Update.sh file using this command: - -``` -curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/update.sh > update.sh -bash update.sh -``` - -> **Available options:** - -1. **Update Masternode & Auto-update script** -2. **Update only the Auto-update script** -3. **Exit** - ->#### **1. Update Masternode & Auto-update script:** - -Updates the Commercium core & the update script, PS.available for both single and multi-vps update: - -**1.1-Update a Single Masternode:** - -``` -Updates only the vps that runs the shell script. -``` - -**1.2- Update Multi-vps Masternode** - -``` -Updates all the vps that you will add using these two options here: - - 1.2.1. Use the same SSH Port and Password for all vps's: - - Enter your vps ip's: (Exemple: 111.111.111.111-222.222.222.222-... ) - - SSH port: (Exemple: 22 ) - - password: (Exemple: Des53G2v3P ) - - 1.2.2. Use a different SSH Port and Password for each vps: - - Enter your vps data: 'Host:Password:SSHPort' ( Exemple: 111.111.111.111:ERdX5h64dSer:22-222.222.222.222:Wz65D232Fty:165-... ) -``` - ->#### **2. Update the Auto-update script only:** - -Updates only the shell scripts in your vps, PS.available for both single and multi-vps update. - ->#### **3. Exit:** - -Ends the Shell script. - ------- - -### Bash Checker for Masternodes on Ubuntu 16.04 LTS x64 - ------- - -``` -curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/check-masternode.sh > check-masternode.sh -bash check-masternode.sh -``` From fd186061ecc16cc609cd4811c41e1a18d3f7fad2 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:28:54 +0100 Subject: [PATCH 10/23] Version 1.0.1 --- check-masternode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-masternode.sh b/check-masternode.sh index fe02796..64b1ca4 100644 --- a/check-masternode.sh +++ b/check-masternode.sh @@ -9,7 +9,7 @@ LOG='Masternodes-check.log' function valid_ip() { - local ip=$1 + local ip=$1 local stat=1 if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then From 9b0cdb0f2bae981d58c8747eead8990eb69af02a Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:30:02 +0100 Subject: [PATCH 11/23] Version 1.0.1 --- Masternode/Check-scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Masternode/Check-scripts.sh b/Masternode/Check-scripts.sh index b4f7d0a..ae3dc90 100644 --- a/Masternode/Check-scripts.sh +++ b/Masternode/Check-scripts.sh @@ -6,13 +6,13 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin LANG=en_US.UTF-8 SHELL=/bin/sh PWD=/root -latestversion=$(curl --silent https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/') +latestversion=$(curl --silent https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/Version | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/') localversion=$(cat /usr/local/bin/Masternode/Version | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/') if [ -z "$latestversion" ] || [ "$latestversion" == "$localversion" ]; then exit; else cd /usr/local/bin/Masternode rm -f Update-scripts.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Update-scripts.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/Update-scripts.sh bash Update-scripts.sh fi From 8e69a940e77c292d9b1cd7fc867b330e9197ab79 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:30:37 +0100 Subject: [PATCH 12/23] Version 1.0.1 --- Masternode/Update-scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Masternode/Update-scripts.sh b/Masternode/Update-scripts.sh index 8a968d3..b977fb5 100644 --- a/Masternode/Update-scripts.sh +++ b/Masternode/Update-scripts.sh @@ -8,6 +8,6 @@ PWD=/root cd /usr/local/bin/Masternode rm -f Version rm -f UpdateNode.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/UpdateNode.sh -wget https://raw.githubusercontent.com/PostJoke/masternode/master/Masternode/Version +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/UpdateNode.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/Version chmod 755 UpdateNode.sh From 4d1166d8f979bbd939c681f32e8b8b1b6335677a Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:31:57 +0100 Subject: [PATCH 13/23] Version 1.0.1 --- Masternode/UpdateNode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Masternode/UpdateNode.sh b/Masternode/UpdateNode.sh index 00bcb72..d599bb7 100644 --- a/Masternode/UpdateNode.sh +++ b/Masternode/UpdateNode.sh @@ -50,4 +50,4 @@ rm -rf $file echo "[$dt]==> Info: Rebooting " >> $LOGFILE echo "[$dt] ==============================================================" >> $LOGFILE reboot -fi +fi From 19e87d552990ea3cac5dffe3bd41356d71e7302a Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:32:25 +0100 Subject: [PATCH 14/23] Version 1.0.1 --- Masternode/Version | 1 + 1 file changed, 1 insertion(+) diff --git a/Masternode/Version b/Masternode/Version index 9827bd9..f959b35 100644 --- a/Masternode/Version +++ b/Masternode/Version @@ -3,3 +3,4 @@ "version": "1.0.1", "description": "Bash install & update Masternode Commercium on Ubuntu 16.04 LTS x64" } + From 6930b2442f6868296a7b94aa11bac29c4e8d73c6 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:32:47 +0100 Subject: [PATCH 15/23] Version 1.0.1 --- Masternode/blockcount | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Masternode/blockcount b/Masternode/blockcount index 8b13789..8d1c8b6 100644 --- a/Masternode/blockcount +++ b/Masternode/blockcount @@ -1 +1 @@ - + From f478fac68804141101e8ec7a769dfe5ca8ac357c Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:33:09 +0100 Subject: [PATCH 16/23] Delete new --- Masternode/new | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Masternode/new diff --git a/Masternode/new b/Masternode/new deleted file mode 100644 index 8b13789..0000000 --- a/Masternode/new +++ /dev/null @@ -1 +0,0 @@ - From 3b735cca6306dfe89ea7dd5e6a510080f0a8c10f Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:33:29 +0100 Subject: [PATCH 17/23] Version 1.0.1 --- Masternode/clearlog.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Masternode/clearlog.sh b/Masternode/clearlog.sh index a2a01df..fc4ba6f 100644 --- a/Masternode/clearlog.sh +++ b/Masternode/clearlog.sh @@ -7,3 +7,4 @@ SHELL=/bin/sh PWD=/root /bin/date > ~/.commercium/debug.log + From ce16eff6be8d51088d35015ba3d37211deb12b39 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:34:00 +0100 Subject: [PATCH 18/23] Version 1.0.1 --- Masternode/daemon_check.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Masternode/daemon_check.sh b/Masternode/daemon_check.sh index e4c62c8..d78f476 100644 --- a/Masternode/daemon_check.sh +++ b/Masternode/daemon_check.sh @@ -21,3 +21,4 @@ if [ "$previousBlock" == "$currentBlock" ]; then rm -f /root/.Commercium/debug.log commerciumd -reindex fi + From 8343747a540ecf287f807d6a492f5bd73826e30a Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:34:31 +0100 Subject: [PATCH 19/23] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a048cc9..32518f7 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,10 @@ Install script 1 will install the precompiled Commercium daemon [part2_linux_vps_setup.sh](https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/part2_linux_vps_setup.sh) Visit -https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-da7361c2e47a for Windows guide -https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-in-linux-14d42e536dfb for Linux guide +https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-da7361c2e47a +Windows guide +https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-in-linux-14d42e536dfb +Linux guide # Install script 2 # From d6e81b34591247bb41dd52e7eaa0770976ba1ce3 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:34:49 +0100 Subject: [PATCH 20/23] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 32518f7..11a4103 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ Choose one of the 2 available script options. Install script 1 will install the precompiled Commercium daemon [part2_linux_vps_setup.sh](https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/part2_linux_vps_setup.sh) -Visit +Visit: + https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-da7361c2e47a Windows guide https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-in-linux-14d42e536dfb From ae27901862dcc97e8d6826f7a0c66df75cd33d55 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:35:06 +0100 Subject: [PATCH 21/23] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 11a4103..b450f07 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Visit: https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-da7361c2e47a Windows guide + https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-in-linux-14d42e536dfb Linux guide From 056bf576bcfde84e85d81cdcac1a234a22b7697a Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:35:59 +0100 Subject: [PATCH 22/23] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b450f07..7ee2a59 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Choose one of the 2 available script options. # Install script 1 # Install script 1 will install the precompiled Commercium daemon + [part2_linux_vps_setup.sh](https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/part2_linux_vps_setup.sh) Visit: @@ -20,6 +21,7 @@ Linux guide # Install script 2 # Install script 2 will install the Commercium daemon with all dependencies from the source code + [install.sh]https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/install.sh ## Features: ## From 28b4fda9326832eda4a5d7a988827d75915827f7 Mon Sep 17 00:00:00 2001 From: PostJoke <47470883+PostJoke@users.noreply.github.com> Date: Thu, 28 Feb 2019 17:17:16 +0100 Subject: [PATCH 23/23] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7ee2a59..6a3d239 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ As this script must be run as Root, make sure to secure your VPS with additional Login to your vps as root, download and run the install.sh file using this command: ``` -curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/install.sh > install.sh +curl -O https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/install.sh > install.sh bash install.sh ``` @@ -56,6 +56,6 @@ bash install.sh ------ ``` -curl -O https://raw.githubusercontent.com/PostJoke/masternode/master/check-masternode.sh > check-masternode.sh +curl -O https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/check-masternode.sh > check-masternode.sh bash check-masternode.sh ```