From 2fbb9230a445e11cb1a6ccef38240f1d09339976 Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Thu, 27 Sep 2018 19:46:18 +0000 Subject: [PATCH 01/14] Added option to install from linux precompiled binaries --- config/xsn/xsn.compile | 12 +++---- install.sh | 79 ++++++++++++++++++++++++++++++++++-------- 2 files changed, 70 insertions(+), 21 deletions(-) diff --git a/config/xsn/xsn.compile b/config/xsn/xsn.compile index 9513e69c..15b25b9e 100755 --- a/config/xsn/xsn.compile +++ b/config/xsn/xsn.compile @@ -1,7 +1,7 @@ #!/bin/bash -chmod u+x share/genbuild.sh -chmod u+x src/leveldb/build_detect_platform -chmod u+x ./autogen.sh && ./autogen.sh -./configure --disable-dependency-tracking --enable-tests=no --without-gui --without-miniupnpc -make -make install +#chmod u+x share/genbuild.sh +#chmod u+x src/leveldb/build_detect_platform +#chmod u+x ./autogen.sh && ./autogen.sh +#./configure --disable-dependency-tracking --enable-tests=no --without-gui --without-miniupnpc +#make +#make install diff --git a/install.sh b/install.sh index f32561fb..8c2dce12 100755 --- a/install.sh +++ b/install.sh @@ -7,8 +7,9 @@ # ╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ # ╚╗ @marsmensch 2016-2018 ╔╝ # -# version v0.9.9 -# date 2018-06-09 +# version v0.9.9.1 +# date 2018-09-27 +# edited by Eloy Gil (hello@eloygil.com) # # function: part of the masternode scripts, source the proper config file # @@ -26,7 +27,7 @@ declare -r CRYPTOS=`ls -l config/ | egrep '^d' | awk '{print $9}' | xargs echo - declare -r DATE_STAMP="$(date +%y-%m-%d-%s)" declare -r SCRIPTPATH="$(cd $(dirname ${BASH_SOURCE[0]}) > /dev/null; pwd -P)" declare -r MASTERPATH="$(dirname "${SCRIPTPATH}")" -declare -r SCRIPT_VERSION="v0.9.9" +declare -r SCRIPT_VERSION="v0.9.9.1" declare -r SCRIPT_LOGFILE="/tmp/nodemaster_${DATE_STAMP}_out.log" declare -r IPV4_DOC_LINK="https://www.vultr.com/docs/add-secondary-ipv4-address" declare -r DO_NET_CONF="/etc/network/interfaces.d/50-cloud-init.cfg" @@ -44,7 +45,6 @@ cat << "EOF" ╚╗ @marsmensch 2016-2018 ╔╝ EOF echo "$(tput sgr0)$(tput setaf 3)Have fun, this is crypto after all!$(tput sgr0)" -echo "$(tput setaf 6)Donations (BTC): 33ENWZ9RCYBG7nv6ac8KxBUSuQX64Hx3x3" echo "Questions: marsmensch@protonmail.com$(tput sgr0)" } @@ -74,11 +74,12 @@ function show_help(){ showbanner echo "install.sh, version $SCRIPT_VERSION"; echo "Usage example:"; - echo "install.sh (-p|--project) string [(-h|--help)] [(-n|--net) int] [(-c|--count) int] [(-r|--release) string] [(-w|--wipe)] [(-u|--update)] [(-x|--startnodes)]"; + echo "install.sh (-p|--project) string [(-h|--help)] [(-b|--binary)] [(-n|--net) int] [(-c|--count) int] [(-r|--release) string] [(-w|--wipe)] [(-u|--update)] [(-x|--startnodes)]"; echo "Options:"; echo "-h or --help: Displays this information."; + echo "-b or --binary: Tries to install using linux precompiled binaries."; echo "-p or --project string: Project to be installed. REQUIRED."; - echo "-n or --net: IP address type t be used (4 vs. 6)."; + echo "-n or --net: IP address type to be used (4 vs. 6)."; echo "-c or --count: Number of masternodes to be installed."; echo "-r or --release: Release version to be installed."; echo "-s or --sentinel: Add sentinel monitoring for a node type. Combine with the -p option"; @@ -107,6 +108,10 @@ function check_distro() { fi } +function install_basic_packages() { + apt-get -qqy -o=Dpkg::Use-Pty=0 -o=Acquire::ForceIPv4=true install jp2a &>> ${SCRIPT_LOGFILE} +} + # # /* no parameters, installs the base set of packages that are required for all projects */ # @@ -120,7 +125,7 @@ function install_packages() { libcurl4-gnutls-dev protobuf-compiler libboost-all-dev autotools-dev automake \ libboost-all-dev libssl-dev make autoconf libtool git apt-utils g++ \ libprotobuf-dev pkg-config libudev-dev libqrencode-dev bsdmainutils \ - pkg-config libgmp3-dev libevent-dev jp2a pv virtualenv libdb4.8-dev libdb4.8++-dev &>> ${SCRIPT_LOGFILE} + pkg-config libgmp3-dev libevent-dev pv virtualenv libdb4.8-dev libdb4.8++-dev &>> ${SCRIPT_LOGFILE} # only for 18.04 // openssl if [[ "${VERSION_ID}" == "18.04" ]] ; then @@ -144,7 +149,7 @@ if [ $(free | awk '/^Swap:/ {exit !$2}') ] || [ ! -f "/var/mnode_swap.img" ];the swapon /var/mnode_swap.img &>> ${SCRIPT_LOGFILE} echo '/var/mnode_swap.img none swap sw 0 0' | tee -a /etc/fstab &>> ${SCRIPT_LOGFILE} echo 'vm.swappiness=10' | tee -a /etc/sysctl.conf &>> ${SCRIPT_LOGFILE} - echo 'vm.vfs_cache_pressure=50' | tee -a /etc/sysctl.conf &>> ${SCRIPT_LOGFILE} + echo 'vm.vfs_cache_pressure=50' | tee -a /etc/sysctl.conf &>> ${SCRIPT_LOGFILE} else echo "* All good, we have a swap" fi @@ -365,9 +370,9 @@ function create_systemd_configuration() { # function set_permissions() { - # maybe add a sudoers entry later - mkdir -p /var/log/sentinel &>> ${SCRIPT_LOGFILE} - chown -R ${MNODE_USER}:${MNODE_USER} ${MNODE_CONF_BASE} ${MNODE_DATA_BASE} /var/log/sentinel ${SENTINEL_BASE}/database &>> ${SCRIPT_LOGFILE} + # maybe add a sudoers entry later + mkdir -p /var/log/sentinel &>> ${SCRIPT_LOGFILE} + chown -R ${MNODE_USER}:${MNODE_USER} ${MNODE_CONF_BASE} ${MNODE_DATA_BASE} /var/log/sentinel ${SENTINEL_BASE}/database &>> ${SCRIPT_LOGFILE} # make group permissions same as user, so vps-user can be added to masternode group chmod -R g=u ${MNODE_CONF_BASE} ${MNODE_DATA_BASE} /var/log/sentinel &>> ${SCRIPT_LOGFILE} @@ -496,7 +501,7 @@ function source_config() { NETWORK_TYPE=4 echo "WARNING:" echo "You selected IPv4 for networking but there is no automatic workflow for this part." - echo "This means you will have some mamual work to do to after this configuration run." + echo "This means you will have some manual work to do to after this configuration run." echo "" echo "See the following link for instructions how to add multiple ipv4 addresses on vultr:" echo "${IPV4_DOC_LINK}" @@ -521,9 +526,16 @@ function source_config() { prepare_mn_interfaces swaphack fi - install_packages + install_basic_packages + if [ "$binary" -ne 1 ]; then + install_packages + fi print_logo - build_mn_from_source + if [ "$binary" -eq 1 ]; then + install_mn_from_binary + else + build_mn_from_source + fi if [ "$update" -eq 0 ]; then create_mn_user create_mn_dirs @@ -564,6 +576,39 @@ function print_logo() { } +function install_mn_from_binary() { + + TMP_DIR=/tmp/$$ + mkdir -p $TMP_DIR + cd $TMP_DIR + BASE_GITHUB_API="https://api.github.com/repos" + GITHUB_USER_NAME=$(echo ${GIT_URL} | awk -F 'github.com/' '{ print $2 }' | awk -F '/' '{ print $1 }') + GITHUB_REPO_FULL=$(echo ${GIT_URL} | awk -F 'github.com/' '{ print $2 }' | awk -F '/' '{ print $2 }') + GITHUB_REPO_NAME=${GITHUB_REPO_FULL%.git} + BINARY_URL=$(curl -s ${BASE_GITHUB_API}/${GITHUB_USER_NAME}/${GITHUB_REPO_NAME}/releases/latest | grep linux | grep url | awk -F '"' '{ print $4 }') + if [ -z ${BINARY_URL+x} ]; then + echo "[ERROR] Failed to find Linux binaries for ${project}. Try compiling from source files." + exit + fi + echo "* Downloading linux binaries from ${BINARY_URL}..." + BINARY_FILE=$(echo $BINARY_URL | awk -F '/' '{ print $NF }') + wget --quiet -O $BINARY_FILE $BINARY_URL + echo "* Done." + if [ ${BINARY_FILE: -7} == ".tar.gz" ]; then + tar xzvf $BINARY_FILE + elif [ ${BINARY_FILE: -4} == ".zip" ]; then + unzip $BINARY_FILE + else + "[ERROR] Unexpected file extension. Aborting..." + exit + fi + cp -r $(find -type d -name bin)/* /usr/local/bin/ + cp -r $(find -type d -name lib)/* /usr/local/lib/ + cp -r $(find -type d -name include)/* /usr/local/include/ + cd - + +} + # # /* no parameters, builds the required masternode binary from sources. Exits if already exists and "update" not given */ # @@ -749,7 +794,7 @@ sentinel=0; startnodes=0; # Execute getopt -ARGS=$(getopt -o "hp:n:c:r:wsudx" -l "help,project:,net:,count:,release:,wipe,sentinel,update,debug,startnodes" -n "install.sh" -- "$@"); +ARGS=$(getopt -o "hp:n:c:r:wbsudx" -l "help,project:,net:,count:,release:,wipe,binary,sentinel,update,debug,startnodes" -n "install.sh" -- "$@"); #Bad arguments if [ $? -ne 0 ]; @@ -802,6 +847,10 @@ while true; do shift; wipe="1"; ;; + -b|--binary) + shift; + binary="1"; + ;; -s|--sentinel) shift; sentinel="1"; From d04ef87c0ff6956bc7517a751d437c853d656d34 Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Thu, 27 Sep 2018 19:52:13 +0000 Subject: [PATCH 02/14] Remove temp dir --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 8c2dce12..2cc28dab 100755 --- a/install.sh +++ b/install.sh @@ -606,6 +606,7 @@ function install_mn_from_binary() { cp -r $(find -type d -name lib)/* /usr/local/lib/ cp -r $(find -type d -name include)/* /usr/local/include/ cd - + rm -rf $TMP_DIR } From 635b178dc5c9640ce3e5162b8412d741815d9c01 Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Thu, 27 Sep 2018 20:13:34 +0000 Subject: [PATCH 03/14] Limit binaries to linux and 64 --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 2cc28dab..e27e6a19 100755 --- a/install.sh +++ b/install.sh @@ -585,7 +585,7 @@ function install_mn_from_binary() { GITHUB_USER_NAME=$(echo ${GIT_URL} | awk -F 'github.com/' '{ print $2 }' | awk -F '/' '{ print $1 }') GITHUB_REPO_FULL=$(echo ${GIT_URL} | awk -F 'github.com/' '{ print $2 }' | awk -F '/' '{ print $2 }') GITHUB_REPO_NAME=${GITHUB_REPO_FULL%.git} - BINARY_URL=$(curl -s ${BASE_GITHUB_API}/${GITHUB_USER_NAME}/${GITHUB_REPO_NAME}/releases/latest | grep linux | grep url | awk -F '"' '{ print $4 }') + BINARY_URL=$(curl -s ${BASE_GITHUB_API}/${GITHUB_USER_NAME}/${GITHUB_REPO_NAME}/releases/latest | grep linux | grep 64 | grep url | awk -F '"' '{ print $4 }') if [ -z ${BINARY_URL+x} ]; then echo "[ERROR] Failed to find Linux binaries for ${project}. Try compiling from source files." exit From 775219231ad75ecace685c6c65584f81300bdb19 Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Thu, 27 Sep 2018 20:15:11 +0000 Subject: [PATCH 04/14] Limit binaries to linux and x86_64 --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index e27e6a19..dfc903ea 100755 --- a/install.sh +++ b/install.sh @@ -585,7 +585,7 @@ function install_mn_from_binary() { GITHUB_USER_NAME=$(echo ${GIT_URL} | awk -F 'github.com/' '{ print $2 }' | awk -F '/' '{ print $1 }') GITHUB_REPO_FULL=$(echo ${GIT_URL} | awk -F 'github.com/' '{ print $2 }' | awk -F '/' '{ print $2 }') GITHUB_REPO_NAME=${GITHUB_REPO_FULL%.git} - BINARY_URL=$(curl -s ${BASE_GITHUB_API}/${GITHUB_USER_NAME}/${GITHUB_REPO_NAME}/releases/latest | grep linux | grep 64 | grep url | awk -F '"' '{ print $4 }') + BINARY_URL=$(curl -s ${BASE_GITHUB_API}/${GITHUB_USER_NAME}/${GITHUB_REPO_NAME}/releases/latest | grep linux | grep x86_64 | grep url | awk -F '"' '{ print $4 }') if [ -z ${BINARY_URL+x} ]; then echo "[ERROR] Failed to find Linux binaries for ${project}. Try compiling from source files." exit From deb94386b487135b0951ac7dc87b1d655f1c0045 Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Thu, 27 Sep 2018 20:25:57 +0000 Subject: [PATCH 05/14] Fix support for only bin directory in precompiled files --- install.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index dfc903ea..462b8dfe 100755 --- a/install.sh +++ b/install.sh @@ -602,9 +602,18 @@ function install_mn_from_binary() { "[ERROR] Unexpected file extension. Aborting..." exit fi - cp -r $(find -type d -name bin)/* /usr/local/bin/ - cp -r $(find -type d -name lib)/* /usr/local/lib/ - cp -r $(find -type d -name include)/* /usr/local/include/ + if [ $(find -type d -name bin | wc -l ) -eq 1 ]; then + cp -r $(find -type d -name bin)/* /usr/local/bin/ + else + echo "[ERROR] Unexpected file content. Aborting..." + exit + fi + if [ $(find -type d -name lib | wc -l ) -eq 1 ]; then + cp -r $(find -type d -name lib)/* /usr/local/lib/ + fi + if [ $(find -type d -name include | wc -l ) -eq 1 ]; then + cp -r $(find -type d -name include)/* /usr/local/include/ + fi cd - rm -rf $TMP_DIR From 5da8c63f7e51633c1cade75b87c5c01fff51185a Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Thu, 27 Sep 2018 20:28:45 +0000 Subject: [PATCH 06/14] Remove binary from TODO --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 5372525f..6786d693 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,6 @@ The management script release will follow within the next couple of days. * provide my Dockerfile & Vagrantfile * write more test cases -* implement a binary option (?) * output all supported cryptos as list within help # Errors From 36f33cb05a8cca9664b7718700d936cfce900fcd Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Sun, 7 Oct 2018 05:54:03 +0000 Subject: [PATCH 07/14] tiny changes --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 462b8dfe..a46a617c 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ # Twitter @marsmensch # Useful variables -declare -r CRYPTOS=`ls -l config/ | egrep '^d' | awk '{print $9}' | xargs echo -n; echo` +#declare -r CRYPTOS=`ls -l config/ | egrep '^d' | awk '{print $9}' | xargs echo -n; echo` declare -r DATE_STAMP="$(date +%y-%m-%d-%s)" declare -r SCRIPTPATH="$(cd $(dirname ${BASH_SOURCE[0]}) > /dev/null; pwd -P)" declare -r MASTERPATH="$(dirname "${SCRIPTPATH}")" @@ -614,7 +614,7 @@ function install_mn_from_binary() { if [ $(find -type d -name include | wc -l ) -eq 1 ]; then cp -r $(find -type d -name include)/* /usr/local/include/ fi - cd - + cd ${SCRIPTPATH} rm -rf $TMP_DIR } From 0a95bf674b551fa6beb95fff249bb743218b6dcb Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Sun, 7 Oct 2018 19:35:44 +0000 Subject: [PATCH 08/14] add tag to temp dir --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a46a617c..288e2332 100755 --- a/install.sh +++ b/install.sh @@ -578,7 +578,7 @@ function print_logo() { function install_mn_from_binary() { - TMP_DIR=/tmp/$$ + TMP_DIR=/tmp/binary$$ mkdir -p $TMP_DIR cd $TMP_DIR BASE_GITHUB_API="https://api.github.com/repos" From fc143c399183bca4561390998ebda843d22f0c6f Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Sun, 7 Oct 2018 20:00:32 +0000 Subject: [PATCH 09/14] change EOF style --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 288e2332..2714a471 100755 --- a/install.sh +++ b/install.sh @@ -320,7 +320,7 @@ function create_control_configuration() { rm -f /tmp/${CODENAME}_masternode.conf &>> ${SCRIPT_LOGFILE} # create one line per masternode with the data we have for NUM in $(seq 1 ${count}); do - cat >> /tmp/${CODENAME}_masternode.conf <<-EOF + cat <<-EOF >> /tmp/${CODENAME}_masternode.conf ${CODENAME}MN${NUM} [${IPV6_INT_BASE}:${NETWORK_BASE_TAG}::${NUM}]:${MNODE_INBOUND_PORT} MASTERNODE_PRIVKEY_FOR_${CODENAME}MN${NUM} COLLATERAL_TX_FOR_${CODENAME}MN${NUM} OUTPUT_NO_FOR_${CODENAME}MN${NUM} EOF done @@ -337,7 +337,7 @@ function create_systemd_configuration() { for NUM in $(seq 1 ${count}); do PASS=$(date | md5sum | cut -c1-24) echo "* (over)writing systemd config file ${SYSTEMD_CONF}/${CODENAME}_n${NUM}.service" &>> ${SCRIPT_LOGFILE} - cat > ${SYSTEMD_CONF}/${CODENAME}_n${NUM}.service <<-EOF + cat <<-EOF > ${SYSTEMD_CONF}/${CODENAME}_n${NUM}.service [Unit] Description=${CODENAME} distributed currency daemon After=network.target From 7e7b1c00173902c6f3ee036b35a978f193e4eb0c Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Sun, 7 Oct 2018 20:21:28 +0000 Subject: [PATCH 10/14] replace cat until EOF by echo --- install.sh | 55 ++++++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/install.sh b/install.sh index 2714a471..5034bd65 100755 --- a/install.sh +++ b/install.sh @@ -320,9 +320,7 @@ function create_control_configuration() { rm -f /tmp/${CODENAME}_masternode.conf &>> ${SCRIPT_LOGFILE} # create one line per masternode with the data we have for NUM in $(seq 1 ${count}); do - cat <<-EOF >> /tmp/${CODENAME}_masternode.conf - ${CODENAME}MN${NUM} [${IPV6_INT_BASE}:${NETWORK_BASE_TAG}::${NUM}]:${MNODE_INBOUND_PORT} MASTERNODE_PRIVKEY_FOR_${CODENAME}MN${NUM} COLLATERAL_TX_FOR_${CODENAME}MN${NUM} OUTPUT_NO_FOR_${CODENAME}MN${NUM} - EOF + echo "${CODENAME}MN${NUM} [${IPV6_INT_BASE}:${NETWORK_BASE_TAG}::${NUM}]:${MNODE_INBOUND_PORT} MASTERNODE_PRIVKEY_FOR_${CODENAME}MN${NUM} COLLATERAL_TX_FOR_${CODENAME}MN${NUM} OUTPUT_NO_FOR_${CODENAME}MN${NUM}" >> /tmp/${CODENAME}_masternode.conf done } @@ -335,32 +333,31 @@ function create_systemd_configuration() { echo "* (over)writing systemd config files for masternodes" # create one config file per masternode for NUM in $(seq 1 ${count}); do - PASS=$(date | md5sum | cut -c1-24) - echo "* (over)writing systemd config file ${SYSTEMD_CONF}/${CODENAME}_n${NUM}.service" &>> ${SCRIPT_LOGFILE} - cat <<-EOF > ${SYSTEMD_CONF}/${CODENAME}_n${NUM}.service - [Unit] - Description=${CODENAME} distributed currency daemon - After=network.target - - [Service] - User=${MNODE_USER} - Group=${MNODE_USER} - - Type=forking - PIDFile=${MNODE_DATA_BASE}/${CODENAME}${NUM}/${CODENAME}.pid - ExecStart=${MNODE_DAEMON} -daemon -pid=${MNODE_DATA_BASE}/${CODENAME}${NUM}/${CODENAME}.pid -conf=${MNODE_CONF_BASE}/${CODENAME}_n${NUM}.conf -datadir=${MNODE_DATA_BASE}/${CODENAME}${NUM} - - Restart=always - RestartSec=5 - PrivateTmp=true - TimeoutStopSec=60s - TimeoutStartSec=5s - StartLimitInterval=120s - StartLimitBurst=15 - - [Install] - WantedBy=multi-user.target - EOF + PASS=$(date | md5sum | cut -c1-24) + SYSTEMD_CONF_FILE=${SYSTEMD_CONF}/${CODENAME}_n${NUM}.service + echo "* (over)writing systemd config file ${SYSTEMD_CONF_FILE}" &>> ${SCRIPT_LOGFILE} + echo "[Unit]" > ${SYSTEMD_CONF_FILE} + echo "Description=${CODENAME} distributed currency daemon" >> ${SYSTEMD_CONF_FILE} + echo "After=network.target" >> ${SYSTEMD_CONF_FILE} + echo "" >> ${SYSTEMD_CONF_FILE} + echo "[Service]" >> ${SYSTEMD_CONF_FILE} + echo "User=${MNODE_USER}" >> ${SYSTEMD_CONF_FILE} + echo "Group=${MNODE_USER}" >> ${SYSTEMD_CONF_FILE} + echo "" >> ${SYSTEMD_CONF_FILE} + echo "Type=forking" >> ${SYSTEMD_CONF_FILE} + echo "PIDFile=${MNODE_DATA_BASE}/${CODENAME}${NUM}/${CODENAME}.pid" >> ${SYSTEMD_CONF_FILE} + echo "ExecStart=${MNODE_DAEMON} -daemon -pid=${MNODE_DATA_BASE}/${CODENAME}${NUM}/${CODENAME}.pid -conf=${MNODE_CONF_BASE}/${CODENAME}_n${NUM}.conf -datadir=${MNODE_DATA_BASE}/${CODENAME}${NUM}" >> ${SYSTEMD_CONF_FILE} + echo "" >> ${SYSTEMD_CONF_FILE} + echo "Restart=always" >> ${SYSTEMD_CONF_FILE} + echo "RestartSec=5" >> ${SYSTEMD_CONF_FILE} + echo "PrivateTmp=true" >> ${SYSTEMD_CONF_FILE} + echo "TimeoutStopSec=60s" >> ${SYSTEMD_CONF_FILE} + echo "TimeoutStartSec=5s" >> ${SYSTEMD_CONF_FILE} + echo "StartLimitInterval=120s" >> ${SYSTEMD_CONF_FILE} + echo "StartLimitBurst=15" >> ${SYSTEMD_CONF_FILE} + echo "" >> ${SYSTEMD_CONF_FILE} + echo "[Install]" >> ${SYSTEMD_CONF_FILE} + echo "WantedBy=multi-user.target" >> ${SYSTEMD_CONF_FILE} done } From 5682b5109b50115c25a8965f911cc3b3a446984c Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Sun, 7 Oct 2018 22:45:57 +0000 Subject: [PATCH 11/14] remove bash pid --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5034bd65..8cec9bae 100755 --- a/install.sh +++ b/install.sh @@ -575,7 +575,7 @@ function print_logo() { function install_mn_from_binary() { - TMP_DIR=/tmp/binary$$ + TMP_DIR=/tmp/binary mkdir -p $TMP_DIR cd $TMP_DIR BASE_GITHUB_API="https://api.github.com/repos" From b30ae76ea36af363a9ed4cf231c9371fc8187c53 Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Sun, 27 Oct 2019 02:58:03 +0000 Subject: [PATCH 12/14] add binary option and usage example --- README.md | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6786d693..1780651d 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,10 @@ The **Nodemaster** scripts is a collection of utilities to manage, setup and upd I am quite confident this is the single best and almost effortless way to setup different crypto masternodes, without bothering too much about the setup part. -If this script helped you in any way, please contribute some feedback. BTC donations also welcome and never forget: +If this script helped you in any way, please contribute some feedback. Never forget: **Have fun, this is crypto after all!** -``` -BTC 33ENWZ9RCYBG7nv6ac8KxBUSuQX64Hx3x3 -``` - - Feel free to use my reflink to signup and receive a bonus w/ vultr: @@ -99,6 +94,12 @@ These are only a couple of examples for typical setups. Check my [easy step-by-s ./install.sh -p pivx -c 2 -s ``` +**Install 2 PIVX masternodes using binary build instead of compiling the source code:** + +```bash +./install.sh -p pivx -c 2 -b +``` + ## Options The _install.sh_ script support the following parameters: @@ -108,6 +109,7 @@ The _install.sh_ script support the following parameters: | --project | -p | project, e.g. "pix" | shortname for the project | | --net | -n | "4" / "6" | ip type for masternode. (ipv)6 is default | | --release | -r | e.g. "tags/v3.0.4" | a specific git tag/branch, defaults to latest tested | +| --binary | -b | -- | use linux binaries instead of compiling from source code | | --count | -c | number | amount of masternodes to be configured | | --update | -u | -- | update specified masternode daemon, combine with -p flag | | --sentinel | -s | -- | install and configure sentinel for node monitoring | @@ -148,13 +150,7 @@ I activated the "[issues](https://github.com/masternodes/vps/issues)" option on I might not be able to reply immediately, but i do usually within a couple of days at worst. I will also happily take any pull requests that make masternode installations easier for everyone ;-) -If this script helped you in any way, please contribute some feedback. BTC donations also welcome and never forget: - -**Have fun, this is crypto after all!** - -``` -BTC 33ENWZ9RCYBG7nv6ac8KxBUSuQX64Hx3x3 -``` +If this script helped you in any way, please contribute some feedback. Never forget: ## Management script (not yet implemented) @@ -179,10 +175,6 @@ The management script release will follow within the next couple of days. * currently not fully idempotent -Ping me at contact@marsmenschen.com for questions and send some crypto my way if you are happy. +Ping me at contact@marsmenschen.com for questions. **Have fun, this is crypto after all!** - -``` -BTC 33ENWZ9RCYBG7nv6ac8KxBUSuQX64Hx3x3 -``` From 865977e57b5f692256c11be44319353b7cc2a2b1 Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Sun, 27 Oct 2019 03:13:49 +0000 Subject: [PATCH 13/14] restore file content (uncomment) --- config/xsn/xsn.compile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/xsn/xsn.compile b/config/xsn/xsn.compile index 15b25b9e..9513e69c 100755 --- a/config/xsn/xsn.compile +++ b/config/xsn/xsn.compile @@ -1,7 +1,7 @@ #!/bin/bash -#chmod u+x share/genbuild.sh -#chmod u+x src/leveldb/build_detect_platform -#chmod u+x ./autogen.sh && ./autogen.sh -#./configure --disable-dependency-tracking --enable-tests=no --without-gui --without-miniupnpc -#make -#make install +chmod u+x share/genbuild.sh +chmod u+x src/leveldb/build_detect_platform +chmod u+x ./autogen.sh && ./autogen.sh +./configure --disable-dependency-tracking --enable-tests=no --without-gui --without-miniupnpc +make +make install From 93fd2cadcf911e995a00137bf7dba4c24e619ef1 Mon Sep 17 00:00:00 2001 From: Eloy Gil Date: Sun, 27 Oct 2019 03:16:40 +0000 Subject: [PATCH 14/14] fix conflict (line deleted accidentally) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1780651d..10aee4f7 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,8 @@ I might not be able to reply immediately, but i do usually within a couple of da If this script helped you in any way, please contribute some feedback. Never forget: +**Have fun, this is crypto after all!** + ## Management script (not yet implemented) The management script release will follow within the next couple of days.