From 148fe76324afa7e1168a3a581d1dbfc4b9e3856c Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Wed, 2 Feb 2022 23:30:17 +0000 Subject: [PATCH 01/16] Add choices for testnets and SAFE_PORT --- comnet-install.sh | 183 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 154 insertions(+), 29 deletions(-) diff --git a/comnet-install.sh b/comnet-install.sh index 44203bd..872f0d7 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -1,61 +1,189 @@ #!/usr/bin/env bash # https://github.com/safenetwork-community # safenetwork-community -echo "********************** SAFE NODE INSTALLER *****************************************" + +## +# Color Variables +## +red='\e[31m' +green='\e[32m' +blue='\e[34m' +clear='\e[0m' + +## +# Color Functions +## + +ColorGreen(){ + echo - $green$1$clear +} +ColorBlue(){ + echo - $blue$1$clear +} +ColorRed(){ + echo - $red$1$clear +} + + + + + +clear +echo - "********************** SAFE NODE INSTALLER *****************************************" +echo "" echo "" echo "" echo "" +echo " This script will install everything needed to join the SAFE network testnets for " +echo " Ubuntu like machines" +echo " The programs lised below will be installed if required. Your root password will be required." echo "" -echo "This script will install everything needed to join the SAFE network testnets for" -echo "Ubuntu like machines" echo "" -echo " Any existing SAFE installation will be DELETED" +echo " - snap -assists in installin the dependencies" +echo " - curl -fetches the SAFE applications" +echo " - sn_cli -the SAFE client program " +echo " - safe_network -the SAFE network functionality " +echo " - moreutils -helper programs to assist in idenntifying your network settins" +echo " - build-essential -required to build vdash on top of rust " +echo " - rust -Rust is a systems programming lanuage " +echo " - vdash -vdash is a Rust program by @happybeing to monitor your SAFE node " echo "" -echo " vdash is a program by @happybeing to monitor your SAFE node. https://github.com/happybeing/vdash" -echo " Vdash requires Rust to be installed" echo "" -echo "Once everthing is installed, your node will connect to the chosen testnet and vdash will be" -echo "installed to display network and node information" echo "" +echo -ne $(ColorRed " ################# Any existing SAFE installation will be DELETED ##################") echo "" -echo "OK to proceed [y,N]" +echo "" +echo "" +echo "" +echo " Once everything is installed, your node will connect to the chosen testnet and vdash will be" +echo " configured to display network and node information" +echo "" +echo "" +echo " If you are happy with the above and have read the Readme, type 'y' to proceed [y,N]" read -r input if [[ $input == "Y" || $input == "y" ]]; then - echo "OK then, let's go." + echo " OK then, let's go." else echo "Bye now..." exit fi -read -p -r " How many Gb do you want to allocate to your vault? [5Gb]: " GB_ALLOCATED -VAULT_SIZE=${GB_ALLOCATED:-5} -echo "$VAULT_SIZE" "Gb will be allocated for storing chunks" -echo "_________________________________________________________" +echo " Which testnet do you want to connect to?" + +echo "" +echo " None of these testnets are guaranteed or even likely to be running at any given time" +echo " Please refer to threads on https://safenetforum.org for current news on live testnets." + +echo "" +echo " 1 sjefolaht" +echo " 2 comnet" +echo " 3 southsidenet" +echo " 4 playground" +echo "" +echo "" +echo " Please select 1, 2, 3 or 4" +read SAFENET_CHOICE +echo "" + +case $SAFENET_CHOICE in + + 1) + SAFENET=sjefolaht + CONFIG_URL=https://link.tardigradeshare.io/s/julx763rsy2egbnj2nixoahpobgq/rezosur/koqfig/sjefolaht_node_connection_info.config?wrap=0 + + ;; + + 2) SAFENET=comnet + CONFIG_URL=https://sn-comnet.s3.eu-west-2.amazonaws.com/node_connection_info.config + ;; + + 3) + SAFENET=southsidenet + CONFIG_URL=https://comnet.snawaffadyke.com/southsidenet.config + + ;; + + 4) + SAFENET=playground + CONFIG_URL=https://safe-testnet-tool.s3.eu-west-2.amazonaws.com/public-node_connection_info.config + + ;; + + + *) + echo " Invalid selection, please choose 1-4 to select a testnet" + ;; +esac +echo "" +echo " Your node will attempt to connect to "$SAFENET +echo "" + + +echo " For some testnets, it will be necessary to allocate a fixed size for your vault." +echo " Again please refer to threads on https://safenetforum.org for details. If no size" +echo " is specified, 5GB will be selected as default." + +GB_ALLOCATED=5 +read -e -i "$GB_ALLOCATED" -p ' How many GB do you want to allocate to your vault? [5]' GB_ALLOCATED +VAULT_SIZE=${GB_ALLOCATED} +echo " $VAULT_SIZE" "GB will be allocated for storing chunks" + +echo "" +echo "" +echo "" +echo "" +echo " Certain setups may require the default port that SAFE uses to be changed" +echo " Most users will be OK with the default port at 12000 " +echo " Only change this if you know what you are doing." +echo "" +SAFE_PORT=12000 +read -e -i "$SAFE_PORT" -p ' Press Enter to accept the default or edit it here [12000]' #SAFE_PORT +echo $SAFE_PORT + +sleep 2 -sudo apt -qq update >/dev/null -sudo apt -qq install -y snapd build-essential moreutils >/dev/null +echo "" +echo "" +echo "" +echo "" +echo " Now installing SAFE and all necessary dependencies." +echo " This may take a few minutes depending on your download speed " +echo " Thank you for your patience " +echo "" +echo " The world has waited a long time for SAFE - just a few seconds more...." + +#exit + +#sudo apt -qq update >/dev/null +#sudo apt -qq install -y snapd build-essential moreutils >/dev/null sudo snap install curl +sudo snap install rustup --classic +rustup toolchain install stable +cargo install vdash + + + PATH=$PATH:/$HOME/.safe/cli:$HOME/.cargo/bin ACTIVE_IF=$( ( cd /sys/class/net || exit; echo *)|awk '{print $1;}') LOCAL_IP=$(echo $(ifdata -pa "$ACTIVE_IF")) PUBLIC_IP=$(echo $(curl -s ifconfig.me)) -SAFE_PORT=12000 -SAFENET=southsidenet -#CONFIG_URL=https://link.tardigradeshare.io/s/julx763rsy2egbnj2nixoahpobgq/rezosur/koqfig/sjefolaht_node_connection_info.config?wrap=0 -#CONFIG_URL=https://sn-comnet.s3.eu-west-2.amazonaws.com/node_connection_info.config +SAFE_PORT=$SAFE_PORT VAULT_SIZE=$((1024*1024*1024*$GB_ALLOCATED)) LOG_DIR=$HOME/.safe/node/local_node SN_CLI_QUERY_TIMEOUT=3600 # Install Safe software and configuration -rm -rf "$HOME"/.safe # clear out any old files +#rm -rf "$HOME"/.safe # clear out any old files #get the CLI curl -so- https://raw.githubusercontent.com/maidsafe/safe_network/master/resources/scripts/install.sh | bash +echo "" +echo "" +echo "" echo $(safe --version) "install complete" safe networks add $SAFENET "$CONFIG_URL" @@ -63,11 +191,11 @@ safe networks switch $SAFENET safe networks sleep 2 safe node install +echo "" +echo "" +echo "" echo $(safe node bin-version) "install complete" - -echo "SAFE Node install completed" - # Join a node from home echo "Attempting to join the '$SAFENET' network using the following parameters" @@ -89,17 +217,14 @@ RUST_LOG=safe_network=trace,qp2p=info \ #clear echo "_____________________________________________________________________________________________________" echo "" -echo " Now installing rust and vdash from @happybeing" +echo " Now cofiguring vdash from @happybeing" echo "" echo "" echo " press 'q' to quit vdash --- this will not interfere with your node ---" - echo "" sleep 3 # Install or update vdash -sudo snap install rustup --classic -rustup toolchain install stable -cargo install vdash + vdash "$LOG_DIR"/sn_node.log From 4d868225aa8e1e07f26d29b979d833370b68728c Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Thu, 3 Feb 2022 22:50:29 +0000 Subject: [PATCH 02/16] Update comnet-install.sh --- comnet-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comnet-install.sh b/comnet-install.sh index 872f0d7..b3d2bf7 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -29,7 +29,7 @@ ColorRed(){ clear -echo - "********************** SAFE NODE INSTALLER *****************************************" +echo "********************** SAFE NODE INSTALLER *****************************************" echo "" echo "" echo "" From dd34b076758247aeeb94d22501b46e8cffdb37cb Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Fri, 4 Feb 2022 17:22:04 +0000 Subject: [PATCH 03/16] Update comnet-install.sh please wait for download line is now in blue --- comnet-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comnet-install.sh b/comnet-install.sh index b3d2bf7..9d24f24 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -151,7 +151,7 @@ echo " Now installing SAFE and all necessary dependencies." echo " This may take a few minutes depending on your download speed " echo " Thank you for your patience " echo "" -echo " The world has waited a long time for SAFE - just a few seconds more...." +echo -ne $(ColorBlue " The world has waited a long time for SAFE - just a few seconds more....") #exit From 83cc3776b4dd56713c45fca75a37fecde1fad310 Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Fri, 4 Feb 2022 18:41:12 +0000 Subject: [PATCH 04/16] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f29fa8..96c8cd3 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,14 @@ community testing for the SAFE network This is only for Ubuntu-like distros at the moment. A script for a relative n00b to quickly get the safe cli and node binaries installed, connect to a test net and use vdash to monitor their node. -This is nowhere near ready for use at the moment. All advice and PRs welcome +All advice and PRs are very welcome. This script will install everything needed to join the SAFE network testnets for -Ubuntu like machines. +Ubuntu like machines. The minimum amount of configuration will be done to get a working solution. + +The following packages will be installed/updated if they do not already exist on the target machine - curl - sn_cli From fa15c3794483b0e48f61fe49dd9420028c89d68a Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Fri, 4 Feb 2022 18:45:37 +0000 Subject: [PATCH 05/16] Update comnet-install.sh Add neiks code to run the node as a service to prevent accidental disconnection if the terminal is closed --- comnet-install.sh | 60 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/comnet-install.sh b/comnet-install.sh index 9d24f24..b41d918 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -137,9 +137,17 @@ echo " Certain setups may require the default port that SAFE uses t echo " Most users will be OK with the default port at 12000 " echo " Only change this if you know what you are doing." echo "" + +#####################################################################################################################################change for default port +#SAFE_PORT=12000 +#read -e -i "$SAFE_PORT" -p ' Press Enter to accept the default or edit it here [12000]' #SAFE_PORT +#echo $SAFE_PORT + SAFE_PORT=12000 -read -e -i "$SAFE_PORT" -p ' Press Enter to accept the default or edit it here [12000]' #SAFE_PORT +read -e -i "$name" -p " Press Enter to accept the default or edit it here $SAFE_PORT " input +SAFE_PORT="${input:-$SAFE_PORT}" echo $SAFE_PORT +########################################################################################################################################################### sleep 2 @@ -151,7 +159,7 @@ echo " Now installing SAFE and all necessary dependencies." echo " This may take a few minutes depending on your download speed " echo " Thank you for your patience " echo "" -echo -ne $(ColorBlue " The world has waited a long time for SAFE - just a few seconds more....") +echo " The world has waited a long time for SAFE - just a few seconds more...." #exit @@ -177,7 +185,7 @@ SN_CLI_QUERY_TIMEOUT=3600 # Install Safe software and configuration -#rm -rf "$HOME"/.safe # clear out any old files +rm -rf "$HOME"/.safe # clear out any old files #get the CLI curl -so- https://raw.githubusercontent.com/maidsafe/safe_network/master/resources/scripts/install.sh | bash @@ -206,13 +214,47 @@ echo "--public-addr" "$PUBLIC_IP"":"$SAFE_PORT echo "--log-dir" "$LOG_DIR" echo "--skip-auto-port-forwarding" + +############################neik proposal to run as service ################################################################################################### + +#RUST_LOG=safe_network=trace,qp2p=info \ +# ~/.safe/node/sn_node \ +# --max-capacity $VAULT_SIZE \ +# --local-addr "$LOCAL_IP":$SAFE_PORT \ +# --public-addr "$PUBLIC_IP":$SAFE_PORT \ +# --skip-auto-port-forwarding \ +# --log-dir "$LOG_DIR" & disown + +# start as service + +safe node killall +sudo systemctl stop sn_node.service + +echo -n "#!/bin/bash RUST_LOG=safe_network=trace,qp2p=info \ - ~/.safe/node/sn_node \ - --max-capacity $VAULT_SIZE \ - --local-addr "$LOCAL_IP":$SAFE_PORT \ - --public-addr "$PUBLIC_IP":$SAFE_PORT \ - --skip-auto-port-forwarding \ - --log-dir "$LOG_DIR" + ~/.safe/node/sn_node \ + --max-capacity $VAULT_SIZE \ + --local-addr "$LOCAL_IP":$SAFE_PORT \ + --public-addr "$PUBLIC_IP":$SAFE_PORT \ + --skip-auto-port-forwarding \ + --log-dir "$LOG_DIR" & disown"\ +| tee ~/.safe/node/start-node.sh + +chmod u+x ~/.safe/node/start-node.sh + +echo -n "[Unit] +Description=Safe Node +[Service] +User=$USER +ExecStart=/home/$USER/.safe/node/start-node.sh +RemainAfterExit=yes +[Install] +WantedBy=multi-user.target"\ +|sudo tee /etc/systemd/system/sn_node.service + +sudo systemctl start sn_node.service + +#################################################################################################################################################################### #clear echo "_____________________________________________________________________________________________________" From 767a9584afbc8ac6ad75d6079bbc6085b906699d Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Fri, 4 Feb 2022 21:51:32 +0000 Subject: [PATCH 06/16] Update comnet-install.sh Cosmetic tweaks --- comnet-install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/comnet-install.sh b/comnet-install.sh index b41d918..fc7e559 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -159,9 +159,10 @@ echo " Now installing SAFE and all necessary dependencies." echo " This may take a few minutes depending on your download speed " echo " Thank you for your patience " echo "" -echo " The world has waited a long time for SAFE - just a few seconds more...." +echo -ne $(ColorBlue " The world has waited a long time for SAFE - just a few seconds more....") +echo "" +echo "" -#exit #sudo apt -qq update >/dev/null #sudo apt -qq install -y snapd build-essential moreutils >/dev/null From 3e7cd27383d47454f626c9d25b548fb38a3014e1 Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Fri, 4 Feb 2022 23:02:25 +0000 Subject: [PATCH 07/16] Update comnet-install.sh stupid error leaving debug # in the code stopped curl running --- comnet-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comnet-install.sh b/comnet-install.sh index fc7e559..595ec18 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -164,8 +164,8 @@ echo "" echo "" -#sudo apt -qq update >/dev/null -#sudo apt -qq install -y snapd build-essential moreutils >/dev/null +sudo apt -qq update >/dev/null +sudo apt -qq install -y snapd build-essential moreutils >/dev/null sudo snap install curl sudo snap install rustup --classic rustup toolchain install stable From 3afc9066986941afaacc126f2e0f33fc596b9a6f Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Sat, 12 Feb 2022 00:59:36 +0000 Subject: [PATCH 08/16] initial commit on neik-build-from-source @neilgcns proposals to build from source with rust-latest --- comnet-install.sh | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/comnet-install.sh b/comnet-install.sh index 595ec18..70a511f 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -95,7 +95,7 @@ case $SAFENET_CHOICE in ;; 2) SAFENET=comnet - CONFIG_URL=https://sn-comnet.s3.eu-west-2.amazonaws.com/node_connection_info.config + CONFIG_URL=https://sn-comnet.s3.eu-west-2.amazonaws.com/node_connection_info_knife_edge.config ;; 3) @@ -159,16 +159,21 @@ echo " Now installing SAFE and all necessary dependencies." echo " This may take a few minutes depending on your download speed " echo " Thank you for your patience " echo "" -echo -ne $(ColorBlue " The world has waited a long time for SAFE - just a few seconds more....") -echo "" -echo "" +echo " The world has waited a long time for SAFE - just a few seconds more...." +#exit -sudo apt -qq update >/dev/null -sudo apt -qq install -y snapd build-essential moreutils >/dev/null +#sudo apt -qq update >/dev/null +#sudo apt -qq install -y snapd build-essential moreutils >/dev/null sudo snap install curl -sudo snap install rustup --classic -rustup toolchain install stable +#sudo snap install rustup --classic +#rustup toolchain install stable +##########################################install and remove rust ################### +sudo snap remove rustup + +##############################install rust +curl https://sh.rustup.rs -sSf | sh -Y + cargo install vdash @@ -227,6 +232,17 @@ echo "--skip-auto-port-forwarding" # --log-dir "$LOG_DIR" & disown # start as service +##########################################upgrade to latest##################### +rm ~/.safe/cli/safe +rm ~/.safe/node/sn_node + +git clone https://github.com/maidsafe/safe_network.git ~/.safe/github +cd ~/.safe/github +cargo build --release +cp ~/.safe/github/target/release/safe ~/.safe/cli/safe +cp ~/.safe/github//target/release/sn_node ~/.safe/node/sn_node + +################################################################################# safe node killall sudo systemctl stop sn_node.service @@ -263,11 +279,4 @@ echo "" echo " Now cofiguring vdash from @happybeing" echo "" echo "" -echo " press 'q' to quit vdash --- this will not interfere with your node ---" -echo "" - -sleep 3 - -# Install or update vdash - -vdash "$LOG_DIR"/sn_node.log +echo " press 'q' to quit vdash --- t From 86b86e812fa84216e898a57dad95363e75387d38 Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Sat, 12 Feb 2022 15:39:10 +0000 Subject: [PATCH 09/16] Update comnet-install.sh removed many commented outt lines changede rust to latest from stable --- comnet-install.sh | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/comnet-install.sh b/comnet-install.sh index 70a511f..30dda79 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -98,7 +98,7 @@ case $SAFENET_CHOICE in CONFIG_URL=https://sn-comnet.s3.eu-west-2.amazonaws.com/node_connection_info_knife_edge.config ;; - 3) + 3)https://www.youtube.com/results?search_query=celtic+highlights SAFENET=southsidenet CONFIG_URL=https://comnet.snawaffadyke.com/southsidenet.config @@ -134,15 +134,11 @@ echo "" echo "" echo "" echo " Certain setups may require the default port that SAFE uses to be changed" -echo " Most users will be OK with the default port at 12000 " -echo " Only change this if you know what you are doing." +echo " Most users will be OK with the default port at 12000 "https://www.youtube.com/results?search_query=celtic+highlights +echo " Only change this if you know exactly what you are doing." echo "" #####################################################################################################################################change for default port -#SAFE_PORT=12000 -#read -e -i "$SAFE_PORT" -p ' Press Enter to accept the default or edit it here [12000]' #SAFE_PORT -#echo $SAFE_PORT - SAFE_PORT=12000 read -e -i "$name" -p " Press Enter to accept the default or edit it here $SAFE_PORT " input SAFE_PORT="${input:-$SAFE_PORT}" @@ -159,20 +155,16 @@ echo " Now installing SAFE and all necessary dependencies." echo " This may take a few minutes depending on your download speed " echo " Thank you for your patience " echo "" -echo " The world has waited a long time for SAFE - just a few seconds more...." +echo -ne $(ColorBlue " The world has waited a long time for SAFE - just a few seconds more....") #exit #sudo apt -qq update >/dev/null -#sudo apt -qq install -y snapd build-essential moreutils >/dev/null +sudo apt -qq install -y snapd build-essential moreutils >/dev/null sudo snap install curl -#sudo snap install rustup --classic -#rustup toolchain install stable -##########################################install and remove rust ################### -sudo snap remove rustup +sudo snap install rustup --classic +rustup toolchain install latest -##############################install rust -curl https://sh.rustup.rs -sSf | sh -Y cargo install vdash @@ -221,18 +213,8 @@ echo "--log-dir" "$LOG_DIR" echo "--skip-auto-port-forwarding" -############################neik proposal to run as service ################################################################################################### - -#RUST_LOG=safe_network=trace,qp2p=info \ -# ~/.safe/node/sn_node \ -# --max-capacity $VAULT_SIZE \ -# --local-addr "$LOCAL_IP":$SAFE_PORT \ -# --public-addr "$PUBLIC_IP":$SAFE_PORT \ -# --skip-auto-port-forwarding \ -# --log-dir "$LOG_DIR" & disown - # start as service -##########################################upgrade to latest##################### +############ upgrade to latest ##################### rm ~/.safe/cli/safe rm ~/.safe/node/sn_node From 78e33dab3ab9a04c2ca53f29aa38c1ceb6794ae7 Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Sat, 12 Feb 2022 15:40:48 +0000 Subject: [PATCH 10/16] Delete shellcheck.txt tidy up --- shellcheck.txt | 126 ------------------------------------------------- 1 file changed, 126 deletions(-) delete mode 100644 shellcheck.txt diff --git a/shellcheck.txt b/shellcheck.txt deleted file mode 100644 index 76a5f8f..0000000 --- a/shellcheck.txt +++ /dev/null @@ -1,126 +0,0 @@ -$ shellcheck myscript - -Line 22: -read input -^-- SC2162 (info): read without -r will mangle backslashes. - -Line 31: -read -p " How many Gb do you want to allocate to your vault? [5Gb]: " GB_ALLOCATED -^-- SC2162 (info): read without -r will mangle backslashes. - -Line 33: -echo $VAULT_SIZE "Gb will be allocated for storing chunks" - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) -echo "$VAULT_SIZE" "Gb will be allocated for storing chunks" - -Line 42: -ACTIVE_IF=$((cd /sys/class/net; echo *)|awk '{print $1;}') - ^-- SC1102 (error): Shells disambiguate $(( differently or not at all. For $(command substitution), add space after $( . For $((arithmetics)), fix parsing errors. - ^-- SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. - -Did you mean: (apply this, apply all SC2164) -ACTIVE_IF=$((cd /sys/class/net || exit; echo *)|awk '{print $1;}') - -Line 43: -LOCAL_IP=$(echo `ifdata -pa $ACTIVE_IF`) - ^-- SC2046 (warning): Quote this to prevent word splitting. - ^-- SC2005 (style): Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. - ^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`. - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2006, apply all SC2086) -LOCAL_IP=$(echo $(ifdata -pa "$ACTIVE_IF")) - -Line 44: -PUBLIC_IP=$(echo `curl -s ifconfig.me`) - ^-- SC2046 (warning): Quote this to prevent word splitting. - ^-- SC2005 (style): Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. - ^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`. - -Did you mean: (apply this, apply all SC2006) -PUBLIC_IP=$(echo $(curl -s ifconfig.me)) - -Line 47: -CONFIG_URL=https://link.tardigradeshare.io/s/julx763rsy2egbnj2nixoahpobgq/rezosur/koqfig/sjefolaht_node_connection_info.config?wrap=0 - ^-- SC2125 (warning): Brace expansions and globs are literal in assignments. Quote it or use an array. - -Line 49: -VAULT_SIZE=$((1024*1024*1024*$GB_ALLOCATED)) - ^-- SC2004 (style): $/${} is unnecessary on arithmetic variables. - -Line 51: -SN_CLI_QUERY_TIMEOUT=3600 -^-- SC2034 (warning): SN_CLI_QUERY_TIMEOUT appears unused. Verify use (or export if used externally). - -Line 55: -rm -rf $HOME/.safe # clear out any old files - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) -rm -rf "$HOME"/.safe # clear out any old files - -Line 59: -echo $(safe --version) "install complete" - ^-- SC2046 (warning): Quote this to prevent word splitting. - -Line 61: -safe networks add $SAFENET $CONFIG_URL - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) -safe networks add $SAFENET "$CONFIG_URL" - -Line 66: -echo $(safe node bin-version) "install complete" - ^-- SC2046 (warning): Quote this to prevent word splitting. - -Line 76: -echo "--local-addr" $LOCAL_IP":"$SAFE_PORT - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) -echo "--local-addr" "$LOCAL_IP"":"$SAFE_PORT - -Line 77: -echo "--public-addr" $PUBLIC_IP":"$SAFE_PORT - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) -echo "--public-addr" "$PUBLIC_IP"":"$SAFE_PORT - -Line 78: -echo "--log-dir" $LOG_DIR - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) -echo "--log-dir" "$LOG_DIR" - -Line 84: - --local-addr $LOCAL_IP:$SAFE_PORT \ - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) - --local-addr "$LOCAL_IP":$SAFE_PORT \ - -Line 85: - --public-addr $PUBLIC_IP:$SAFE_PORT \ - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) - --public-addr "$PUBLIC_IP":$SAFE_PORT \ - -Line 87: - --log-dir $LOG_DIR - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) - --log-dir "$LOG_DIR" - -Line 105: -vdash $LOG_DIR/sn_node.log - ^-- SC2086 (info): Double quote to prevent globbing and word splitting. - -Did you mean: (apply this, apply all SC2086) -vdash "$LOG_DIR"/sn_node.log From 6e2ac6eb021f6679ad02e3b86df007173a6816cb Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Sat, 12 Feb 2022 17:21:19 +0000 Subject: [PATCH 11/16] Update comnet-install.sh changed temp install dir --- comnet-install.sh | 73 +++++++++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/comnet-install.sh b/comnet-install.sh index 30dda79..f997534 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -94,11 +94,11 @@ case $SAFENET_CHOICE in ;; - 2) SAFENET=comnet + 2) SAFENET=comnet-edgy CONFIG_URL=https://sn-comnet.s3.eu-west-2.amazonaws.com/node_connection_info_knife_edge.config ;; - 3)https://www.youtube.com/results?search_query=celtic+highlights + 3) SAFENET=southsidenet CONFIG_URL=https://comnet.snawaffadyke.com/southsidenet.config @@ -134,11 +134,15 @@ echo "" echo "" echo "" echo " Certain setups may require the default port that SAFE uses to be changed" -echo " Most users will be OK with the default port at 12000 "https://www.youtube.com/results?search_query=celtic+highlights -echo " Only change this if you know exactly what you are doing." +echo " Most users will be OK with the default port at 12000 " +echo " Only change this if you know what you are doing." echo "" #####################################################################################################################################change for default port +#SAFE_PORT=12000 +#read -e -i "$SAFE_PORT" -p ' Press Enter to accept the default or edit it here [12000]' #SAFE_PORT +#echo $SAFE_PORT + SAFE_PORT=12000 read -e -i "$name" -p " Press Enter to accept the default or edit it here $SAFE_PORT " input SAFE_PORT="${input:-$SAFE_PORT}" @@ -154,18 +158,33 @@ echo "" echo " Now installing SAFE and all necessary dependencies." echo " This may take a few minutes depending on your download speed " echo " Thank you for your patience " -echo "" -echo -ne $(ColorBlue " The world has waited a long time for SAFE - just a few seconds more....") +echo "" +echo -ne $(ColorBlue " The world has waited a long time for SAFE - just a few seconds more....") +echo "" +echo "" -#exit -#sudo apt -qq update >/dev/null -sudo apt -qq install -y snapd build-essential moreutils >/dev/null +sudo apt -qq update >/dev/null +sudo apt -qq install -y snapd build-essential moreutils tree >/dev/null sudo snap install curl sudo snap install rustup --classic -rustup toolchain install latest +rustup toolchain install stable + + +mkdir -p \ + $HOME/github-tmp \ + $HOME/.safe/cli \ + $HOME/.safe/node + +git clone https://github.com/maidsafe/safe_network.git ~/github-tmp/ +cd ~/github-tmp +cargo build --release +cp ~/github-tmp/target/release/safe ~/.safe/cli/ +cp ~/github-tmp/target/release/sn_node ~/.safe/node/ +tree $HOME/.safe +sleep 5 cargo install vdash @@ -183,14 +202,14 @@ SN_CLI_QUERY_TIMEOUT=3600 # Install Safe software and configuration -rm -rf "$HOME"/.safe # clear out any old files +#rm -rf "$HOME"/.safe # clear out any old files #get the CLI -curl -so- https://raw.githubusercontent.com/maidsafe/safe_network/master/resources/scripts/install.sh | bash +#curl -so- https://raw.githubusercontent.com/maidsafe/safe_network/master/resources/scripts/install.sh | bash echo "" echo "" echo "" -echo $(safe --version) "install complete" +#echo $(safe --version) "install complete" safe networks add $SAFENET "$CONFIG_URL" safe networks switch $SAFENET @@ -213,18 +232,17 @@ echo "--log-dir" "$LOG_DIR" echo "--skip-auto-port-forwarding" -# start as service -############ upgrade to latest ##################### -rm ~/.safe/cli/safe -rm ~/.safe/node/sn_node +############################neik proposal to run as service ################################################################################################### -git clone https://github.com/maidsafe/safe_network.git ~/.safe/github -cd ~/.safe/github -cargo build --release -cp ~/.safe/github/target/release/safe ~/.safe/cli/safe -cp ~/.safe/github//target/release/sn_node ~/.safe/node/sn_node +#RUST_LOG=safe_network=trace,qp2p=info \ +# ~/.safe/node/sn_node \ +# --max-capacity $VAULT_SIZE \ +# --local-addr "$LOCAL_IP":$SAFE_PORT \ +# --public-addr "$PUBLIC_IP":$SAFE_PORT \ +# --skip-auto-port-forwarding \ +# --log-dir "$LOG_DIR" & disown -################################################################################# +# start as service safe node killall sudo systemctl stop sn_node.service @@ -261,4 +279,11 @@ echo "" echo " Now cofiguring vdash from @happybeing" echo "" echo "" -echo " press 'q' to quit vdash --- t +echo " press 'q' to quit vdash --- this will not interfere with your node ---" +echo "" + +sleep 3 + +# Install or update vdash + +vdash "$LOG_DIR"/sn_node.log From cdd2fb9a50b8f5ae2d9fc2c1235a5edd85244302 Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Sun, 13 Feb 2022 03:02:49 +0000 Subject: [PATCH 12/16] Update comnet-install.sh latest changes to build from github --- comnet-install.sh | 88 ++++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 39 deletions(-) diff --git a/comnet-install.sh b/comnet-install.sh index f997534..cc03ebc 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -94,8 +94,8 @@ case $SAFENET_CHOICE in ;; - 2) SAFENET=comnet-edgy - CONFIG_URL=https://sn-comnet.s3.eu-west-2.amazonaws.com/node_connection_info_knife_edge.config + 2) SAFENET=comnet + CONFIG_URL=https://sn-comnet.s3.eu-west-2.amazonaws.com/node_connection_info.config ;; 3) @@ -133,20 +133,21 @@ echo "" echo "" echo "" echo "" -echo " Certain setups may require the default port that SAFE uses to be changed" -echo " Most users will be OK with the default port at 12000 " -echo " Only change this if you know what you are doing." +echo " Certain setups may require the default SAFE port to be changed" +echo " Almost all users will be OK with the default port at 12000 " +echo " Only change this if you really know what you are doing." echo "" -#####################################################################################################################################change for default port -#SAFE_PORT=12000 -#read -e -i "$SAFE_PORT" -p ' Press Enter to accept the default or edit it here [12000]' #SAFE_PORT -#echo $SAFE_PORT + SAFE_PORT=12000 read -e -i "$name" -p " Press Enter to accept the default or edit it here $SAFE_PORT " input SAFE_PORT="${input:-$SAFE_PORT}" echo $SAFE_PORT +echo "" +echo "" +echo "" +echo "" ########################################################################################################################################################### sleep 2 @@ -162,7 +163,19 @@ echo "" echo -ne $(ColorBlue " The world has waited a long time for SAFE - just a few seconds more....") echo "" echo "" +echo "" +echo "" +echo " Please ignore warning about apt" +echo "" + +TMP_GH_DIR=$HOME/github-tmp +rm -rf "$HOME"/.safe # clear out any old files + +if [[ -d "$TMP_GH_DIR" ]] +then + rm -rf $TMP_GH_DIR +fi sudo apt -qq update >/dev/null sudo apt -qq install -y snapd build-essential moreutils tree >/dev/null @@ -170,31 +183,31 @@ sudo snap install curl sudo snap install rustup --classic rustup toolchain install stable - mkdir -p \ - $HOME/github-tmp \ + $TMP_GH_DIR \ $HOME/.safe/cli \ $HOME/.safe/node -git clone https://github.com/maidsafe/safe_network.git ~/github-tmp/ +PATH=$PATH:/$HOME/.safe/cli:$HOME/.cargo/bin + +git clone https://github.com/maidsafe/safe_network.git $TMP_GH_DIR cd ~/github-tmp cargo build --release -cp ~/github-tmp/target/release/safe ~/.safe/cli/ -cp ~/github-tmp/target/release/sn_node ~/.safe/node/ -tree $HOME/.safe +cp $TMP_GH_DIR/target/release/safe ~/.safe/cli/ +cp $TMP_GH_DIR/target/release/sn_node ~/.safe/node/ +echo $(safe --version) "CLI install complete" +echo $(safe node bin-version) "Node install complete" +sleep 2 +tree $HOME/.safe +sleep 3 -sleep 5 cargo install vdash - - -PATH=$PATH:/$HOME/.safe/cli:$HOME/.cargo/bin - ACTIVE_IF=$( ( cd /sys/class/net || exit; echo *)|awk '{print $1;}') -LOCAL_IP=$(echo $(ifdata -pa "$ACTIVE_IF")) -PUBLIC_IP=$(echo $(curl -s ifconfig.me)) +LOCAL_IP=$(ifdata -pa "$ACTIVE_IF") +PUBLIC_IP=$(curl -s ifconfig.me) SAFE_PORT=$SAFE_PORT VAULT_SIZE=$((1024*1024*1024*$GB_ALLOCATED)) LOG_DIR=$HOME/.safe/node/local_node @@ -202,20 +215,20 @@ SN_CLI_QUERY_TIMEOUT=3600 # Install Safe software and configuration -#rm -rf "$HOME"/.safe # clear out any old files + #get the CLI #curl -so- https://raw.githubusercontent.com/maidsafe/safe_network/master/resources/scripts/install.sh | bash echo "" echo "" echo "" -#echo $(safe --version) "install complete" + safe networks add $SAFENET "$CONFIG_URL" safe networks switch $SAFENET safe networks sleep 2 -safe node install +#safe node install echo "" echo "" echo "" @@ -231,17 +244,6 @@ echo "--public-addr" "$PUBLIC_IP"":"$SAFE_PORT echo "--log-dir" "$LOG_DIR" echo "--skip-auto-port-forwarding" - -############################neik proposal to run as service ################################################################################################### - -#RUST_LOG=safe_network=trace,qp2p=info \ -# ~/.safe/node/sn_node \ -# --max-capacity $VAULT_SIZE \ -# --local-addr "$LOCAL_IP":$SAFE_PORT \ -# --public-addr "$PUBLIC_IP":$SAFE_PORT \ -# --skip-auto-port-forwarding \ -# --log-dir "$LOG_DIR" & disown - # start as service safe node killall @@ -270,6 +272,7 @@ WantedBy=multi-user.target"\ |sudo tee /etc/systemd/system/sn_node.service sudo systemctl start sn_node.service +#sudo systemctl status sn_node.service #################################################################################################################################################################### @@ -279,9 +282,16 @@ echo "" echo " Now cofiguring vdash from @happybeing" echo "" echo "" -echo " press 'q' to quit vdash --- this will not interfere with your node ---" -echo "" - +echo " press 'q' to quit vdash --- this will not stop your node ---" +echo "" +echo "" +echo " TODO - further commands for vdash" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" sleep 3 # Install or update vdash From 610b82e74e721de812a093409de34c7d4f1c3940 Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Sun, 13 Feb 2022 03:13:16 +0000 Subject: [PATCH 13/16] Update comnet-install.sh tidy up comments blank lines move binary install commands o facilitate menu choice --- comnet-install.sh | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/comnet-install.sh b/comnet-install.sh index cc03ebc..e550b89 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -24,10 +24,6 @@ ColorRed(){ echo - $red$1$clear } - - - - clear echo "********************** SAFE NODE INSTALLER *****************************************" echo "" @@ -44,6 +40,7 @@ echo " - curl -fetches the SAFE applications" echo " - sn_cli -the SAFE client program " echo " - safe_network -the SAFE network functionality " echo " - moreutils -helper programs to assist in idenntifying your network settins" +echo " - tree -needed to show the ~/.safe directory structure" echo " - build-essential -required to build vdash on top of rust " echo " - rust -Rust is a systems programming lanuage " echo " - vdash -vdash is a Rust program by @happybeing to monitor your SAFE node " @@ -109,17 +106,15 @@ case $SAFENET_CHOICE in CONFIG_URL=https://safe-testnet-tool.s3.eu-west-2.amazonaws.com/public-node_connection_info.config ;; - - + *) echo " Invalid selection, please choose 1-4 to select a testnet" ;; esac + echo "" echo " Your node will attempt to connect to "$SAFENET -echo "" - - +eho "" echo " For some testnets, it will be necessary to allocate a fixed size for your vault." echo " Again please refer to threads on https://safenetforum.org for details. If no size" echo " is specified, 5GB will be selected as default." @@ -128,7 +123,6 @@ GB_ALLOCATED=5 read -e -i "$GB_ALLOCATED" -p ' How many GB do you want to allocate to your vault? [5]' GB_ALLOCATED VAULT_SIZE=${GB_ALLOCATED} echo " $VAULT_SIZE" "GB will be allocated for storing chunks" - echo "" echo "" echo "" @@ -138,8 +132,6 @@ echo " Almost all users will be OK with the default port at 12000 " echo " Only change this if you really know what you are doing." echo "" - - SAFE_PORT=12000 read -e -i "$name" -p " Press Enter to accept the default or edit it here $SAFE_PORT " input SAFE_PORT="${input:-$SAFE_PORT}" @@ -148,7 +140,6 @@ echo "" echo "" echo "" echo "" -########################################################################################################################################################### sleep 2 @@ -204,7 +195,6 @@ sleep 3 cargo install vdash - ACTIVE_IF=$( ( cd /sys/class/net || exit; echo *)|awk '{print $1;}') LOCAL_IP=$(ifdata -pa "$ACTIVE_IF") PUBLIC_IP=$(curl -s ifconfig.me) @@ -215,20 +205,18 @@ SN_CLI_QUERY_TIMEOUT=3600 # Install Safe software and configuration - - #get the CLI #curl -so- https://raw.githubusercontent.com/maidsafe/safe_network/master/resources/scripts/install.sh | bash +#safe node install echo "" echo "" echo "" - safe networks add $SAFENET "$CONFIG_URL" safe networks switch $SAFENET safe networks sleep 2 -#safe node install + echo "" echo "" echo "" @@ -274,8 +262,6 @@ WantedBy=multi-user.target"\ sudo systemctl start sn_node.service #sudo systemctl status sn_node.service -#################################################################################################################################################################### - #clear echo "_____________________________________________________________________________________________________" echo "" From 079c677c7e23ec91b4284d7f45680358e6533122 Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Sun, 13 Feb 2022 03:24:13 +0000 Subject: [PATCH 14/16] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 96c8cd3..a6b66e6 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The following packages will be installed/updated if they do not already exist on - sn_cli - safe_network - moreutils +- tree - build-essential - rust - vdash From 8f47dff8d3085d2767a54544c31225639261014a Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Sun, 13 Feb 2022 03:27:01 +0000 Subject: [PATCH 15/16] Update comnet-install.sh add vdash commands --- comnet-install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/comnet-install.sh b/comnet-install.sh index e550b89..0582865 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -271,7 +271,9 @@ echo "" echo " press 'q' to quit vdash --- this will not stop your node ---" echo "" echo "" -echo " TODO - further commands for vdash" +echo " You can cycle through different Safe nodes using left/right arrow keys, and zoom the timeline scale in/out using 'i' and 'o' (or '+' and '-')." +echo "" +echo " Feature requests and discussion are currently summarised in the opening post of the Safe Network forum topic: Node Dashboard ideas please!." echo "" echo "" echo "" From 51d6cabebbd0a58147e9ac5d54e9dd203da83657 Mon Sep 17 00:00:00 2001 From: Southside <293741+willief@users.noreply.github.com> Date: Sun, 6 Mar 2022 23:55:54 +0000 Subject: [PATCH 16/16] Update comnet-install.sh typo line 117 --- comnet-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comnet-install.sh b/comnet-install.sh index 0582865..524e5ec 100755 --- a/comnet-install.sh +++ b/comnet-install.sh @@ -114,7 +114,7 @@ esac echo "" echo " Your node will attempt to connect to "$SAFENET -eho "" +echo "" echo " For some testnets, it will be necessary to allocate a fixed size for your vault." echo " Again please refer to threads on https://safenetforum.org for details. If no size" echo " is specified, 5GB will be selected as default."