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/Masternode/Check-scripts.sh b/Masternode/Check-scripts.sh new file mode 100644 index 0000000..ae3dc90 --- /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/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/CommerciumBlockchain/masternode-scripts/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..b977fb5 --- /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/CommerciumBlockchain/masternode-scripts/master/Masternode/UpdateNode.sh +wget https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/Masternode/Version +chmod 755 UpdateNode.sh diff --git a/Masternode/UpdateNode.sh b/Masternode/UpdateNode.sh new file mode 100644 index 0000000..d599bb7 --- /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..f959b35 --- /dev/null +++ b/Masternode/Version @@ -0,0 +1,6 @@ +{ + "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..8d1c8b6 --- /dev/null +++ b/Masternode/blockcount @@ -0,0 +1 @@ + diff --git a/Masternode/clearlog.sh b/Masternode/clearlog.sh new file mode 100644 index 0000000..fc4ba6f --- /dev/null +++ b/Masternode/clearlog.sh @@ -0,0 +1,10 @@ +#!/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..d78f476 --- /dev/null +++ b/Masternode/daemon_check.sh @@ -0,0 +1,24 @@ +#!/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 + diff --git a/README.md b/README.md index f881717..6a3d239 100644 --- a/README.md +++ b/README.md @@ -1,345 +1,61 @@ # 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. +Choose one of the 2 available script options. -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 # +Install script 1 will install the precompiled Commercium daemon -## Requirements: +[part2_linux_vps_setup.sh](https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/part2_linux_vps_setup.sh) -- 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) +Visit: -## Masternode info +https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-da7361c2e47a +Windows guide -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. +https://medium.com/commercium-guides/how-to-set-up-a-commercium-masternode-in-linux-14d42e536dfb +Linux guide -- 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 +# Install script 2 # +Install script 2 will install the Commercium daemon with all dependencies from the source code -# PART 1: Local machine setup +[install.sh]https://github.com/CommerciumBlockchain/masternode-scripts/blob/master/install.sh -### Fresh wallet installation: +## Features: ## -#### 1. Install latest Commercium wallet at your local machine from this link: +- 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 -https://github.com/CommerciumBlockchain/CommerciumContinuum/releases +> **This shell script has 4 cronjobs:** -Follow this video instructions for help: +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) -https://youtu.be/AQMogS3Enjs (Windows) +As this script must be run as Root, make sure to secure your VPS with additional security measurements. -https://youtu.be/xuLRBuvaSgU (MacOS) +> **Version 1.0.1:** - -##### 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: +Login to your vps as root, download and run the install.sh file using this command: ``` -move %APPDATA%/ZcashParams %APPDATA%/ZcashParams.backup -move %APPDATA%/Commercium %APPDATA%/Commercium.backup +curl -O https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/install.sh > install.sh +bash install.sh ``` +### Bash Checker for Masternodes on Ubuntu 16.04 LTS x64 -#### 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 +curl -O https://raw.githubusercontent.com/CommerciumBlockchain/masternode-scripts/master/check-masternode.sh > check-masternode.sh +bash check-masternode.sh ``` - -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: - -``` -txindex=1 -daemon=1 -rpcuser=[RANDOM USERNAME] -rpcpassword=[[RANDOM PASSWORD] -masternode=1 -masternodeprivkey=[NODEKEY] -``` - -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. - -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 -``` -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 diff --git a/check-masternode.sh b/check-masternode.sh new file mode 100644 index 0000000..64b1ca4 --- /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..61ab068 --- /dev/null +++ b/install.sh @@ -0,0 +1,558 @@ +#!/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 libgomp1 +yes | sudo apt-get update +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/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 +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 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\" +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/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 +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