Skip to content

Commit

Permalink
Add node deps for guild-deploy.json
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlrt committed Mar 13, 2024
1 parent 721b9d4 commit bbf63d0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
14 changes: 14 additions & 0 deletions files/node-deps.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
14 changes: 11 additions & 3 deletions scripts/cnode-helper-scripts/guild-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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!"
Expand Down Expand Up @@ -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!"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/grest-helper-scripts/grest-poll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit bbf63d0

Please sign in to comment.