From 4d915829f6526ebcecd6e7430c9e1d7352c56e4e Mon Sep 17 00:00:00 2001 From: Kiril Mihaylov <80464733+KirilMihaylov@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:11:26 +0300 Subject: [PATCH] feat(scripts): Add options for setting node address --- scripts/add-new-dex.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/add-new-dex.sh b/scripts/add-new-dex.sh index 6992a1cc..b4ad044b 100755 --- a/scripts/add-new-dex.sh +++ b/scripts/add-new-dex.sh @@ -8,7 +8,8 @@ SCRIPTS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) source "$SCRIPTS_DIR"/internal/verify.sh source "$SCRIPTS_DIR"/internal/add-dex-support.sh -NOLUS_NET="http://localhost:26612/" +NOLUS_NETWORK_ADDR="localhost" +NOLUS_NETWORK_RPC_PORT="26612" NOLUS_HOME_DIR="$HOME/.nolus" NOLUS_MONEY_MARKET_DIR="$SCRIPTS_DIR/../../nolus-money-market" ACCOUNT_KEY_TO_FEED_HERMES_ADDRESS="reserve" @@ -47,6 +48,8 @@ while [[ $# -gt 0 ]]; do printf \ "Usage: %s [--nolus-home-dir ] + [--nolus-network-addr ] + [--nolus-network-port ] [--nolus-money-market-dir ] [--account-key-to-feed-hermes-address ] [--dex-admin-key ] @@ -79,6 +82,16 @@ while [[ $# -gt 0 ]]; do shift 2 ;; + --nolus-network-addr) + NOLUS_NETWORK_ADDR="$2" + shift 2 + ;; + + --nolus-network-port) + NOLUS_NETWORK_RPC_PORT="$2" + shift 2 + ;; + --nolus-money-market-dir) NOLUS_MONEY_MARKET_DIR="$2" shift 2 @@ -240,6 +253,8 @@ dex_account_setup "$HERMES_BINARY_DIR_PATH" "$CHAIN_ID" "$HERMES_CONFIG_DIR_PATH NOLUS_HERMES_ADDRESS=$(get_hermes_address "$HERMES_BINARY_DIR_PATH" "$NOLUS_CHAIN_ID") +NOLUS_NET="http://${NOLUS_NETWORK_ADDR}:${NOLUS_NETWORK_RPC_PORT}/" + # Open a connection (exports CONNECTION_ID) open_connection "$NOLUS_NET" "$NOLUS_HOME_DIR" "$ACCOUNT_KEY_TO_FEED_HERMES_ADDRESS" "$HERMES_BINARY_DIR_PATH" \ "$NOLUS_HERMES_ADDRESS" "$NOLUS_CHAIN_ID" "$CHAIN_ID"