Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions sh/views/view_chain_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,41 @@
source "$NCTL"/sh/utils/main.sh

#######################################
# Renders on-chain deploy information.
# Displays on-chain deploy information.
# Arguments:
# Deploy hash.
# Deploy hash
# If no deploys are found or no deploy hash provided, prints a message.
#######################################
function main()
{
local DEPLOY_HASH=${1}

$(get_path_to_client) get-deploy \
--node-address "$(get_node_address_rpc)" \
"$DEPLOY_HASH" \
| jq '.result'
if [ -n "$DEPLOY_HASH" ]; then
# If a specific deploy hash is provided, show only that deploy
$(get_path_to_client) get-deploy \
--node-address "$(get_node_address_rpc)" \
"$DEPLOY_HASH"
else
# No deploy hash provided:
echo "no deploy hash provided, please provide a deploy hash to get the deploy information"
fi
}

# ----------------------------------------------------------------
# ENTRY POINT
# ----------------------------------------------------------------

DEPLOY_HASH=""

for ARGUMENT in "$@"
do
KEY=$(echo "$ARGUMENT" | cut -f1 -d=)
VALUE=$(echo "$ARGUMENT" | cut -f2 -d=)
case "$KEY" in
deploy) DEPLOY_HASH=${VALUE} ;;
*)
# Ignore other arguments
;;
esac
done

main "$DEPLOY_HASH"

Loading