From 9e4c303d9cb1a47b338a744ea11f1cb7e0c5275d Mon Sep 17 00:00:00 2001 From: Chalith Desaman Date: Mon, 8 Aug 2022 16:29:41 +0530 Subject: [PATCH] Modified sashimono command checks (#172) --- installer/prereq.sh | 4 +- installer/sashimono-uninstall.sh | 10 +-- installer/setup.sh | 117 ++++++++++++++++++------------- mb-xrpl/lib/appenv.js | 2 +- src/msg/json/msg_json.cpp | 3 +- src/version.hpp | 2 +- test/vm-cluster/cluster.sh | 2 +- 7 files changed, 81 insertions(+), 59 deletions(-) diff --git a/installer/prereq.sh b/installer/prereq.sh index 23c8980..34f309b 100755 --- a/installer/prereq.sh +++ b/installer/prereq.sh @@ -24,7 +24,9 @@ function stage() { stage "Installing dependencies" -apt-get update +# Added --allow-releaseinfo-change +# To fix - Repository 'https://apprepo.vultr.com/ubuntu universal InRelease' changed its 'Codename' value from 'buster' to 'universal' +apt-get update --allow-releaseinfo-change apt-get install -y uidmap slirp4netns fuse3 cgroup-tools quota curl openssl jq # uidmap # Required for rootless docker. # slirp4netns # Required for high performance rootless networking. diff --git a/installer/sashimono-uninstall.sh b/installer/sashimono-uninstall.sh index 381b3a5..4aa238a 100755 --- a/installer/sashimono-uninstall.sh +++ b/installer/sashimono-uninstall.sh @@ -7,16 +7,18 @@ force=$1 function confirm() { - echo -en $1" [y/n] " + echo -en $1" [Y/n] " local yn="" - read yn /dev/null; then + version=$(node -v) + if [[ ! $version =~ v16\..* ]]; 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 + fi +} + function check_sys_req() { # Assign sys resource info to global vars since these will also be used for instance allocation later. @@ -491,6 +508,7 @@ function update_evernode() { elif [ "$latest_setup_script_version" != "$current_setup_script_version" ] ; then [ -d $log_dir ] || mkdir -p $log_dir logfile="$log_dir/installer-$(date +%s).log" + remove_evernode_alias ! create_evernode_alias && echo "Alias creation failed." echo $latest_setup_script_version > $SASHIMONO_DATA/$setup_version_timestamp_file fi @@ -589,6 +607,7 @@ if [ "$mode" == "install" ]; then \nContinue?" && exit 1 check_sys_req + check_prereq # Check bc command is installed. if ! command -v bc &>/dev/null; then diff --git a/mb-xrpl/lib/appenv.js b/mb-xrpl/lib/appenv.js index 8fe3479..59e50ed 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.7', + MB_VERSION: '0.5.8', TOS_HASH: '757A0237B44D8B2BBB04AE2BAD5813858E0AECD2F0B217075E27E0630BA74314' // This is the sha256 hash of TOS text. } Object.freeze(appenv); diff --git a/src/msg/json/msg_json.cpp b/src/msg/json/msg_json.cpp index 68a0bea..72fd7d2 100644 --- a/src/msg/json/msg_json.cpp +++ b/src/msg/json/msg_json.cpp @@ -9,8 +9,7 @@ namespace msg::json constexpr const char *SEP_COMMA_NOQUOTE = ",\""; constexpr const char *SEP_COLON_NOQUOTE = "\":"; constexpr const char *DOUBLE_QUOTE = "\""; - constexpr uint16_t MOMENT_SIZE = 900; // XRP ledgers per Moment. - constexpr uint16_t LEDGER_TIME_APPROX = 4000; // Approx. milliseconds per XRP ledger. + constexpr uint16_t MOMENT_SIZE = 1190; // XRP ledgers per Moment. constexpr uint16_t INSTANCE_INFO_SIZE = 488; // Size of a single instance info /** * Parses a json message sent by the message board. diff --git a/src/version.hpp b/src/version.hpp index 265dd81..779b9d7 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.7"; + constexpr const char *AGENT_VERSION = "0.5.8"; // Minimum compatible config version (this will be used to validate configs). constexpr const char *MIN_CONFIG_VERSION = "0.5.0"; diff --git a/test/vm-cluster/cluster.sh b/test/vm-cluster/cluster.sh index a122846..f6924d5 100755 --- a/test/vm-cluster/cluster.sh +++ b/test/vm-cluster/cluster.sh @@ -186,7 +186,7 @@ if [ $mode == "reconfig" ]; then saconfig="/etc/sashimono/sa.cfg" uninstall="evernode uninstall -q" - install="curl -fsSL https://stevernode.blob.core.windows.net/evernode-dev/setup.sh | cat | SKIP_SYSREQ=1 bash -s install -q auto auto 1000000 1000000 2097152 3145728 3 Auto_\$HOSTNAME" + install="curl -fsSL https://stevernode.blob.core.windows.net/evernode-dev-bb7ec110-f72e-430e-b297-9210468a4cbb/setup.sh | cat | SKIP_SYSREQ=1 bash -s install -q auto auto 1000000 1000000 2097152 3145728 3 Auto_\$HOSTNAME" restartcgrs="systemctl restart $cgrulesengd_service.service" restartsas="systemctl restart $sashimono_service.service"