From eefbbfac61c7c654f7f9735a7b5e9dcc87b8a91b Mon Sep 17 00:00:00 2001 From: Chalith Desaman Date: Wed, 31 Aug 2022 16:26:47 +0530 Subject: [PATCH] Modifed node version check (#178) --- installer/prereq.sh | 7 ++++--- installer/setup.sh | 5 +++-- mb-xrpl/lib/appenv.js | 2 +- src/version.hpp | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/installer/prereq.sh b/installer/prereq.sh index 9c0606b..33d0004 100755 --- a/installer/prereq.sh +++ b/installer/prereq.sh @@ -44,9 +44,10 @@ if ! command -v node &>/dev/null; then curl -sL https://deb.nodesource.com/setup_16.x | bash - apt-get -y install nodejs else - version=$(node -v) - if [[ ! $version =~ v16\..* ]]; then - echo "Found node $version, recommended node v16.x.x" + version=$(node -v | cut -d '.' -f1) + version=${version:1} + if [[ $version -lt 16 ]]; then + echo "Found node $version, recommended node v16.x.x or later" fi fi diff --git a/installer/setup.sh b/installer/setup.sh index e2f67d4..cfd77c0 100755 --- a/installer/setup.sh +++ b/installer/setup.sh @@ -125,8 +125,9 @@ function GB() { function check_prereq() { # Check if node js installed. if command -v node &>/dev/null; then - version=$(node -v) - if [[ ! $version =~ v16\..* ]]; then + version=$(node -v | cut -d '.' -f1) + version=${version:1} + if [[ $version -lt 16 ]]; then echo "$evernode requires NodeJs 16.x or later. You system has NodeJs $version installed. Either remove the NodeJs installation or upgrade to NodeJs 16.x." exit 1 fi diff --git a/mb-xrpl/lib/appenv.js b/mb-xrpl/lib/appenv.js index 3881c5e..9db4d5f 100644 --- a/mb-xrpl/lib/appenv.js +++ b/mb-xrpl/lib/appenv.js @@ -24,7 +24,7 @@ appenv = { ACQUIRE_LEASE_WAIT_TIMEOUT_THRESHOLD: 0.4, ORPHAN_PRUNE_SCHEDULER_INTERVAL_HOURS: 4, SASHI_CLI_PATH: appenv.IS_DEV_MODE ? "../build/sashi" : "/usr/bin/sashi", - MB_VERSION: '0.5.9', + MB_VERSION: '0.5.10', TOS_HASH: '757A0237B44D8B2BBB04AE2BAD5813858E0AECD2F0B217075E27E0630BA74314' // This is the sha256 hash of TOS text. } Object.freeze(appenv); diff --git a/src/version.hpp b/src/version.hpp index 7ef5e10..e6695f5 100644 --- a/src/version.hpp +++ b/src/version.hpp @@ -6,7 +6,7 @@ namespace version { // Sashimono agent version. Written to new configs. - constexpr const char *AGENT_VERSION = "0.5.9"; + constexpr const char *AGENT_VERSION = "0.5.10"; // Minimum compatible config version (this will be used to validate configs). constexpr const char *MIN_CONFIG_VERSION = "0.5.0";