|
1 | 1 | #!/bin/bash |
2 | 2 | # |
3 | | -# Name: DigiNode Dashboard v0.11.1 |
| 3 | +# Name: DigiNode Dashboard v0.11.2 |
4 | 4 | # |
5 | 5 | # Purpose: Monitor and manage the status of you DigiByte Node and DigiAsset Node. |
6 | 6 | # |
|
47 | 47 | # The version number should be three numbers seperated by a period |
48 | 48 | # Do not change this number or the mechanism for installing updates may no longer work. |
49 | 49 |
|
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 |
52 | 52 |
|
53 | 53 | # Convert to a fixed width string of 9 characters to display in the script |
54 | 54 | DGNT_VER_LOCAL_FW=$(printf "%-9s" "v$DGNT_VER_LOCAL") |
@@ -2977,6 +2977,68 @@ pre_loop() { |
2977 | 2977 | sed -i -e "/^IPFS_PORT_TEST_ENABLED=/s|.*|IPFS_PORT_TEST_ENABLED=\"$IPFS_PORT_TEST_ENABLED\"|" $DGNT_SETTINGS_FILE |
2978 | 2978 | fi |
2979 | 2979 |
|
| 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 | + |
2980 | 3042 | # If the DigiByte Core MAINNET port test (primary node) is disabled, check if the external IP address has changed |
2981 | 3043 | if [ "$DGB_MAINNET_PORT_TEST_ENABLED" = "NO" ] && [ "$DGB_NETWORK_CURRENT" = "MAINNET" ]; then |
2982 | 3044 |
|
@@ -4355,8 +4417,10 @@ if [ $TIME_DIF_1DAY -ge 86400 ]; then |
4355 | 4417 | fi |
4356 | 4418 |
|
4357 | 4419 | # 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 |
4360 | 4424 | DGA_VER_RELEASE=$DGA_VER_RELEASE_QUERY |
4361 | 4425 | DGA_VER_MJR_RELEASE=$(echo $DGA_VER_RELEASE | cut -d'.' -f1) |
4362 | 4426 | 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 |
5175 | 5239 | elif [ "$DGA_STATUS" = "not_detected" ]; then |
5176 | 5240 | # printf " ║ DIGIASSET NODE ║ STATUS ║ " && printf "%-${col_width_dgb_status}s %-3s\n" "${txtbred}DigiAsset Node not detected.${txtrst}" " ║ " |
5177 | 5241 | 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" " ║ " |
5179 | 5243 | fi |
5180 | 5244 |
|
5181 | 5245 | echo "$sm_row_05" # "╚" "═" "╩" "═" "╩" "═" "╝" |
@@ -5915,7 +5979,7 @@ echo "" |
5915 | 5979 | echo " Running Port Tests..." |
5916 | 5980 | echo "" |
5917 | 5981 |
|
5918 | | -PORT_TEST_DATE=$(date) |
| 5982 | +PORT_TEST_DATE=$(date +%s) |
5919 | 5983 |
|
5920 | 5984 |
|
5921 | 5985 | # Setup DigiByte port test cammands |
|
0 commit comments