Skip to content

Commit

Permalink
proxy: add cosmoshub and evmos subnode to public endpoints, proxied t…
Browse files Browse the repository at this point in the history
…o notionalapi
  • Loading branch information
baabeetaa committed Oct 31, 2023
1 parent b8df62d commit 52707fb
Showing 1 changed file with 36 additions and 39 deletions.
75 changes: 36 additions & 39 deletions proxy/public/generate_upstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ dydx-archive-sub
dydx-testnet
dydx
emoney
evmos
evmos-testnet
evmos
fetchhub
gravitybridge
injective-testnet
Expand Down Expand Up @@ -131,43 +131,40 @@ done

sleep 1
########################################################################################################################
# SERVICES_SUBNODE="cosmoshub evmos"
# for service_name in $SERVICES_SUBNODE; do
# gw_ip=$(dig +short "tasks.sub_$service_name")
# if [[ -z "$gw_ip" ]]; then
# gw_ip="127.0.0.1"
# fi
# cat <<EOT >> $UPSTREAM_CONFIG_FILE_TMP
# upstream backend_rpc_sub_$service_name {
# keepalive 16;
# server $gw_ip:26657;
# }
#
# upstream backend_api_sub_$service_name {
# keepalive 16;
# server $gw_ip:1317;
# }
#
# upstream backend_grpc_sub_$service_name {
# keepalive 16;
# server $gw_ip:9090;
# }
# EOT
#
# if [[ $service_name == evmos* ]]; then
# cat <<EOT >> $UPSTREAM_CONFIG_FILE_TMP
# upstream backend_jsonrpc_sub_$service_name {
# keepalive 16;
# server $gw_ip:8545;
# }
#
# upstream backend_wsjsonrpc_sub_$service_name {
# keepalive 16;
# server $gw_ip:8546;
# }
# EOT
# fi
#
# done
SERVICES_SUBNODE="cosmoshub evmos"
for service_name in $SERVICES_SUBNODE; do
gw_ip=$(dig +short "tasks.napigw_sub_$service_name")
if [[ -z "$gw_ip" ]]; then
gw_ip="127.0.0.1"
fi
cat <<EOT >> $UPSTREAM_CONFIG_FILE_TMP
upstream backend_rpc_sub_$service_name {
keepalive 16;
server $gw_ip:26657;
}
upstream backend_api_sub_$service_name {
keepalive 16;
server $gw_ip:1317;
}
upstream backend_grpc_sub_$service_name {
keepalive 16;
server $gw_ip:9090;
}
EOT

if [[ $service_name == evmos* ]]; then
cat <<EOT >> $UPSTREAM_CONFIG_FILE_TMP
upstream backend_jsonrpc_sub_$service_name {
keepalive 16;
server $gw_ip:8545;
}
upstream backend_wsjsonrpc_sub_$service_name {
keepalive 16;
server $gw_ip:8546;
}
EOT
fi

done

sleep 1

0 comments on commit 52707fb

Please sign in to comment.