get local updatreams too
This commit is contained in:
16
upstreams.sh
16
upstreams.sh
@@ -3,6 +3,8 @@
|
||||
BASEPATH="$(dirname "$0")"
|
||||
source $BASEPATH/.env
|
||||
|
||||
$LOCAL=${1:-false}
|
||||
|
||||
IFS=':' read -ra parts <<< $COMPOSE_FILE
|
||||
|
||||
blacklist=("drpc.yml" "base.yml" "rpc.yml" "monitoring.yml")
|
||||
@@ -37,14 +39,20 @@ for part in "${parts[@]}"; do
|
||||
done
|
||||
|
||||
if $path_include; then
|
||||
url="$DOMAIN$path"
|
||||
|
||||
#echo "$url"
|
||||
|
||||
if [ "$LOCAL" = "true" ]; then
|
||||
url=$(./get-local-name.sh "${part%.yml}")
|
||||
export RPC_URL="http://$url"
|
||||
export WS_URL="ws://$url"
|
||||
else
|
||||
url="$DOMAIN$path"
|
||||
export RPC_URL="https://$url"
|
||||
export WS_URL="wss://$url"
|
||||
fi
|
||||
|
||||
export ID=$(echo "$url" | sed -E 's/^rpc-(.*)\.stakesquid\.eu\/(.*)$/\1-\2/')
|
||||
export PROVIDER=${ORGANIZATION}-${ID}
|
||||
export RPC_URL="https://$url"
|
||||
export WS_URL="wss://$url"
|
||||
|
||||
chain_id=$(curl --ipv4 -m 1 -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' $RPC_URL | jq -r '.result')
|
||||
chain_id_decimal=$((16#${chain_id#0x}))
|
||||
|
||||
Reference in New Issue
Block a user