Skip to content

Commit

Permalink
Minor fixes for guild-deploy (#1773)
Browse files Browse the repository at this point in the history
## Description
<!--- Describe your changes -->
Minor fixes for secp and libsodium commit references, move build_libsecp
to be part of build dependencies, remove aptitude
  • Loading branch information
rdlrt committed May 29, 2024
1 parent 4cc4f09 commit 202779c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/Appendix/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ -z "${OS_ID##*debian*}" ]; then
RELEASE=$(lsb_release -cs)
echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list
sudo apt-get update
sudo apt-get -y install postgresql-15 postgresql-server-dev-15 postgresql-contrib libghc-hdbc-postgresql-dev
sudo apt-get -y install postgresql-16 postgresql-server-dev-16 postgresql-contrib libghc-hdbc-postgresql-dev
sudo systemctl restart postgresql
sudo systemctl enable postgresql
else
Expand Down
2 changes: 1 addition & 1 deletion docs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Please familiarise with the syntax of `guild-deploy.sh` before proceeding. The u

``` bash

Usage: guild-deploy.sh [-n <mainnet|preprod|guild|preview>] [-p path] [-t <name>] [-b <branch>] [-u] [-s [p][b][l][f][d][c][o][w][x]]
Usage: guild-deploy.sh [-n <mainnet|preprod|guild|preview>] [-p path] [-t <name>] [-b <branch>] [-u] [-s [p][b][l][m][f][d][c][o][w][x]]
Set up dependencies for building/using common tools across cardano ecosystem.
The script will always update dynamic content from existing scripts retaining existing user variables

Expand Down
2 changes: 1 addition & 1 deletion files/configs/guild/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"accessPoints": [
{"address": "209.145.50.190" ,"port": 7001, "name": "rdlrt"},
{"address": "c.rdlrt.top" ,"port": 7001, "name": "rdlrt"},
{"address": "95.216.188.94" ,"port": 7000, "name": "homer"},
{"address": "relay1-test.ahlnet.nu" ,"port": 2103, "name": "ahl-1"},
{"address": "guild-relay.bluecheesestakehouse.com","port": 7000, "name": "westberg"},
Expand Down
2 changes: 1 addition & 1 deletion files/configs/preprod/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{"address": "preprod-test.ahlnet.nu", "port": 2101, "pool": "AHL"},
{"address": "154.12.248.114", "port": 6000, "pool": "HOM1"},
{"address": "tn-preprod.psilobyte.io", "port": 4101, "pool": "PSBT"},
{"address": "209.145.50.190", "port": 18000, "pool": "RDLRT"}
{"address": "c.rdlrt.top", "port": 18000, "pool": "RDLRT"}
],
"advertise": false,
"trustable": false,
Expand Down
11 changes: 5 additions & 6 deletions scripts/cnode-helper-scripts/guild-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ usage() {
-s Selective Install, only deploy specific components as below:
p Install common pre-requisite OS-level Dependencies for most tools on this repo (Default: skip)
b Install OS level dependencies for tools required while building cardano-node/cardano-db-sync components (Default: skip)
l Build and Install libsodium + libsecp fork from IO repositories (Default: skip)
l Build and Install libsodium fork from IO repositories (Default: skip)
m Download latest (released) binaries for mithril-signer, mithril-client (Default: skip)
f Force overwrite entire content of scripts and config files (backups of existing ones will be created) (Default: skip)
d Download latest (released) binaries for bech32, cardano-address, cardano-node, cardano-cli, cardano-db-sync and cardano-submit-api (Default: skip)
Expand Down Expand Up @@ -206,7 +206,7 @@ os_dependencies() {
pkgmgrcmd="env NEEDRESTART_MODE=a env DEBIAN_FRONTEND=noninteractive env DEBIAN_PRIORITY=critical apt-get"
libncurses_pkg="libncursesw5"
[[ -f /etc/debian_version ]] && grep -q trixie /etc/debian_version && libncurses_pkg="libncursesw6"
pkg_list="python3 pkg-config libssl-dev ${libncurses_pkg} libtinfo-dev systemd libsystemd-dev libsodium-dev tmux git jq libtool bc gnupg aptitude libtool secure-delete iproute2 tcptraceroute sqlite3 bsdmainutils libusb-1.0-0-dev libudev-dev unzip llvm clang libnuma-dev libpq-dev build-essential libffi-dev libgmp-dev zlib1g-dev make g++ autoconf automake liblmdb-dev procps xxd"
pkg_list="python3 pkg-config libssl-dev ${libncurses_pkg} libtinfo-dev systemd libsystemd-dev libsodium-dev tmux git jq libtool bc gnupg libtool secure-delete iproute2 tcptraceroute sqlite3 bsdmainutils libusb-1.0-0-dev libudev-dev unzip llvm clang libnuma-dev libpq-dev build-essential libffi-dev libgmp-dev zlib1g-dev make g++ autoconf automake liblmdb-dev procps xxd"
elif [[ "${OS_ID}" =~ rhel ]] || [[ "${OS_ID}" =~ fedora ]] || [[ "${DISTRO}" =~ Fedora ]]; then
#CentOS/RHEL/Fedora/RockyLinux
pkgmgrcmd="dnf"
Expand Down Expand Up @@ -287,13 +287,14 @@ build_dependencies() {
echo -e "\n Installing Cabal v${BOOTSTRAP_HASKELL_CABAL_VERSION}.."
ghcup install cabal ${BOOTSTRAP_HASKELL_CABAL_VERSION} >/dev/null 2>&1 || err_exit " Executing \"ghcup install cabal ${BOOTSTRAP_HASKELL_GHC_VERSION}\" failed, please try to diagnose/execute it manually to diagnose!"
fi
build_libsecp
build_libblst
}

# Build fork of libsodium
build_libsodium() {
echo -e "\nBuilding libsodium ..."
SODIUM_REF="$(jq -r '."'${CARDANO_NODE_VERSION}'".secp256k1' <<< ${NODE_DEPS})"
SODIUM_REF="$(jq -r '."'${CARDANO_NODE_VERSION}'".sodium' <<< ${NODE_DEPS})"
if ! grep -q "/usr/local/lib:\$LD_LIBRARY_PATH" "${HOME}"/.bashrc; then
echo -e "\nexport LD_LIBRARY_PATH=/usr/local/lib:\$LD_LIBRARY_PATH" >> "${HOME}"/.bashrc
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
Expand All @@ -309,13 +310,11 @@ build_libsodium() {
make > make.log 2>&1 || err_exit " Could not complete \"make\" for libsodium package, please try to run it manually to diagnose!"
$sudo make install > install.log 2>&1
echo -e "\nIOG fork of libsodium installed to /usr/local/lib/"
# Cannot verify the version and availability of libsecp256k1 package built previously, hence have to re-install each time
build_libsecp
}

build_libsecp() {
echo -e "\n[Re]-Install libsecp256k1 ..."
SECP256K1_REF="$(jq -r '."'${CARDANO_NODE_VERSION}'".sodium' <<< ${NODE_DEPS})"
SECP256K1_REF="$(jq -r '."'${CARDANO_NODE_VERSION}'".secp256k1' <<< ${NODE_DEPS})"
pushd "${HOME}"/git >/dev/null || err_exit
[[ ! -d "./secp256k1" ]] && git clone https://github.com/bitcoin-core/secp256k1 &>/dev/null
pushd secp256k1 >/dev/null || err_exit
Expand Down

0 comments on commit 202779c

Please sign in to comment.