Commit bebeef14 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

ops: check for URL before trying to query it (#572)

Co-authored-by: default avatarGeorgios Konstantopoulos <me@gakonst.com>
parent 77779a5b
#!/bin/bash #!/bin/bash
RETRIES=${RETRIES:-40} RETRIES=${RETRIES:-40}
# get the addrs from the URL provided if [[ ! -z "$URL" ]]; then
ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL) # get the addrs from the URL provided
# set the env ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL)
export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager') # set the env
export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager')
fi
# waits for l2geth to be up # waits for l2geth to be up
curl --silent \ curl --silent \
......
#!/bin/bash #!/bin/bash
RETRIES=${RETRIES:-60} RETRIES=${RETRIES:-60}
# get the addrs from the URL provided if [[ ! -z "$URL" ]]; then
ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL) # get the addrs from the URL provided
# set the env ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL)
export DATA_TRANSPORT_LAYER__ADDRESS_MANAGER=$(echo $ADDRESSES | jq -r '.AddressManager') # set the env
export DATA_TRANSPORT_LAYER__ADDRESS_MANAGER=$(echo $ADDRESSES | jq -r '.AddressManager')
fi
# go # go
exec node dist/src/services/run.js exec node dist/src/services/run.js
#!/bin/bash #!/bin/bash
RETRIES=${RETRIES:-40} RETRIES=${RETRIES:-40}
VERBOSITY=${VERBOSITY:-6} VERBOSITY=${VERBOSITY:-6}
# get the addrs from the URL provided
ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL)
function envSet() { if [[ ! -z "$URL" ]]; then
VAR=$1 # get the addrs from the URL provided
export $VAR=$(echo $ADDRESSES | jq -r ".$2") ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL)
}
# set all the necessary env vars function envSet() {
envSet ETH1_ADDRESS_RESOLVER_ADDRESS AddressManager VAR=$1
envSet ETH1_L1_CROSS_DOMAIN_MESSENGER_ADDRESS Proxy__OVM_L1CrossDomainMessenger export $VAR=$(echo $ADDRESSES | jq -r ".$2")
envSet ROLLUP_ADDRESS_MANAGER_OWNER_ADDRESS Deployer }
# set the address to the proxy gateway if possible # set all the necessary env vars
envSet ETH1_L1_ETH_GATEWAY_ADDRESS Proxy__OVM_L1ETHGateway envSet ETH1_ADDRESS_RESOLVER_ADDRESS AddressManager
if [ $ETH1_L1_ETH_GATEWAY_ADDRESS == null ]; then envSet ETH1_L1_CROSS_DOMAIN_MESSENGER_ADDRESS Proxy__OVM_L1CrossDomainMessenger
envSet ETH1_L1_ETH_GATEWAY_ADDRESS OVM_L1ETHGateway envSet ROLLUP_ADDRESS_MANAGER_OWNER_ADDRESS Deployer
# set the address to the proxy gateway if possible
envSet ETH1_L1_ETH_GATEWAY_ADDRESS Proxy__OVM_L1ETHGateway
if [ $ETH1_L1_ETH_GATEWAY_ADDRESS == null ]; then
envSet ETH1_L1_ETH_GATEWAY_ADDRESS OVM_L1ETHGateway
fi
fi fi
# wait for the dtl to be up, else geth will crash if it cannot connect # wait for the dtl to be up, else geth will crash if it cannot connect
......
#!/bin/bash #!/bin/bash
RETRIES=${RETRIES:-60} RETRIES=${RETRIES:-60}
# get the addrs from the URL provided if [[ ! -z "$URL" ]]; then
ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL) # get the addrs from the URL provided
# set the env ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL)
export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager') # set the env
export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager')
fi
# waits for l2geth to be up # waits for l2geth to be up
curl \ curl \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment