Skip to content

Commit

Permalink
feat(scripts): Add options for setting node address
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilMihaylov authored and ivivanov committed Apr 23, 2024
1 parent 71f4980 commit 4d91582
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion scripts/add-new-dex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -47,6 +48,8 @@ while [[ $# -gt 0 ]]; do
printf \
"Usage: %s
[--nolus-home-dir <nolus_home_dir>]
[--nolus-network-addr <nolus_node_listen_address>]
[--nolus-network-port <nolus_node_listen_port>]
[--nolus-money-market-dir <nolus_money_market_dir>]
[--account-key-to-feed-hermes-address <account_key_to_feed_hermes_address>]
[--dex-admin-key <dex_admin_key>]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 4d91582

Please sign in to comment.