From bbf63d0e3f8375f734455900203f3a90879421ed Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Wed, 13 Mar 2024 12:27:17 +1100 Subject: [PATCH] Add node deps for guild-deploy.json --- files/node-deps.json | 14 ++++++++++++++ scripts/cnode-helper-scripts/guild-deploy.sh | 14 +++++++++++--- scripts/grest-helper-scripts/grest-poll.sh | 4 ++-- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 files/node-deps.json diff --git a/files/node-deps.json b/files/node-deps.json new file mode 100644 index 000000000..bc72b5c35 --- /dev/null +++ b/files/node-deps.json @@ -0,0 +1,14 @@ +{ + "8.7.3": + { + "blst": "03b5124029979755c752eec45f3c29674b558446", + "secp256k1": "v0.3.2", + "sodium": "dbb48cce5429cb6585c9034f002568964f1ce567" + }, + "8.9.0": + { + "blst": "v0.3.11", + "secp256k1": "v0.3.2", + "sodium": "dbb48cce5429cb6585c9034f002568964f1ce567" + } +} \ No newline at end of file diff --git a/scripts/cnode-helper-scripts/guild-deploy.sh b/scripts/cnode-helper-scripts/guild-deploy.sh index 3e0b247b7..702624d75 100755 --- a/scripts/cnode-helper-scripts/guild-deploy.sh +++ b/scripts/cnode-helper-scripts/guild-deploy.sh @@ -109,6 +109,7 @@ set_defaults() { [[ "${SUDO}" = 'Y' && $(id -u) -eq 0 ]] && err_exit "Please run as non-root user." CNODE_HOME="${CNODE_PATH}/${CNODE_NAME}" CNODE_VNAME=$(echo "$CNODE_NAME" | awk '{print toupper($0)}') + CARDANO_NODE_VERSION="8.7.3" REPO="https://github.com/${G_ACCOUNT}/guild-operators" REPO_RAW="https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators" URL_RAW="${REPO_RAW}/${BRANCH}" @@ -159,6 +160,10 @@ common_init() { if ! grep -q '/.local/bin' "${HOME}"/.bashrc; then echo -e '\nexport PATH="${HOME}/.local/bin:${PATH}"' >> "${HOME}"/.bashrc fi + NODE_DEPS="$(curl -sfL "${URL_RAW}"/files/node-deps.json)" + BLST_REF="$(jq -r '."'${CARDANO_NODE_VERSION}'".blst' <<< ${NODE_DEPS})" + SODIUM_REF="$(jq -r '."'${CARDANO_NODE_VERSION}'".secp256k1' <<< ${NODE_DEPS})" + SECP256K1_REF="$(jq -r '."'${CARDANO_NODE_VERSION}'".sodium' <<< ${NODE_DEPS})" } ### Update file retaining existing custom configs @@ -256,7 +261,8 @@ os_dependencies() { [[ ! -d "./secp256k1" ]] && git clone https://github.com/bitcoin-core/secp256k1 &>/dev/null pushd secp256k1 >/dev/null || err_exit git fetch >/dev/null 2>&1 - git checkout ac83be33 &>/dev/null + [[ -z "${SECP256K1_REF}" ]] && SECP256K1_REF="ac83be33" + git checkout ${SECP256K1_REF} &>/dev/null ./autogen.sh > autogen.log > /tmp/secp256k1.log 2>&1 ./configure --enable-module-schnorrsig --enable-experimental > configure.log >> /tmp/secp256k1.log 2>&1 make > make.log 2>&1 || err_exit " Could not complete \"make\" for libsecp256k1 package, please try to run it manually to diagnose!" @@ -315,7 +321,8 @@ build_libsodium() { [[ ! -d "./libsodium" ]] && git clone https://github.com/intersectmbo/libsodium &>/dev/null pushd libsodium >/dev/null || err_exit git fetch >/dev/null 2>&1 - git checkout dbb48cc &>/dev/null + [[ -z "${SODIUM_REF}" ]] && SODIUM_REF="dbb48cc" + git checkout "${SODIUM_REF}" &>/dev/null ./autogen.sh > autogen.log > /tmp/libsodium.log 2>&1 ./configure > configure.log >> /tmp/libsodium.log 2>&1 make > make.log 2>&1 || err_exit " Could not complete \"make\" for libsodium package, please try to run it manually to diagnose!" @@ -333,7 +340,8 @@ build_libblst() { [[ ! -d "./blst" ]] && git clone https://github.com/supranational/blst &>/dev/null pushd blst >/dev/null || err_exit git fetch >/dev/null 2>&1 - git checkout v0.3.10 &>/dev/null + [[ -z "${BLST_REF}" ]] && BLST_REF="v0.3.10" + git checkout ${BLST_REF} &>/dev/null ./build.sh >/dev/null 2>&1 cat <<-EOF >libblst.pc prefix=/usr/local diff --git a/scripts/grest-helper-scripts/grest-poll.sh b/scripts/grest-helper-scripts/grest-poll.sh index e0fa11d30..9b4b611a2 100755 --- a/scripts/grest-helper-scripts/grest-poll.sh +++ b/scripts/grest-helper-scripts/grest-poll.sh @@ -112,10 +112,10 @@ function chk_tip() { function chk_rpc_struct() { srvr_spec="$(curl -skL "${1}" | jq '[leaf_paths as $p | { "key": $p | map(tostring) | join("_"), "value": getpath($p) }] | from_entries' | awk '{print $1 " " $2}' | grep -e ^\"paths -e ^\"parameters -e ^\"definitions 2>/dev/null)" - api_endpts="$(grep ^\ \ / "${LOCAL_SPEC}" | sed -e 's# /#/#g' -e 's#:##' | sort)" + api_endpts="$(grep ^\ \ / "${LOCAL_SPEC}" | awk '{print $1}' | sed -e 's#:##' | sort)" for endpt in ${api_endpts} do - echo "${srvr_spec}" | grep -e "paths.*.${endpt}\\." + echo "${srvr_spec}" | grep -e "paths.*.${endpt}" done }