Skip to content

Commit

Permalink
updated start script to use latest quickstart env variables for soroban
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Oct 27, 2023
1 parent af5c8e5 commit c5bf548
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ build-quickstart: build-core build-friendbot build-horizon build-soroban-rpc
docker build -t "$(QUICKSTART_STAGE_IMAGE)" \
--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \
--build-arg STELLAR_CORE_IMAGE_REF=$$CORE_IMAGE_REF \
--build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \
--build-arg HORIZON_IMAGE_REF=$$HORIZON_IMAGE_REF \
--build-arg FRIENDBOT_IMAGE_REF=$$FRIENDBOT_IMAGE_REF \
--build-arg SOROBAN_RPC_IMAGE_REF=$$SOROBAN_RPC_IMAGE_REF \
Expand Down
20 changes: 15 additions & 5 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ function main() {
process_args "$@"

if [ ! -z "$TARGET_NETWORK_RPC_URL" ] && [ ! -z "$TARGET_NETWORK" ]; then
echo "Invalid TargetNetwork config, must be TargetNetwork=standalone|futurenet or TargetNetworkRPCURL, aborting test ..." >&2
echo "Invalid TargetNetwork config, must set TargetNetwork or TargetNetworkRPCURL, aborting test ..." >&2
exit 1
fi

if [ -z "$TARGET_NETWORK_RPC_URL" ] && [ "$TARGET_NETWORK" != "standalone" ] && [ "$TARGET_NETWORK" != "futurenet" && ]; then
echo "Invalid TargetNetwork, must be one of standalone or futurenet, aborting test ..." >&2
if [ -z "$TARGET_NETWORK_RPC_URL" ] && \
[ "$TARGET_NETWORK" != "standalone" ] && \
[ "$TARGET_NETWORK" != "local" ] && \
[ "$TARGET_NETWORK" != "futurenet" && ] && \
[ "$TARGET_NETWORK" != "testnet" && ]; then
echo "Invalid TargetNetwork, must be one of: standalone or local(both mean the same), futurenet, or testnet, aborting test ..." >&2
exit 1
fi

Expand Down Expand Up @@ -186,7 +190,7 @@ function process_args() {
done

if [ -z "$TARGET_NETWORK_RPC_URL" ] && [ -z "$TARGET_NETWORK" ]; then
TARGET_NETWORK=standalone
TARGET_NETWORK=local
fi
}

Expand All @@ -205,7 +209,13 @@ function soroban_rpc_status () {
if [ $(expr $COUNTER % 12) -eq 0 ]; then
print_screen_output "waited $(expr $COUNTER / 12) minutes for soroban rpc to report ready state..."
fi
COUNTER=$[$COUNTER +1]
COUNTER=$[$COUNTER +1]

if [ $COUNTER -gt 900 ]; then
echo "Waited longer than 15 minutes for rpc, cancelling and exit."
exit
fi

sleep 5
done
print_screen_output "soroban rpc reported ready status, the service can be used by tools/cli now ..."
Expand Down

0 comments on commit c5bf548

Please sign in to comment.