Skip to content

Commit 9ed41cc

Browse files
authored
Merge pull request #175 from DigiNode-Tools/develop
v0.11.2 Release / Auto re-enable port tester 24hrs after successful port test
2 parents 3dbfa46 + 0dfc092 commit 9ed41cc

3 files changed

Lines changed: 88 additions & 18 deletions

File tree

diginode-setup.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Name: DigiNode Setup v0.11.1
3+
# Name: DigiNode Setup v0.11.2
44
#
55
# Purpose: Install and manage a DigiByte Node and DigiAsset Node via the linux command line.
66
#
@@ -16,8 +16,8 @@
1616
#
1717
# -----------------------------------------------------------------------------------------------------
1818

19-
DGNT_VER_LIVE=0.11.1
20-
# Last Updated: 2025-04-19
19+
DGNT_VER_LIVE=0.11.2
20+
# Last Updated: 2025-04-21
2121

2222
# Convert to a fixed width string of 9 characters to display in the script
2323
DGNT_VER_LIVE_FW=$(printf "%-9s" "v$DGNT_VER_LIVE")
@@ -87,6 +87,8 @@ CRYPTO_NAME="DigiByte"
8787
CRYPTO_SYMBOL="DGB"
8888
SETTINGS_LOCATION=$USER_HOME/.digibyte
8989
SETTINGS_FILE=$SETTINGS_LOCATION/diginode.settings
90+
HOSTNAME_MAINNET="diginode"
91+
HOSTNAME_TESTNET="diginode-testnet"
9092

9193

9294
######### IMPORTANT NOTE ###########
@@ -667,7 +669,7 @@ DGNT_SETTINGS_FILE_VER_BRANCH=$DGNT_SETTINGS_FILE_VER_BRANCH_NEW
667669
# DGNT_SETTINGS_FILE= [This value is set in the header of the setup script. Do not set it here.]
668670

669671
# DIGIBYTE CORE BLOCKCHAIN DATA LOCATION:
670-
# You can change this to optionally store the DigiByte blockchain data in a diferent location
672+
# You can change this to optionally store the DigiByte blockchain data in a different location
671673
# The value set below will be used by the normal install and the unattended install
672674
# Note - changing this after the DigiByte Node has already been running will cause
673675
# the blockchain to be be re-downloaded in the new location. The old data will need to be deleted manually
@@ -1012,7 +1014,7 @@ SYSTEM_REGULAR_UPDATES="$SYSTEM_REGULAR_UPDATES"
10121014
SYSTEM_SECURITY_UPDATES="$SYSTEM_SECURITY_UPDATES"
10131015

10141016
# This number assigns this DigiNode to a random group for installing updates. Do not change it.
1015-
# Using diferent groups allows the rollout of major updates to be staggered.
1017+
# Using different groups allows the rollout of major updates to be staggered.
10161018
UPDATE_GROUP="$UPDATE_GROUP"
10171019

10181020
# This keeps track of wther the user has agreed to the disclaimer.
@@ -4471,14 +4473,14 @@ elif [[ "$HOSTNAME" == "diginode" ]] && [[ "$DGB_NETWORK_IS_CHANGED" = "YES" ]]
44714473
printf "%b Hostname Check: %bFAILED%b Recommend changing Hostname to 'diginode-testnet'\\n" "${CROSS}" "${COL_LIGHT_RED}" "${COL_NC}"
44724474
printf "\\n"
44734475
if [ "$UNATTENDED_MODE" == true ]; then
4474-
printf "%b Important: It is recommend that you change your hostname to 'diginode-testnet'\\n" "${INFO}"
4476+
printf "%b Important: It is recommended that you change your hostname to 'diginode-testnet'\\n" "${INFO}"
44754477
printf "%b Your hostname is currently '$HOSTNAME'. Since you have just switched to\\n" "${INDENT}"
44764478
printf "%b to running a DigiByte testnet node it is advisable to change the hostname\\n" "${INDENT}"
44774479
printf "%b to 'diginode-testnet'. This is optional but recommended, since it will ensure\\n" "${INDENT}"
44784480
printf "%b the current hostname does not conflict with another DigiByte mainnet node on\\n" "${INDENT}"
44794481
printf "%b your network. If you are planning to run two DigiNodes on your network,\\n" "${INDENT}"
44804482
printf "%b one on DigiByte MAINNET and the other on TESTNET, it is advisable to give\\n" "${INDENT}"
4481-
printf "%b them diferent hostnames on your network so they are easier to identify.\\n" "${INDENT}"
4483+
printf "%b them different hostnames on your network so they are easier to identify.\\n" "${INDENT}"
44824484
printf "\\n"
44834485
else
44844486
printf "%b Asking to change hostname from 'diginode' to 'diginode-testnet'...\\n" "${INFO}"
@@ -4493,13 +4495,13 @@ elif [[ "$HOSTNAME" == "diginode-testnet" ]] && [[ "$DGB_NETWORK_IS_CHANGED" = "
44934495
printf "%b Hostname Check: %bFAILED%b Recommend changing Hostname to 'diginode'\\n" "${CROSS}" "${COL_LIGHT_RED}" "${COL_NC}"
44944496
printf "\\n"
44954497
if [ "$UNATTENDED_MODE" == true ]; then
4496-
printf "%b Important: It is recommend that you change your hostname to 'diginode-testnet'\\n" "${INFO}"
4498+
printf "%b Important: It is recommended that you change your hostname to 'diginode-testnet'\\n" "${INFO}"
44974499
printf "%b Your hostname is currently '$HOSTNAME'. Since you have just switched to\\n" "${INDENT}"
44984500
printf "%b running a DigiByte mainnet node, it is advisable to change the hostname\\n" "${INDENT}"
44994501
printf "%b to 'diginode' . This is optional but recommended, since it will ensure\\n" "${INDENT}"
45004502
printf "%b the current hostname does not conflict with another DigiByte testnet node on\\n" "${INDENT}"
45014503
printf "%b your network. If you are planning to run two DigiNodes on your network, one on\\n" "${INDENT}"
4502-
printf "%b DigiByte MAINNET and the other on TESTNET, it is advisable to give them diferent\\n" "${INDENT}"
4504+
printf "%b DigiByte MAINNET and the other on TESTNET, it is advisable to give them different\\n" "${INDENT}"
45034505
printf "%b hostnames on your network so they are easier to identify.\\n" "${INDENT}"
45044506
printf "\\n"
45054507
else
@@ -8744,7 +8746,7 @@ fi
87448746
# Create service so that DigiByte daemon will run at boot
87458747
create_digibyte_service() {
87468748

8747-
# If you want to make changes to how DigiByte daemon services are created/managed for diferent systems, refer to this website:
8749+
# If you want to make changes to how DigiByte daemon services are created/managed for different systems, refer to this website:
87488750
#
87498751

87508752
# If we are in reset mode, ask the user if they want to re-create the DigiNode Service...
@@ -14970,7 +14972,7 @@ ipfs_update_port() {
1497014972
# Create service so that IPFS will run at boot
1497114973
ipfs_create_service() {
1497214974

14973-
# If you want to make changes to how IPFS services are created/managed for diferent systems, refer to this website:
14975+
# If you want to make changes to how IPFS services are created/managed for different systems, refer to this website:
1497414976
# https://github.com/ipfs/kobo/tree/master/misc
1497514977

1497614978

diginode.sh

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Name: DigiNode Dashboard v0.11.1
3+
# Name: DigiNode Dashboard v0.11.2
44
#
55
# Purpose: Monitor and manage the status of you DigiByte Node and DigiAsset Node.
66
#
@@ -47,8 +47,8 @@
4747
# The version number should be three numbers seperated by a period
4848
# Do not change this number or the mechanism for installing updates may no longer work.
4949

50-
DGNT_VER_LOCAL=0.11.1
51-
# Last Updated: 2025-04-19
50+
DGNT_VER_LOCAL=0.11.2
51+
# Last Updated: 2025-04-21
5252

5353
# Convert to a fixed width string of 9 characters to display in the script
5454
DGNT_VER_LOCAL_FW=$(printf "%-9s" "v$DGNT_VER_LOCAL")
@@ -2977,6 +2977,68 @@ pre_loop() {
29772977
sed -i -e "/^IPFS_PORT_TEST_ENABLED=/s|.*|IPFS_PORT_TEST_ENABLED=\"$IPFS_PORT_TEST_ENABLED\"|" $DGNT_SETTINGS_FILE
29782978
fi
29792979

2980+
2981+
2982+
# Set time since last pass that port tests are reenabled
2983+
PORT_TEST_RESET_DELAY=86400
2984+
2985+
# make sure the port test pass dates are stored as unix time - banana
2986+
2987+
# check if digibyte mainnet pass test date is stored as an integer (in prior versions of diginode dashboard, it wasn't)
2988+
if [[ ! "$DGB_MAINNET_PORT_TEST_PASS_DATE" =~ ^-?[0-9]+$ ]]; then
2989+
printf "%b Changing DigiByte Core MAINNET Port Test date to unix time...\n" "${INFO}"
2990+
DGB_MAINNET_PORT_TEST_PASS_DATE=$(( TIME_NOW_UNIX - PORT_TEST_RESET_DELAY ))
2991+
sed -i -e "/^DGB_MAINNET_PORT_TEST_PASS_DATE=/s|.*|DGB_MAINNET_PORT_TEST_PASS_DATE=\"$DGB_MAINNET_PORT_TEST_PASS_DATE\"|" $DGNT_SETTINGS_FILE
2992+
fi
2993+
# check if digibyte mainnet pass test date is stored as an integer (in prior versions of diginode dashboard, it wasn't)
2994+
if [[ ! "$DGB_TESTNET_PORT_TEST_PASS_DATE" =~ ^-?[0-9]+$ ]]; then
2995+
printf "%b Changing DigiByte Core TESTNET Port Test date to unix time...\n" "${INFO}"
2996+
DGB_TESTNET_PORT_TEST_PASS_DATE=$(( TIME_NOW_UNIX - PORT_TEST_RESET_DELAY ))
2997+
sed -i -e "/^DGB_TESTNET_PORT_TEST_PASS_DATE=/s|.*|DGB_TESTNET_PORT_TEST_PASS_DATE=\"$DGB_TESTNET_PORT_TEST_PASS_DATE\"|" $DGNT_SETTINGS_FILE
2998+
fi
2999+
# check if ipfs pass test date is stored as an integer (in prior versions of diginode dashboard, it wasn't)
3000+
if [[ ! "$IPFS_PORT_TEST_PASS_DATE" =~ ^-?[0-9]+$ ]]; then
3001+
printf "%b Changing IPFS Port Test date to unix time...\n" "${INFO}"
3002+
IPFS_PORT_TEST_PASS_DATE=$(( TIME_NOW_UNIX - PORT_TEST_RESET_DELAY ))
3003+
sed -i -e "/^IPFS_PORT_TEST_PASS_DATE=/s|.*|IPFS_PORT_TEST_PASS_DATE=\"$IPFS_PORT_TEST_PASS_DATE\"|" $DGNT_SETTINGS_FILE
3004+
fi
3005+
3006+
# calculate time since last port tests
3007+
DGB_MAINNET_PORT_TEST_TIME_SINCE_PASS=$(( TIME_NOW_UNIX - DGB_MAINNET_PORT_TEST_PASS_DATE ))
3008+
DGB_TESTNET_PORT_TEST_TIME_SINCE_PASS=$(( TIME_NOW_UNIX - DGB_TESTNET_PORT_TEST_PASS_DATE ))
3009+
IPFS_PORT_TEST_TIME_SINCE_PASS=$(( TIME_NOW_UNIX - IPFS_PORT_TEST_PASS_DATE ))
3010+
3011+
3012+
# Enable the DigiByte Core mainnet port test if it last passed more than 24 hours ago
3013+
if [ "$DGB_MAINNET_PORT_TEST_ENABLED" = "NO" ] && [ "$DGB_MAINNET_PORT_TEST_TIME_SINCE_PASS" -ge "$PORT_TEST_RESET_DELAY" ]; then
3014+
3015+
printf "%b Re-enabling DigiByte Core MAINNET Port Test...\n" "${INFO}"
3016+
3017+
DGB_MAINNET_PORT_TEST_ENABLED="YES"
3018+
sed -i -e "/^DGB_MAINNET_PORT_TEST_ENABLED=/s|.*|DGB_MAINNET_PORT_TEST_ENABLED=\"$DGB_MAINNET_PORT_TEST_ENABLED\"|" $DGNT_SETTINGS_FILE
3019+
fi
3020+
3021+
# Enable the DigiByte Core testnet port test if it last passed more than 24 hours ago
3022+
if [ "$DGB_TESTNET_PORT_TEST_ENABLED" = "NO" ] && [ "$DGB_TESTNET_PORT_TEST_TIME_SINCE_PASS" -ge "$PORT_TEST_RESET_DELAY" ]; then
3023+
3024+
printf "%b Re-enabling DigiByte Core TESTNET Port Test...\n" "${INFO}"
3025+
3026+
DGB_TESTNET_PORT_TEST_ENABLED="YES"
3027+
sed -i -e "/^DGB_TESTNET_PORT_TEST_ENABLED=/s|.*|DGB_TESTNET_PORT_TEST_ENABLED=\"$DGB_TESTNET_PORT_TEST_ENABLED\"|" $DGNT_SETTINGS_FILE
3028+
fi
3029+
3030+
# Enable the IPFS port test if it seems if it last passed more than 24 hours ago
3031+
if [ "$IPFS_PORT_TEST_ENABLED" != "YES" ] && [ "$IPFS_PORT_TEST_ENABLED" != "NO" ]; then
3032+
3033+
printf "%b Re-enabling IPFS Port Test...\n" "${INFO}"
3034+
3035+
IPFS_PORT_TEST_ENABLED="YES"
3036+
sed -i -e "/^IPFS_PORT_TEST_ENABLED=/s|.*|IPFS_PORT_TEST_ENABLED=\"$IPFS_PORT_TEST_ENABLED\"|" $DGNT_SETTINGS_FILE
3037+
fi
3038+
3039+
3040+
3041+
29803042
# If the DigiByte Core MAINNET port test (primary node) is disabled, check if the external IP address has changed
29813043
if [ "$DGB_MAINNET_PORT_TEST_ENABLED" = "NO" ] && [ "$DGB_NETWORK_CURRENT" = "MAINNET" ]; then
29823044

@@ -4355,8 +4417,10 @@ if [ $TIME_DIF_1DAY -ge 86400 ]; then
43554417
fi
43564418

43574419
# Check for new release of DigiAsset Node
4358-
DGA_VER_RELEASE_QUERY=$(curl --max-time 4 -sfL https://versions.digiassetx.com/digiasset_node/versions.json 2>/dev/null | jq last | sed 's/"//g')
4359-
if [ $DGA_VER_RELEASE_QUERY != "" ]; then
4420+
DGA_VER_RELEASE_QUERY=""
4421+
# DGA_VER_RELEASE_QUERY=$(curl --max-time 4 -sfL https://versions.digiassetx.com/digiasset_node/versions.json 2>/dev/null | jq last | sed 's/"//g') // disable release query as it is offline. value set to null in the line above - banana
4422+
4423+
if [ "$DGA_VER_RELEASE_QUERY" != "" ]; then
43604424
DGA_VER_RELEASE=$DGA_VER_RELEASE_QUERY
43614425
DGA_VER_MJR_RELEASE=$(echo $DGA_VER_RELEASE | cut -d'.' -f1)
43624426
sed -i -e "/^DGA_VER_RELEASE=/s|.*|DGA_VER_RELEASE=\"$DGA_VER_RELEASE\"|" $DGNT_SETTINGS_FILE
@@ -5175,7 +5239,7 @@ elif [ "$DGA_STATUS" = "stopped" ]; then
51755239
elif [ "$DGA_STATUS" = "not_detected" ]; then
51765240
# printf " ║ DIGIASSET NODE ║ STATUS ║ " && printf "%-${col_width_dgb_status}s %-3s\n" "${txtbred}DigiAsset Node not detected.${txtrst}" " ║ "
51775241
printf " ║ DIGIASSET NODE ║ STATUS ║ " && printf "%-${col_width_dgb_status}s %-3s\n" "${txtbylw}DigiAsset Core support is not yet possible due to a bug in DigiByte v8.22.x${txtrst}" ""
5178-
printf " ║ ║ ║ " && printf "%-${col_width_dgb_status_nocolor}s %-3s\n" "More info here: https://github.com/DigiByte-Core/digibyte/issues/263" ""
5242+
printf " ║ ║ ║ " && printf "%-${col_width_dgb_status_nocolor}s %-3s\n" "More info: https://github.com/DigiByte-Core/digibyte/issues/263" ""
51795243
fi
51805244
51815245
echo "$sm_row_05" # "╚" "═" "╩" "═" "╩" "═" "╝"
@@ -5915,7 +5979,7 @@ echo ""
59155979
echo " Running Port Tests..."
59165980
echo ""
59175981

5918-
PORT_TEST_DATE=$(date)
5982+
PORT_TEST_DATE=$(date +%s)
59195983

59205984

59215985
# Setup DigiByte port test cammands

docs/release_notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## DigiNode Tools Release Notes
22

3+
DigiNode Tools v0.11.2 - 2025-04-22
4+
- Change: The Port Tester now gets re-enabled automatically 24 hours after the test was last successfully passed.
5+
- Fix: Hopefully the startup error that is occasionally been seen is now fixed.
6+
37
DigiNode Tools v0.11.1 - 2025-04-20
48
- Change: Default auto quit duration for the DigiNode Dashboard has been changed to 24 hours (1440 minutes).
59
- Change: Mempool bytes are hidden on narrower terminal windows to make the display cleaner.

0 commit comments

Comments
 (0)