From 668d9626e48e097aea4d9496fe5415840747f5f1 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 10:18:31 +0100 Subject: [PATCH 01/18] set node chain --- .gitignore | 7 ----- pli_node_scripts.sh | 63 ++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index f441c6e..cefd9f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,3 @@ /notes /notes/** -bash_menu.sh -file_restore.sh -node_backup.sh -node_backup2.sh -#sample_bkup.vars -setup_backups.sh -#_plinode_setup_bkup.sh .DS_Store diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 005a24f..b827c1a 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -338,13 +338,61 @@ FUNC_NODE_DEPLOY(){ sleep 2s -########################### Add Mainnet details ########################## + ########################### Add Mainnet details ########################## + V2_CONF_FILE="$PLI_DEPLOY_PATH/config.toml" sed -i.bak "s/HTTPSPort = 0/HTTPSPort = $PLI_HTTPS_PORT/g" $V2_CONF_FILE -########################################################################### + if [ "$_OPTION" == "mainnet" ]; then + echo " ### Configuring node for $_OPTION.. ###" + + VARVAL_CHAIN_NAME=$mainnet_name + VARVAL_CHAIN_ID=$mainnet_ChainID + VARVAL_CONTRACT_ADDR=$mainnet_ContractAddress + VARVAL_WSS=$mainnet_wsUrl + VARVAL_RPC=$mainnet_httpUrl + + elif [ "$_OPTION" == "apothem" ]; then + echo " ### Configuring node for $_OPTION.. ###" + + VARVAL_CHAIN_NAME=$testnet_name + VARVAL_CHAIN_ID=$testnet_ChainID + VARVAL_CONTRACT_ADDR=$testnet_ContractAddress + VARVAL_WSS=$testnet_wsUrl + VARVAL_RPC=$testnet_httpUrl + + fi + + + # get current Chains + EVM_CHAIN_ID=$(sudo -u postgres -i psql -d plugin_mainnet_db -AXqtc "select id from evm_chains;") + echo $EVM_CHAIN_ID + ## returns 50 + + # delete existing evm chain id + sudo -u postgres -i psql -d plugin_mainnet_db -c "DELETE from evm_chains WHERE id = '$EVM_CHAIN_ID';" + + sed -i 's|^ChainID.*|ChainID = '\'$VARVAL_CHAIN_ID\''|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep ChainID + + sed -i 's|^LinkContractAddress.*|LinkContractAddress = '\"$VARVAL_CONTRACT_ADDR\"'|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep LinkContractAddress + + sed -i 's|^name.*|name = '\"$VARVAL_CHAIN_NAME\"'|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep name + + sed -i 's|^wsUrl.*|wsUrl = '\"$VARVAL_WSS\"'|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep wsUrl + + sed -i 's|^httpUrl.*|httpUrl = '\'$VARVAL_RPC\''|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep httpUrl + + + ########################################################################### + + echo echo -e "${GREEN}#########################################################################${NC}" @@ -721,7 +769,12 @@ FUNC_EXIT_ERROR(){ #clear case "$1" in - full) + mainnet) + _OPTION="mainnet" + FUNC_NODE_DEPLOY + ;; + apothem) + _OPTION="apothem" FUNC_NODE_DEPLOY ;; keys) @@ -747,7 +800,9 @@ case "$1" in echo echo "where {function} is one of the following;" echo - echo " full == deploys the full node incl. external initiator & exports the node keys" + echo " mainnet == deploys the full Mainnet node & exports the node keys" + echo + echo " apothem == deploys the full Apothem node & exports the node keys" echo echo " keys == extracts the node keys from DB and exports to json file for import to MetaMask" echo From eaa5acbb3952bf07d74f85ecb51cfef9f18fab18 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 10:19:24 +0100 Subject: [PATCH 02/18] remove sql updates --- pli_node_scripts.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index b827c1a..fec55c3 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -367,12 +367,12 @@ FUNC_NODE_DEPLOY(){ # get current Chains - EVM_CHAIN_ID=$(sudo -u postgres -i psql -d plugin_mainnet_db -AXqtc "select id from evm_chains;") - echo $EVM_CHAIN_ID - ## returns 50 - - # delete existing evm chain id - sudo -u postgres -i psql -d plugin_mainnet_db -c "DELETE from evm_chains WHERE id = '$EVM_CHAIN_ID';" + #EVM_CHAIN_ID=$(sudo -u postgres -i psql -d plugin_mainnet_db -AXqtc "select id from evm_chains;") + #echo $EVM_CHAIN_ID + ### returns 50 +# + ## delete existing evm chain id + #sudo -u postgres -i psql -d plugin_mainnet_db -c "DELETE from evm_chains WHERE id = '$EVM_CHAIN_ID';" sed -i 's|^ChainID.*|ChainID = '\'$VARVAL_CHAIN_ID\''|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep ChainID From b35d154533895f4b7c633542c473ad0aa05a43d1 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 10:26:57 +0100 Subject: [PATCH 03/18] fix config.toml path --- pli_node_scripts.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index fec55c3..872aebe 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -340,9 +340,9 @@ FUNC_NODE_DEPLOY(){ ########################### Add Mainnet details ########################## - V2_CONF_FILE="$PLI_DEPLOY_PATH/config.toml" + #V2_CONF_FILE="$PLI_DEPLOY_PATH/config.toml" - sed -i.bak "s/HTTPSPort = 0/HTTPSPort = $PLI_HTTPS_PORT/g" $V2_CONF_FILE + sed -i.bak "s/HTTPSPort = 0/HTTPSPort = $PLI_HTTPS_PORT/g" $PLI_DEPLOY_PATH/$BASH_FILE3 if [ "$_OPTION" == "mainnet" ]; then @@ -374,19 +374,19 @@ FUNC_NODE_DEPLOY(){ ## delete existing evm chain id #sudo -u postgres -i psql -d plugin_mainnet_db -c "DELETE from evm_chains WHERE id = '$EVM_CHAIN_ID';" - sed -i 's|^ChainID.*|ChainID = '\'$VARVAL_CHAIN_ID\''|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + sed -i 's|^ChainID.*|ChainID = '\'$VARVAL_CHAIN_ID\''|g' $PLI_DEPLOY_PATH/$BASH_FILE3 cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep ChainID - sed -i 's|^LinkContractAddress.*|LinkContractAddress = '\"$VARVAL_CONTRACT_ADDR\"'|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + sed -i 's|^LinkContractAddress.*|LinkContractAddress = '\"$VARVAL_CONTRACT_ADDR\"'|g' $PLI_DEPLOY_PATH/$BASH_FILE3 cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep LinkContractAddress - sed -i 's|^name.*|name = '\"$VARVAL_CHAIN_NAME\"'|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + sed -i 's|^name.*|name = '\"$VARVAL_CHAIN_NAME\"'|g' $PLI_DEPLOY_PATH/$BASH_FILE3 cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep name - sed -i 's|^wsUrl.*|wsUrl = '\"$VARVAL_WSS\"'|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + sed -i 's|^wsUrl.*|wsUrl = '\"$VARVAL_WSS\"'|g' $PLI_DEPLOY_PATH/$BASH_FILE3 cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep wsUrl - sed -i 's|^httpUrl.*|httpUrl = '\'$VARVAL_RPC\''|g' $PLI_DEPLOY_PATH/$V2_CONF_FILE + sed -i 's|^httpUrl.*|httpUrl = '\'$VARVAL_RPC\''|g' $PLI_DEPLOY_PATH/$BASH_FILE3 cat $PLI_DEPLOY_PATH/$BASH_FILE3 | grep httpUrl From 826b7ff711493813a2ab52aefc65fa7e557318d2 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 10:41:17 +0100 Subject: [PATCH 04/18] updated menu guide --- pli_node_scripts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 872aebe..673a005 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -795,7 +795,7 @@ case "$1" in echo echo "Usage: $0 {function}" echo - echo " example: " $0 full"" + echo " example: " $0 mainnet"" echo echo echo "where {function} is one of the following;" From 57467f67ccb29cbc45a271c7014aac91f97f6249 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 10:52:31 +0100 Subject: [PATCH 05/18] fix colour --- pli_node_scripts.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 673a005..a6e1fc5 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -52,7 +52,7 @@ FUNC_VARS(){ FUNC_PKG_CHECK(){ - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}## CHECK NECESSARY PACKAGES HAVE BEEN INSTALLED...${NC}" for i in "${REQ_PACKAGES[@]}" @@ -71,7 +71,7 @@ FUNC_PKG_CHECK(){ FUNC_VALUE_CHECK(){ - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}## CONFIRM SCRIPTS VARIABLES FILE HAS BEEN UPDATED...${NC}" # Ask the user acc for login details (comment out to disable) @@ -157,7 +157,7 @@ FUNC_PASSWD_CHECKS(){ if ([ -z "$API_PASS" ] || [ "$API_PASS" == "$SAMPLE_API_PASS" ]); then echo - echo -e "${GREEN} VARIABLE 'API_PASS' NOT UPDATED MANUALLY - AUTO GENERATING VALUE NOW" + echo -e "${GREEN} VARIABLE 'API_PASS' NOT UPDATED MANUALLY - AUTO GENERATING VALUE NOW${NC}" echo sleep 2s @@ -635,7 +635,7 @@ FUNC_EXPORT_NODE_KEYS(){ source ~/"plinode_$(hostname -f)".vars echo echo -e "${GREEN}#########################################################################${NC}" -echo -e "${GREEN} export node keys {NC}" +echo -e "${GREEN} export node keys ${NC}" #sudo usermod -aG postgres $(getent passwd $EUID | cut -d: -f1) From f15f001d4ffd435e7d4538343fc11375105c5f9b Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 11:05:11 +0100 Subject: [PATCH 06/18] added chain type colours --- pli_node_scripts.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index a6e1fc5..5fe8593 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -14,6 +14,7 @@ sudo sh -c 'cat /tmp/plisudotmp > /etc/sudoers.d/plinode_deploy' # Set Colour Vars GREEN='\033[0;32m' RED='\033[0;31m' +YELLOW='\033[1;33m' NC='\033[0m' # No Color FDATE=$(date +"%Y_%m_%d_%H_%M") @@ -346,7 +347,7 @@ FUNC_NODE_DEPLOY(){ if [ "$_OPTION" == "mainnet" ]; then - echo " ### Configuring node for $_OPTION.. ###" + echo "${GREEN} ### Configuring node for ${NC}${YELLOW}$_OPTION${NC}${GREEN}.. ###${NC}" VARVAL_CHAIN_NAME=$mainnet_name VARVAL_CHAIN_ID=$mainnet_ChainID @@ -355,7 +356,7 @@ FUNC_NODE_DEPLOY(){ VARVAL_RPC=$mainnet_httpUrl elif [ "$_OPTION" == "apothem" ]; then - echo " ### Configuring node for $_OPTION.. ###" + echo "${GREEN} ### Configuring node for ${NC}${YELLOW}$_OPTION${NC}${GREEN}.. ###${NC}" VARVAL_CHAIN_NAME=$testnet_name VARVAL_CHAIN_ID=$testnet_ChainID @@ -590,9 +591,9 @@ EOF echo -e "${GREEN}#########################################################################${NC}" - echo -e "${GREEN}## INFO: Install process completed. exiting...${NC}" - echo + echo -e "${GREEN}## INFO: Install process completed for ${NC}${YELLOW}$_OPTION${NC}${GREEN} node. exiting...${NC}" echo + echo -e "${GREEN}## INFO:${NC}${YELLOW}$_OPTION${NC}${GREEN} Contract Address = ${NC}${YELLOW}$VARVAL_CONTRACT_ADDR ${NC}" echo echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}#########################################################################${NC}" @@ -635,7 +636,7 @@ FUNC_EXPORT_NODE_KEYS(){ source ~/"plinode_$(hostname -f)".vars echo echo -e "${GREEN}#########################################################################${NC}" -echo -e "${GREEN} export node keys ${NC}" +echo -e "${GREEN} export ${NC}${YELLOW}$_OPTION${NC}${GREEN} node keys ${NC}" #sudo usermod -aG postgres $(getent passwd $EUID | cut -d: -f1) @@ -645,7 +646,7 @@ echo echo -e "${RED}###### IMPORTANT FILE - NODE ADDRESS EXPORT FOR WALLET ACCESS #####${NC}" echo -e "${RED}###### IMPORTANT FILE - PLEASE SECURE APPROPRIATELY #####${NC}" echo -echo -e "${GREEN} export node keys - exporting keys to file: ~/"plinode_$(hostname -f)_keys_${FDATE}".json${NC}" +echo -e "${GREEN} export ${NC}${YELLOW}$_OPTION${NC}${GREEN} node keys - exporting keys to file: ~/"plinode_$(hostname -f)_keys_${FDATE}".json${NC}" FUNC_NODE_ADDR if [ ! -e $PLI_DEPLOY_PATH/pass ]; then @@ -655,7 +656,7 @@ fi plugin keys eth export $node_key_primary --newpassword $PLI_DEPLOY_PATH/pass --output ~/"plinode_$(hostname -f)_keys_${FDATE}".json -echo -e "${GREEN} export node keys - securing file permissions${NC}" +echo -e "${GREEN} export ${NC}${YELLOW}$_OPTION${NC}${GREEN} node keys - securing file permissions${NC}" chmod 400 ~/"plinode_$(hostname -f)_keys_${FDATE}".json @@ -736,7 +737,7 @@ FUNC_NODE_ADDR(){ IFS=$'\n' read -r -d '' -a node_keys_arr < <( plugin keys eth list | grep Address && printf '\0' ) node_key_primary=$(echo ${node_keys_arr[0]} | sed s/Address:[[:space:]]/''/) echo - echo -e "${GREEN}Your Plugin node regular address is:${NC} ${RED}$node_key_primary ${NC}" + echo -e "${GREEN}Your Plugin ${NC}${YELLOW}$_OPTION${NC}${GREEN} node regular address is:${NC} ${RED}$node_key_primary ${NC}" echo echo -e "${GREEN}#########################################################################${NC}" } @@ -745,7 +746,7 @@ FUNC_NODE_ADDR(){ FUNC_NODE_GUI_IPADDR(){ GUI_IP=$(curl -s ipinfo.io/ip) echo - echo -e "${GREEN}Your Plugin node GUI IP address is as follows:${NC}" + echo -e "${GREEN}Your Plugin ${NC}${YELLOW}$_OPTION${NC}${GREEN} node GUI IP address is as follows:${NC}" echo echo -e " ${RED}https://$GUI_IP:6689${NC}" echo From 79c4efa884a6217842a906810e96e2027c5711ba Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 11:17:41 +0100 Subject: [PATCH 07/18] fix colours --- base_sys_setup.sh | 38 +++++++++++++++++++------------------- pli_node_scripts.sh | 21 +++++++++++---------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/base_sys_setup.sh b/base_sys_setup.sh index 9494649..8f36077 100644 --- a/base_sys_setup.sh +++ b/base_sys_setup.sh @@ -19,17 +19,17 @@ FUNC_VARS(){ FUNC_VALUE_CHECK(){ - echo -e "${GREEN}#########################################################################" - echo -e "${GREEN}#########################################################################" - echo -e "${GREEN}" - echo -e "${GREEN} GoPlugin 2.0 Validator Node Deployment Script - Pre Checks" - echo -e "${GREEN}" - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" + echo -e "${GREEN}#########################################################################${NC}" + echo + echo -e "${GREEN} GoPlugin 2.0 Validator Node Deployment Script - Pre Checks${NC}" + echo + echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}#########################################################################${NC}" - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## CONFIRM SCRIPTS VARIABLE DEFINITIONS HAVE BEEN UPDATED...${NC}" echo @@ -54,7 +54,7 @@ FUNC_VALUE_CHECK(){ FUNC_PKG_CHECK(){ - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## CHECK NECESSARY PACKAGES HAVE BEEN INSTALLED...${NC}" echo @@ -84,7 +84,7 @@ FUNC_SETUP_OS(){ #echo -e "${GREEN}#########################################################################${NC}" - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Base Setup: System updates...${NC}" echo @@ -104,7 +104,7 @@ FUNC_SETUP_OS(){ FUNC_SETUP_USER(){ - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Base Setup: Add new local admin account with sudo access...${NC}" echo @@ -114,7 +114,7 @@ FUNC_SETUP_USER(){ # root@plitest:/# sleep 1s - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Provide user details...${NC}" echo @@ -125,7 +125,7 @@ FUNC_SETUP_USER(){ encVAR_PASSWORD=$(mkpasswd -m sha256crypt $VAR_PASSWORD) sleep 2s - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Base Setup: Creating the new acc user & group & adds to sudoers...${NC}" echo @@ -146,7 +146,7 @@ FUNC_SETUP_USER(){ echo echo - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Base Setup: Creating SSH keys for new acc user ${NC}" echo @@ -191,7 +191,7 @@ FUNC_SETUP_USER(){ FUNC_SETUP_UFW_PORTS(){ echo echo - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Base Setup: Configure Firewall...${NC}" echo @@ -216,7 +216,7 @@ FUNC_ENABLE_UFW(){ echo echo - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Base Setup: Change UFW logging to ufw.log only${NC}" echo @@ -226,7 +226,7 @@ FUNC_ENABLE_UFW(){ echo echo - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Setup: Enable Firewall...${NC}" echo @@ -242,7 +242,7 @@ FUNC_ENABLE_UFW(){ FUNC_SETUP_SECURE_SSH(){ echo echo - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Base Setup: Change SSH port & Secure Authentication methods...${NC}" echo @@ -261,14 +261,14 @@ FUNC_SETUP_SECURE_SSH(){ echo echo - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Base Setup: Add new SSH port to firewall...${NC}" echo sudo ufw allow $PLI_SSH_NEW_PORT/tcp echo - echo -e "${GREEN}#########################################################################" + echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${GREEN}## Base Setup: Restart SSH service for port change to take effect...${NC}" echo diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 5fe8593..70ab271 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -14,7 +14,8 @@ sudo sh -c 'cat /tmp/plisudotmp > /etc/sudoers.d/plinode_deploy' # Set Colour Vars GREEN='\033[0;32m' RED='\033[0;31m' -YELLOW='\033[1;33m' +YELLOW='\033[0;33m' +BYELLOW='\033[1;33m' NC='\033[0m' # No Color FDATE=$(date +"%Y_%m_%d_%H_%M") @@ -347,7 +348,7 @@ FUNC_NODE_DEPLOY(){ if [ "$_OPTION" == "mainnet" ]; then - echo "${GREEN} ### Configuring node for ${NC}${YELLOW}$_OPTION${NC}${GREEN}.. ###${NC}" + echo "${GREEN} ### Configuring node for ${BYELLOW}$_OPTION${GREEN}.. ###${NC}" VARVAL_CHAIN_NAME=$mainnet_name VARVAL_CHAIN_ID=$mainnet_ChainID @@ -356,7 +357,7 @@ FUNC_NODE_DEPLOY(){ VARVAL_RPC=$mainnet_httpUrl elif [ "$_OPTION" == "apothem" ]; then - echo "${GREEN} ### Configuring node for ${NC}${YELLOW}$_OPTION${NC}${GREEN}.. ###${NC}" + echo "${GREEN} ### Configuring node for ${BYELLOW}$_OPTION${GREEN}.. ###${NC}" VARVAL_CHAIN_NAME=$testnet_name VARVAL_CHAIN_ID=$testnet_ChainID @@ -591,9 +592,9 @@ EOF echo -e "${GREEN}#########################################################################${NC}" - echo -e "${GREEN}## INFO: Install process completed for ${NC}${YELLOW}$_OPTION${NC}${GREEN} node. exiting...${NC}" + echo -e "${GREEN}## INFO: Install process completed for ${BYELLOW}$_OPTION${GREEN} node. exiting...${NC}" echo - echo -e "${GREEN}## INFO:${NC}${YELLOW}$_OPTION${NC}${GREEN} Contract Address = ${NC}${YELLOW}$VARVAL_CONTRACT_ADDR ${NC}" + echo -e "${GREEN}## INFO: ${BYELLOW}$_OPTION${GREEN} Contract Address = ${BYELLOW}$VARVAL_CONTRACT_ADDR ${NC}" echo echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}#########################################################################${NC}" @@ -636,7 +637,7 @@ FUNC_EXPORT_NODE_KEYS(){ source ~/"plinode_$(hostname -f)".vars echo echo -e "${GREEN}#########################################################################${NC}" -echo -e "${GREEN} export ${NC}${YELLOW}$_OPTION${NC}${GREEN} node keys ${NC}" +echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys ${NC}" #sudo usermod -aG postgres $(getent passwd $EUID | cut -d: -f1) @@ -646,7 +647,7 @@ echo echo -e "${RED}###### IMPORTANT FILE - NODE ADDRESS EXPORT FOR WALLET ACCESS #####${NC}" echo -e "${RED}###### IMPORTANT FILE - PLEASE SECURE APPROPRIATELY #####${NC}" echo -echo -e "${GREEN} export ${NC}${YELLOW}$_OPTION${NC}${GREEN} node keys - exporting keys to file: ~/"plinode_$(hostname -f)_keys_${FDATE}".json${NC}" +echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys - exporting keys to file: ~/"plinode_$(hostname -f)_keys_${FDATE}".json${NC}" FUNC_NODE_ADDR if [ ! -e $PLI_DEPLOY_PATH/pass ]; then @@ -656,7 +657,7 @@ fi plugin keys eth export $node_key_primary --newpassword $PLI_DEPLOY_PATH/pass --output ~/"plinode_$(hostname -f)_keys_${FDATE}".json -echo -e "${GREEN} export ${NC}${YELLOW}$_OPTION${NC}${GREEN} node keys - securing file permissions${NC}" +echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys - securing file permissions${NC}" chmod 400 ~/"plinode_$(hostname -f)_keys_${FDATE}".json @@ -737,7 +738,7 @@ FUNC_NODE_ADDR(){ IFS=$'\n' read -r -d '' -a node_keys_arr < <( plugin keys eth list | grep Address && printf '\0' ) node_key_primary=$(echo ${node_keys_arr[0]} | sed s/Address:[[:space:]]/''/) echo - echo -e "${GREEN}Your Plugin ${NC}${YELLOW}$_OPTION${NC}${GREEN} node regular address is:${NC} ${RED}$node_key_primary ${NC}" + echo -e "${GREEN}Your Plugin ${BYELLOW}$_OPTION${GREEN} node regular address is:${NC} ${RED}$node_key_primary ${NC}" echo echo -e "${GREEN}#########################################################################${NC}" } @@ -746,7 +747,7 @@ FUNC_NODE_ADDR(){ FUNC_NODE_GUI_IPADDR(){ GUI_IP=$(curl -s ipinfo.io/ip) echo - echo -e "${GREEN}Your Plugin ${NC}${YELLOW}$_OPTION${NC}${GREEN} node GUI IP address is as follows:${NC}" + echo -e "${GREEN}Your Plugin ${BYELLOW}$_OPTION${GREEN} node GUI IP address is as follows:${NC}" echo echo -e " ${RED}https://$GUI_IP:6689${NC}" echo From 00476ae058dce409030698aa19027e108c0a6bb3 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 11:22:22 +0100 Subject: [PATCH 08/18] fix colours --- pli_node_scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 70ab271..5e6176a 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -348,7 +348,7 @@ FUNC_NODE_DEPLOY(){ if [ "$_OPTION" == "mainnet" ]; then - echo "${GREEN} ### Configuring node for ${BYELLOW}$_OPTION${GREEN}.. ###${NC}" + echo -e "${GREEN} ### Configuring node for ${BYELLOW}$_OPTION${GREEN}.. ###${NC}" VARVAL_CHAIN_NAME=$mainnet_name VARVAL_CHAIN_ID=$mainnet_ChainID @@ -357,7 +357,7 @@ FUNC_NODE_DEPLOY(){ VARVAL_RPC=$mainnet_httpUrl elif [ "$_OPTION" == "apothem" ]; then - echo "${GREEN} ### Configuring node for ${BYELLOW}$_OPTION${GREEN}.. ###${NC}" + echo -e "${GREEN} ### Configuring node for ${BYELLOW}$_OPTION${GREEN}.. ###${NC}" VARVAL_CHAIN_NAME=$testnet_name VARVAL_CHAIN_ID=$testnet_ChainID From 832b6b54ac8eaa659e07f7d52e27069d82fc96a7 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 11:27:51 +0100 Subject: [PATCH 09/18] re-instate key export on completion --- pli_node_scripts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 5e6176a..70e6c4c 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -624,7 +624,7 @@ EOF FUNC_NODE_GUI_IPADDR; sleep 3s - #FUNC_EXPORT_NODE_KEYS; + FUNC_EXPORT_NODE_KEYS; FUNC_EXIT; } From 5ade517b833b83da2690ef6887f8e7b0ee49317f Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 11:32:31 +0100 Subject: [PATCH 10/18] fix colour --- pli_node_scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 70e6c4c..154ed87 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -180,11 +180,11 @@ FUNC_NODE_DEPLOY(){ echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}${NC}" - echo -e "${GREEN} GoPlugin 2.0 Validator Node - Install${NC}" + echo -e "${GREEN} GoPlugin 2.0 ${BYELLOW}$_OPTION${GREEN} Validator Node - Install${NC}" echo -e "${GREEN}${NC}" echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}#########################################################################${NC}" - + sleep 3s # Set working directory to user home folder #cd ~/ From 9b5c2a4fb33e25645c956d5f6f391135b93a35c0 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 12:07:05 +0100 Subject: [PATCH 11/18] fix colour --- pli_node_scripts.sh | 49 ++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 154ed87..4e15046 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -15,7 +15,8 @@ sudo sh -c 'cat /tmp/plisudotmp > /etc/sudoers.d/plinode_deploy' GREEN='\033[0;32m' RED='\033[0;31m' YELLOW='\033[0;33m' -BYELLOW='\033[1;33m' +BYELLOW='\033[1;33m' +BLINK='\033[33;5m' NC='\033[0m' # No Color FDATE=$(date +"%Y_%m_%d_%H_%M") @@ -585,44 +586,45 @@ EOF pm2 list sleep 2s pm2 list - #sleep 5s - + sleep 5s + clear echo echo + echo -e "${GREEN}#########################################################################${NC}" + echo + echo -e "${GREEN}####### ${BLINK}Preparing installation final details - please wait..${NC}${GREEN} #########${NC}" + echo + echo -e "${GREEN}#########################################################################${NC}" - + sleep 10s echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}## INFO: Install process completed for ${BYELLOW}$_OPTION${GREEN} node. exiting...${NC}" echo echo -e "${GREEN}## INFO: ${BYELLOW}$_OPTION${GREEN} Contract Address = ${BYELLOW}$VARVAL_CONTRACT_ADDR ${NC}" echo - echo -e "${GREEN}#########################################################################${NC}" + FUNC_NODE_ADDR; + #echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}#########################################################################${NC}" echo echo -e "${RED}## IMPORTANT INFORMATION - PLEASE RECORD TO YOUR PASSWORD SAFE${NC}" echo - echo -e "${GREEN}#########################################################################${NC}" - echo + echo -e "${GREEN}--------------------------------------------------------------------------${NC}" echo echo -e "${RED}## KEY STORE SECRET: $PASS_KEYSTORE${NC}" - echo echo -e "${RED}## POSTGRES DB PASSWORD: $DB_PWD_NEW${NC}" echo echo -e "${RED}## API USERNAME: $API_EMAIL${NC}" echo -e "${RED}## API PASSWORD: $API_PASS${NC}" echo - echo -e "${GREEN}#########################################################################${NC}" + #echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}#########################################################################${NC}" echo - echo echo -e "${GREEN}## ACTION: paste the following to update your session with updated env variables..${NC}" echo echo -e "${GREEN}## source ~/.profile${NC}" echo - echo FUNC_NODE_GUI_IPADDR; - sleep 3s FUNC_EXPORT_NODE_KEYS; FUNC_EXIT; @@ -638,17 +640,11 @@ source ~/"plinode_$(hostname -f)".vars echo echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys ${NC}" - -#sudo usermod -aG postgres $(getent passwd $EUID | cut -d: -f1) - -#echo -#echo -e "${GREEN}#########################################################################${NC}" echo -echo -e "${RED}###### IMPORTANT FILE - NODE ADDRESS EXPORT FOR WALLET ACCESS #####${NC}" -echo -e "${RED}###### IMPORTANT FILE - PLEASE SECURE APPROPRIATELY #####${NC}" +echo -e "${RED}###### IMPORTANT FILE - NODE ADDRESS EXPORT FOR WALLET ACCESS - PLEASE SECURE APPROPRIATELY #####${NC}" echo -echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys - exporting keys to file: ~/"plinode_$(hostname -f)_keys_${FDATE}".json${NC}" -FUNC_NODE_ADDR +echo -e "${GREEN} exporting keys to file: ~/"plinode_$(hostname -f)_keys_${FDATE}".json${NC}" + if [ ! -e $PLI_DEPLOY_PATH/pass ]; then echo $PASS_KEYSTORE > $PLI_DEPLOY_PATH/pass @@ -657,8 +653,7 @@ fi plugin keys eth export $node_key_primary --newpassword $PLI_DEPLOY_PATH/pass --output ~/"plinode_$(hostname -f)_keys_${FDATE}".json -echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys - securing file permissions${NC}" - +#echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys - securing file permissions${NC}" chmod 400 ~/"plinode_$(hostname -f)_keys_${FDATE}".json #chmod 600 $PLI_DEPLOY_PATH/pass @@ -737,10 +732,10 @@ FUNC_NODE_ADDR(){ node_keys_arr=() IFS=$'\n' read -r -d '' -a node_keys_arr < <( plugin keys eth list | grep Address && printf '\0' ) node_key_primary=$(echo ${node_keys_arr[0]} | sed s/Address:[[:space:]]/''/) - echo - echo -e "${GREEN}Your Plugin ${BYELLOW}$_OPTION${GREEN} node regular address is:${NC} ${RED}$node_key_primary ${NC}" - echo - echo -e "${GREEN}#########################################################################${NC}" + + echo -e "${GREEN}Your Plugin ${BYELLOW}$_OPTION${GREEN} node regular address is:${NC} ${BYELLOW}$node_key_primary ${NC}" + #echo + #echo -e "${GREEN}#########################################################################${NC}" } From 0030dde5d1d00e12d8308feb1ad17e4f2a48de5a Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 12:17:41 +0100 Subject: [PATCH 12/18] fix colour and outputs --- pli_node_scripts.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 4e15046..a11946e 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -590,19 +590,32 @@ EOF clear echo echo + echo + echo + echo + echo + echo + echo + echo echo -e "${GREEN}#########################################################################${NC}" echo - echo -e "${GREEN}####### ${BLINK}Preparing installation final details - please wait..${NC}${GREEN} #########${NC}" + echo -e "${GREEN}####### Preparing installation final details - please wait.. #########${NC}" echo echo -e "${GREEN}#########################################################################${NC}" sleep 10s + clear + echo + echo + echo + echo echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}## INFO: Install process completed for ${BYELLOW}$_OPTION${GREEN} node. exiting...${NC}" echo echo -e "${GREEN}## INFO: ${BYELLOW}$_OPTION${GREEN} Contract Address = ${BYELLOW}$VARVAL_CONTRACT_ADDR ${NC}" echo FUNC_NODE_ADDR; + echo #echo -e "${GREEN}#########################################################################${NC}" echo -e "${GREEN}#########################################################################${NC}" echo @@ -651,7 +664,7 @@ if [ ! -e $PLI_DEPLOY_PATH/pass ]; then chmod 400 $PLI_DEPLOY_PATH/pass fi -plugin keys eth export $node_key_primary --newpassword $PLI_DEPLOY_PATH/pass --output ~/"plinode_$(hostname -f)_keys_${FDATE}".json +plugin keys eth export $node_key_primary --newpassword $PLI_DEPLOY_PATH/pass --output ~/"plinode_$(hostname -f)_keys_${FDATE}".json > /dev/null 2>&1 #echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys - securing file permissions${NC}" chmod 400 ~/"plinode_$(hostname -f)_keys_${FDATE}".json @@ -728,7 +741,7 @@ EOF FUNC_NODE_ADDR(){ source ~/"plinode_$(hostname -f)".vars cd ~/$PLI_DEPLOY_DIR - plugin admin login -f $FILE_API + plugin admin login -f $FILE_API > /dev/null 2>&1 node_keys_arr=() IFS=$'\n' read -r -d '' -a node_keys_arr < <( plugin keys eth list | grep Address && printf '\0' ) node_key_primary=$(echo ${node_keys_arr[0]} | sed s/Address:[[:space:]]/''/) From 46818fd85a312787f90dc769a95e282c078142ad Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 12:29:59 +0100 Subject: [PATCH 13/18] fix colour --- pli_node_scripts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index a11946e..bb8df63 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -13,10 +13,10 @@ sudo sh -c 'cat /tmp/plisudotmp > /etc/sudoers.d/plinode_deploy' # Set Colour Vars GREEN='\033[0;32m' -RED='\033[0;31m' +#RED='\033[0;31m' +RED='\033[0;101m' YELLOW='\033[0;33m' BYELLOW='\033[1;33m' -BLINK='\033[33;5m' NC='\033[0m' # No Color FDATE=$(date +"%Y_%m_%d_%H_%M") From df18bef261a24eb97513ba063c7cfbd59fa25f3d Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 12:31:05 +0100 Subject: [PATCH 14/18] spacing --- pli_node_scripts.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index bb8df63..c81d2cd 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -657,7 +657,11 @@ echo echo -e "${RED}###### IMPORTANT FILE - NODE ADDRESS EXPORT FOR WALLET ACCESS - PLEASE SECURE APPROPRIATELY #####${NC}" echo echo -e "${GREEN} exporting keys to file: ~/"plinode_$(hostname -f)_keys_${FDATE}".json${NC}" - +echo +echo -e "${GREEN}#########################################################################${NC}" +echo +echo +echo if [ ! -e $PLI_DEPLOY_PATH/pass ]; then echo $PASS_KEYSTORE > $PLI_DEPLOY_PATH/pass From e1d8acd2bd9556949c58dbcb337e6e925ca67e6e Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 12:33:22 +0100 Subject: [PATCH 15/18] colours --- pli_node_scripts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index c81d2cd..c2e61e5 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -14,7 +14,7 @@ sudo sh -c 'cat /tmp/plisudotmp > /etc/sudoers.d/plinode_deploy' # Set Colour Vars GREEN='\033[0;32m' #RED='\033[0;31m' -RED='\033[0;101m' +RED='\033[0;91m' # Intense Red YELLOW='\033[0;33m' BYELLOW='\033[1;33m' NC='\033[0m' # No Color From cde8dd2d6d1e544d9b26fa49ca5bae895f284869 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 12:38:29 +0100 Subject: [PATCH 16/18] formatting --- pli_node_scripts.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index c2e61e5..de643d7 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -652,11 +652,11 @@ FUNC_EXPORT_NODE_KEYS(){ source ~/"plinode_$(hostname -f)".vars echo echo -e "${GREEN}#########################################################################${NC}" -echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys ${NC}" +echo -e "${GREEN}## INFO :: export ${BYELLOW}$_OPTION${GREEN} node keys ${NC}" echo echo -e "${RED}###### IMPORTANT FILE - NODE ADDRESS EXPORT FOR WALLET ACCESS - PLEASE SECURE APPROPRIATELY #####${NC}" echo -echo -e "${GREEN} exporting keys to file: ~/"plinode_$(hostname -f)_keys_${FDATE}".json${NC}" +echo -e "${GREEN}## INFO :: exporting keys to file: ~/"plinode_$(hostname -f)_keys_${FDATE}".json${NC}" echo echo -e "${GREEN}#########################################################################${NC}" echo @@ -750,7 +750,7 @@ FUNC_NODE_ADDR(){ IFS=$'\n' read -r -d '' -a node_keys_arr < <( plugin keys eth list | grep Address && printf '\0' ) node_key_primary=$(echo ${node_keys_arr[0]} | sed s/Address:[[:space:]]/''/) - echo -e "${GREEN}Your Plugin ${BYELLOW}$_OPTION${GREEN} node regular address is:${NC} ${BYELLOW}$node_key_primary ${NC}" + echo -e "${GREEN}## INFO :: Your Plugin ${BYELLOW}$_OPTION${GREEN} node regular address is:${NC} ${BYELLOW}$node_key_primary ${NC}" #echo #echo -e "${GREEN}#########################################################################${NC}" } @@ -759,7 +759,7 @@ FUNC_NODE_ADDR(){ FUNC_NODE_GUI_IPADDR(){ GUI_IP=$(curl -s ipinfo.io/ip) echo - echo -e "${GREEN}Your Plugin ${BYELLOW}$_OPTION${GREEN} node GUI IP address is as follows:${NC}" + echo -e "${GREEN}## INFO :: Your Plugin ${BYELLOW}$_OPTION${GREEN} node GUI IP address is as follows:${NC}" echo echo -e " ${RED}https://$GUI_IP:6689${NC}" echo From 0c6e0bbfc26b41918bebbfacf07949b74b166f18 Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 12:48:23 +0100 Subject: [PATCH 17/18] readme & formatting --- README.md | 21 +++++++++++++-------- pli_node_scripts.sh | 6 +++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 99cef9c..acb5e21 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ # pli2vn Modular scripts for @GoPlugin 2.0 Validator Node setup & maintenance. -__** NOTE: This deployment script is for Apothem testnet only**__ - - > **NOTE: All values used in this code are for test purposes only & deployed to a test environment that is regularly deleted.** > **NOTE: Please ensure that you update with your own values as necessary.** @@ -46,7 +43,8 @@ to successfully deploy the node. The scripts has a number of functions, one of which must be passed to run the scripts -> fullnode +> mainnet +> apothem > keys > logrotate > address @@ -59,15 +57,22 @@ The scripts has a number of functions, one of which must be passed to run the sc where {function} is one of the following; - fullnode == deploys the full node incl. external initiator & exports the node keys + mainnet == deploys the full Mainnet node & exports the node keys + apothem == deploys the full Apothem node & exports the node keys keys == extracts the node keys from DB and exports to json file logrotate == implements the logrotate conf file address == displays the local nodes address (after fullnode deploy) - required for the 'Fulfillment Request' remix step node-gui == displays the local nodes full GUI URL to copy and paste to browser -### Function: fullnode +### Function: mainnet + +As the name suggest, this executes all code to provision a full working node, on the _*Mainnet*_ chain, ready for the contract & jobs creation on remix. +This function calls all other function as part of deploying the full node. + + +### Function: apothem -As the name suggest, this executes all code to provision a full working node ready for the contract & jobs creation on remix. +As the name suggest, this executes all code to provision a full working node, on the _*Apothem*_ chain, ready for the contract & jobs creation on remix. This function calls all other function as part of deploying the full node. @@ -144,7 +149,7 @@ This script resets your VPS to a pre-deployment state, allowing you to re-instal --- -## base_sys_setup.sh (_Optional - Recommended_) +## base_sys_setup.sh Updated to use modular functions allowing for individial functions to be run or You can reveiw the 'sample.vars' file for the full list of VARIABLES. diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index de643d7..42f705e 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -599,7 +599,7 @@ EOF echo echo -e "${GREEN}#########################################################################${NC}" echo - echo -e "${GREEN}####### Preparing installation final details - please wait.. #########${NC}" + echo -e "${GREEN}####### Preparing final details - please wait.. #########${NC}" echo echo -e "${GREEN}#########################################################################${NC}" @@ -610,9 +610,9 @@ EOF echo echo echo -e "${GREEN}#########################################################################${NC}" - echo -e "${GREEN}## INFO: Install process completed for ${BYELLOW}$_OPTION${GREEN} node. exiting...${NC}" + echo -e "${GREEN}## INFO :: Install process completed for ${BYELLOW}$_OPTION${GREEN} node. exiting...${NC}" echo - echo -e "${GREEN}## INFO: ${BYELLOW}$_OPTION${GREEN} Contract Address = ${BYELLOW}$VARVAL_CONTRACT_ADDR ${NC}" + echo -e "${GREEN}## INFO :: ${BYELLOW}$_OPTION${GREEN} Contract Address = ${BYELLOW}$VARVAL_CONTRACT_ADDR ${NC}" echo FUNC_NODE_ADDR; echo From e2c6f5958b2a8f15b39410a26e5baa21f8bdc69c Mon Sep 17 00:00:00 2001 From: inv4fee2020 Date: Thu, 19 Oct 2023 13:02:30 +0100 Subject: [PATCH 18/18] export keys on reset --- pli_node_scripts.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pli_node_scripts.sh b/pli_node_scripts.sh index 42f705e..3633157 100644 --- a/pli_node_scripts.sh +++ b/pli_node_scripts.sh @@ -664,17 +664,21 @@ echo echo if [ ! -e $PLI_DEPLOY_PATH/pass ]; then - echo $PASS_KEYSTORE > $PLI_DEPLOY_PATH/pass - chmod 400 $PLI_DEPLOY_PATH/pass + #echo $PASS_KEYSTORE > $PLI_DEPLOY_PATH/pass + echo $PASS_KEYSTORE > /tmp/pass + #chmod 400 $PLI_DEPLOY_PATH/pass + chmod 400 /tmp/pass fi -plugin keys eth export $node_key_primary --newpassword $PLI_DEPLOY_PATH/pass --output ~/"plinode_$(hostname -f)_keys_${FDATE}".json > /dev/null 2>&1 +plugin keys eth export $node_key_primary --newpassword /tmp/pass --output ~/"plinode_$(hostname -f)_keys_${FDATE}".json > /dev/null 2>&1 #echo -e "${GREEN} export ${BYELLOW}$_OPTION${GREEN} node keys - securing file permissions${NC}" chmod 400 ~/"plinode_$(hostname -f)_keys_${FDATE}".json #chmod 600 $PLI_DEPLOY_PATH/pass -rm -f $PLI_DEPLOY_PATH/pass +#rm -f $PLI_DEPLOY_PATH/pass +chmod 600 /tmp/pass +rm -f /tmp/pass sleep 4s }