Skip to content

Commit

Permalink
Merge branch 'alpha' into cncli_epochdata_load
Browse files Browse the repository at this point in the history
  • Loading branch information
Scitz0 authored Sep 25, 2024
2 parents cf20483 + dd06e9d commit 8016b09
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 23 deletions.
4 changes: 4 additions & 0 deletions docs/Scripts/cntools-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to this tool will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [13.2.2] - 2024-09-23
#### Fixed
- URL for share.koios.rest to download catalyst-toolbox

## [13.2.1] - 2024-09-10
#### Added
- Added gov vote validation for role and type
Expand Down
2 changes: 1 addition & 1 deletion files/docker/node/release-versions/mithril-latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2430.0
2437.1
4 changes: 2 additions & 2 deletions scripts/cnode-helper-scripts/cntools.library
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CNTOOLS_MAJOR_VERSION=13
# Minor: Changes and features of minor character that can be applied without breaking existing functionality or workflow
CNTOOLS_MINOR_VERSION=2
# Patch: Backwards compatible bug fixes. No additional functionality or major changes
CNTOOLS_PATCH_VERSION=1
CNTOOLS_PATCH_VERSION=2

CNTOOLS_VERSION="${CNTOOLS_MAJOR_VERSION}.${CNTOOLS_MINOR_VERSION}.${CNTOOLS_PATCH_VERSION}"
DUMMYFEE=20000
Expand Down Expand Up @@ -171,7 +171,7 @@ download_catalyst_toolbox() {
fi
rm -rf /tmp/catalyst-toolbox-bin && mkdir /tmp/catalyst-toolbox-bin
pushd /tmp/catalyst-toolbox-bin >/dev/null || return 1
if curl -sL -f -m ${CURL_TIMEOUT} -o "${HOME}"/.local/bin/catalyst-toolbox "https://share.koios.rest/api/public/dl/Q0m8-F2X%2Fbinaries%2Fcatalyst-toolbox-x86_64-gnu"; then
if curl -sL -f -m ${CURL_TIMEOUT} -o "${HOME}"/.local/bin/catalyst-toolbox "https://share.koios.rest/api/public/dl/xFdZDfM4%2Fbin%2Fcatalyst-toolbox"; then
chmod +x "${HOME}"/.local/bin/catalyst-toolbox
local catalyst_toolbox_version; catalyst_toolbox_version=$(catalyst-toolbox --full-version)
println DEBUG " ${catalyst_toolbox_version%% - *} ${FG_GREEN}installed!${NC}"
Expand Down
34 changes: 17 additions & 17 deletions scripts/cnode-helper-scripts/guild-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ versionCheck() { printf '%s\n%s' "${1//v/}" "${2//v/}" | sort -C -V; } #$1=avail

usage() {
cat <<-EOF >&2
Usage: $(basename "$0") [-n <mainnet|guild|preprod|preview|sanchonet>] [-p path] [-t <name>] [-b <branch>] [-u] [-s [p][b][l][m][d][c][o][w][x][f][s]]
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
-n Connect to specified network instead of mainnet network (Default: connect to cardano mainnet network) eg: -n guild
-p Parent folder path underneath which the top-level folder will be created (Default: /opt/cardano)
-t Alternate name for top level folder - only alpha-numeric chars allowed (Default: cnode)
Expand All @@ -82,7 +82,7 @@ usage() {
x Download latest (released) binaries for Cardano Signer binary (Default: skip)
f Force overwrite config files (backups of existing ones will be created) (Default: skip)
s Force overwrite entire content [including user variables] of scripts (Default: skip)
EOF
exit 1
}
Expand All @@ -109,7 +109,7 @@ set_defaults() {
[[ -z "${BRANCH}" ]] && BRANCH="master"
[[ "${SUDO}" = 'Y' ]] && sudo="sudo" || sudo=""
[[ "${SUDO}" = 'Y' && $(id -u) -eq 0 ]] && err_exit "Please run as non-root user."
[[ -z "${CARDANO_NODE_VERSION}" ]] && CARDANO_NODE_VERSION="$(curl -sfk "https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${BRANCH}/files/docker/node/release-versions/cardano-node-latest.txt")" || CARDANO_NODE_VERSION=9.1.1
[[ -z "${CARDANO_NODE_VERSION}" ]] && CARDANO_NODE_VERSION="$(curl -sfk "https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${BRANCH}/files/docker/node/release-versions/cardano-node-latest.txt" || echo "9.1.1")"
CNODE_HOME="${CNODE_PATH}/${CNODE_NAME}"
CNODE_VNAME=$(echo "$CNODE_NAME" | awk '{print toupper($0)}')
[[ -z ${MITHRIL_HOME} ]] && MITHRIL_HOME="${CNODE_HOME}/mithril"
Expand Down Expand Up @@ -144,7 +144,7 @@ update_check() {
mv -f "${PARENT}"/guild-deploy.sh.tmp "${PARENT}"/guild-deploy.sh && \
chmod 755 "${PARENT}"/guild-deploy.sh && \
echo -e "\nUpdate applied successfully, please run the script again!\n" && \
exit 0;
exit 0;
} || {
echo -e "Update failed!\n\nPlease manually download latest version of guild-deploy.sh script from GitHub" && \
exit 1;
Expand Down Expand Up @@ -373,7 +373,7 @@ build_libblst() {
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: libblst
Description: Multilingual BLS12-381 signature library
URL: https://github.com/supranational/blst
Expand All @@ -394,13 +394,13 @@ download_cnodebins() {
[[ -z ${ARCH##*aarch64*} ]] && err_exit " The build archives are not available for ARM, you might need to build them!"
echo -e "\nDownloading binaries.."
pushd "${HOME}"/tmp >/dev/null || err_exit
echo -e "\n Downloading Cardano Node archive created from GitHub.."
echo -e "\n Downloading Cardano Node ${CARDANO_NODE_VERSION} archive created from GitHub.."
rm -f cardano-node cardano-address
curl -m 200 -sfL https://github.com/intersectmbo/cardano-node/releases/download/${CARDANO_NODE_VERSION}/cardano-node-${CARDANO_NODE_VERSION}-linux.tar.gz -o cnode.tar.gz || err_exit " Could not download cardano-node release ${CARDANO_NODE_VERSION} from GitHub!"
tar zxf cnode.tar.gz --strip-components 2 ./bin/cardano-node ./bin/cardano-submit-api ./bin/bech32 &>/dev/null
rm -f cnode.tar.gz
curl -m 200 -sfL https://github.com/IntersectMBO/cardano-cli/releases/download/cardano-cli-9.4.1.0/cardano-cli-9.4.1.0-x86_64-linux.tar.gz -o ccli.tar.gz || err_exit " Could not download cardano-cli from GitHub!"
tar zxf ccli.tar.gz --strip-components 1 cardano-cli-x86_64-linux &>/dev/null && mv cardano-cli-x86_64 cardano-cli
tar zxf ccli.tar.gz --strip-components 0 cardano-cli-x86_64-linux &>/dev/null && mv cardano-cli-x86_64-linux cardano-cli
rm -f ccli.tar.gz
[[ -f cardano-node ]] || err_exit " cardano-node archive downloaded but binary (cardano-node) not found after extracting package!"
echo -e "\n Downloading Github release package for Cardano Addresses"
Expand Down Expand Up @@ -466,7 +466,7 @@ download_cardanohwcli() {
mkdir -p "${HOME}"/.local/bin
rm -rf "${HOME}"/bin/cardano-hw-cli # Remove duplicate file in $PATH (old convention)
if [ -f "${HOME}"/.local/bin/cardano-hw-cli ]; then
rm -rf "${HOME}"/.local/bin/cardano-hw-cli
rm -rf "${HOME}"/.local/bin/cardano-hw-cli
fi
pushd "${HOME}"/.local/bin >/dev/null || err_exit
mv -f /tmp/chwcli-bin/cardano-hw-cli/* ./
Expand Down Expand Up @@ -583,17 +583,17 @@ download_mithril() {
# Create folder structure and set up permissions/ownerships
setup_folder() {
echo -e "\nCreating Folder Structure .."

if grep -q "export ${CNODE_VNAME}_HOME=" "${HOME}"/.bashrc; then
echo -e "\nEnvironment Variable already set up!"
else
echo -e "\nSetting up Environment Variable"
echo -e "\nexport ${CNODE_VNAME}_HOME=${CNODE_HOME}" >> "${HOME}"/.bashrc
fi

$sudo mkdir -p "${CNODE_HOME}"/files "${CNODE_HOME}"/db "${CNODE_HOME}"/guild-db "${CNODE_HOME}"/logs "${CNODE_HOME}"/scripts "${CNODE_HOME}"/scripts/archive "${CNODE_HOME}"/sockets "${CNODE_HOME}"/priv "${MITHRIL_HOME}"/data-stores
$sudo chown -R "$U_ID":"$G_ID" "${CNODE_HOME}" 2>/dev/null

}

# Download and update scripts for cnode
Expand All @@ -602,7 +602,7 @@ populate_cnode() {
echo -e "\nDownloading files..."
pushd "${CNODE_HOME}"/files >/dev/null || err_exit
echo "${BRANCH}" > "${CNODE_HOME}"/scripts/.env_branch

local err_msg=" Had Trouble downloading the file:"
# Download node config, genesis and topology from template
#NWCONFURL="https://raw.githubusercontent.com/input-output-hk/cardano-playground/main/static/book.play.dev.cardano.org/environments"
Expand Down Expand Up @@ -641,11 +641,11 @@ populate_cnode() {
rm -f config.json.tmp
rm -f dbsync.json.tmp
fi

pushd "${CNODE_HOME}"/scripts >/dev/null || err_exit

[[ ${SCRIPTS_FORCE_OVERWRITE} = 'Y' ]] && echo -e "\nForced full upgrade! Please edit scripts/env, scripts/cnode.sh, scripts/dbsync.sh, scripts/submitapi.sh, scripts/ogmios.sh, scripts/gLiveView.sh and scripts/topologyUpdater.sh scripts/mithril-client.sh scripts/mithril-relay.sh scripts/mithril-signer.sh (alongwith files/topology.json, files/config.json, files/dbsync.json) as required!"

updateWithCustomConfig "blockPerf.sh"
updateWithCustomConfig "cabal-build-all.sh"
updateWithCustomConfig "cncli.sh"
Expand All @@ -666,7 +666,7 @@ populate_cnode() {
updateWithCustomConfig "mithril-relay.sh"
updateWithCustomConfig "mithril-signer.sh"
updateWithCustomConfig "mithril.library"

find "${CNODE_HOME}/scripts" -name '*.sh' -exec chmod 755 {} \; 2>/dev/null
chmod 750 "${CNODE_HOME}"/priv 2>/dev/null
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/cnode-helper-scripts/mithril-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function main() {
esac
;;
cardano-db)
mithril_init client
mithril_init client || exit 1
case $2 in
download)
check_db_dir
Expand Down Expand Up @@ -124,7 +124,7 @@ function main() {
esac
;;
stake-distribution)
mithril_init client
mithril_init client || exit 1
case $2 in
download)
download_stake_distribution
Expand Down
2 changes: 1 addition & 1 deletion scripts/cnode-helper-scripts/mithril-signer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function main() {
generate_environment_file
exit 0
else
mithril_init
mithril_init signer || exit 1
if [[ "${DEPLOY_SYSTEMD}" == "Y" ]]; then
if deploy_systemd ; then
echo "Mithril signer Systemd service successfully deployed"
Expand Down

0 comments on commit 8016b09

Please sign in to comment.