diff --git a/.github/workflows/Dockerfile.yml b/.github/workflows/Dockerfile.yml index 62022d8..148f9d4 100644 --- a/.github/workflows/Dockerfile.yml +++ b/.github/workflows/Dockerfile.yml @@ -5,7 +5,7 @@ on: branches: - master tags: - - '*' + - "*" pull_request: release: types: [published] @@ -19,55 +19,69 @@ env: # the only time system test image needs to be defined for a push is when it's a non 'v' tag creation PUSH_ENABLED: ${{ secrets.DOCKERHUB_TOKEN && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') != true && 'true' || 'false' }} IMAGE: ${{ format('{0}/{1}:{2}', secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io', github.repository, github.ref_type == 'tag' && github.ref_name || github.event.ref || 'latest') }} - CORE_GIT_REF: https://github.com/stellar/stellar-core.git#master - STELLAR_RPC_GIT_REF: https://github.com/stellar/stellar-rpc.git#protocol-23 - RUST_TOOLCHAIN_VERSION: stable SOROBAN_CLI_GIT_REF: https://github.com/stellar/soroban-tools.git#main - QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#main # leaving sdk npm version blank defaults to whatever npm has for latest version # rather than build from git source, which is fine for ci test build JS_STELLAR_SDK_NPM_VERSION: - RS_XDR_GIT_REPO: https://github.com/stellar/rs-stellar-xdr - RS_XDR_GIT_REF: main jobs: complete: if: always() needs: [build] runs-on: ubuntu-latest steps: - - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') - run: exit 1 + - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') + run: exit 1 build: runs-on: ubuntu-latest-16-cores outputs: push_enabled: ${{ env.PUSH_ENABLED }} steps: - - uses: actions/checkout@v4 - with: - ref: ${{ env.HEAD_SHA }} - - name: Build System Test Image - run: | - make CORE_GIT_REF=${{ env.CORE_GIT_REF }} \ - CORE_COMPILE_CONFIGURE_FLAGS="${{ env.CORE_COMPILE_CONFIGURE_FLAGS }}" \ - STELLAR_RPC_GIT_REF=${{ env.STELLAR_RPC_GIT_REF }} \ - RUST_TOOLCHAIN_VERSION=${{ env.RUST_TOOLCHAIN_VERSION }} \ - SOROBAN_CLI_GIT_REF=${{ env.SOROBAN_CLI_GIT_REF }} \ - SYSTEM_TEST_IMAGE=${{ env.PUSH_ENABLED == 'true' && env.IMAGE || 'stellar/system-test:dev' }} \ - JS_STELLAR_SDK_NPM_VERSION=${{ env.JS_STELLAR_SDK_NPM_VERSION }} \ - RS_XDR_GIT_REPO=${{ env.RS_XDR_GIT_REPO }} \ - RS_XDR_GIT_REF=${{ env.RS_XDR_GIT_REF }} \ - QUICKSTART_GIT_REF=${{ env.QUICKSTART_GIT_REF }} build; - - if: ${{ env.PUSH_ENABLED == 'true' }} - name: Save Docker Image to file - run: | - docker save ${{ env.IMAGE }} -o /tmp/image; - - if: ${{ env.PUSH_ENABLED == 'true' }} - name: Upload System Test Image - uses: actions/upload-artifact@v4 - with: - name: image-Dockerfile - path: /tmp/image + - uses: actions/checkout@v4 + with: + ref: ${{ env.HEAD_SHA }} + - name: Restore image cache + id: image-cache + uses: actions/cache/restore@v4 + with: + path: /tmp/image.tar.zst + key: systemtest-image-${{ runner.os }}-${{ github.sha }} + + - name: Load cached Docker image + if: steps.image-cache.outputs.cache-hit == 'true' + run: | + zstd -d -c /tmp/image.tar.zst | docker load + + - name: Build System Test Image + if: steps.image-cache.outputs.cache-hit != 'true' + run: | + make SYSTEM_TEST_IMAGE=${{ env.PUSH_ENABLED == 'true' && env.IMAGE || 'stellar/system-test:dev' }} \ + JS_STELLAR_SDK_NPM_VERSION=${{ env.JS_STELLAR_SDK_NPM_VERSION }} \ + build; + + - name: Save Docker Image to file + if: steps.image-cache.outputs.cache-hit != 'true' + run: | + docker save ${{ env.PUSH_ENABLED == 'true' && env.IMAGE || 'stellar/system-test:dev' }} | zstd -19 -o /tmp/image.tar.zst + + - name: Save image cache + if: steps.image-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: /tmp/image.tar.zst + key: systemtest-image-${{ runner.os }}-${{ github.sha }} + + - if: ${{ env.PUSH_ENABLED == 'true' }} + name: Decompress image for upload + run: | + zstd -d /tmp/image.tar.zst -o /tmp/image.tar + + - if: ${{ env.PUSH_ENABLED == 'true' }} + name: Upload System Test Image + uses: actions/upload-artifact@v4 + with: + name: image-Dockerfile + path: /tmp/image.tar push: # Only push non 'vX.Y.Z' tags as pre-built system test image with versions compiled into image. @@ -80,16 +94,16 @@ jobs: runs-on: ubuntu-latest if: needs.build.outputs.push_enabled == 'true' steps: - - uses: actions/checkout@v4 - with: - ref: ${{ env.HEAD_SHA }} - - id: push - uses: ./.github/actions/push - with: - head_sha: ${{ env.HEAD_SHA }} - artifact_name: image-Dockerfile - artifact_image_file: image - image: ${{ env.IMAGE }} - registry: ${{ secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io' }} - username: ${{ secrets.DOCKERHUB_USERNAME || github.actor }} - password: ${{ secrets.DOCKERHUB_TOKEN || github.token }} + - uses: actions/checkout@v4 + with: + ref: ${{ env.HEAD_SHA }} + - id: push + uses: ./.github/actions/push + with: + head_sha: ${{ env.HEAD_SHA }} + artifact_name: image-Dockerfile + artifact_image_file: image.tar + image: ${{ env.IMAGE }} + registry: ${{ secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io' }} + username: ${{ secrets.DOCKERHUB_USERNAME || github.actor }} + password: ${{ secrets.DOCKERHUB_TOKEN || github.token }} diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml new file mode 100644 index 0000000..7397b8c --- /dev/null +++ b/.github/workflows/test-workflow.yml @@ -0,0 +1,341 @@ +name: Systems test workflow, next gen, uses quickstart pipelines + +on: + workflow_call: + inputs: + runner: + description: "GitHub runner to use" + required: false + type: string + default: "ubuntu-latest" + + system-test-git-ref: + description: "the git ref (branch, tag, sha) to use for system-test" + required: false + type: string + default: master + + stellar-cli-repo: + description: "The git repo for stellar-cli" + required: false + type: string + default: "stellar/stellar-cli" + stellar-cli-ref: + description: | + git ref of stellar cli software version to build + required: false + type: string + + stellar-cli-crate-version: + description: | + version of stellar-cli crate to use, if not using git ref and repo + required: false + type: string + + test-filter: + description: | + example filter for all combos of one scenario outline: ^TestDappDevelop$/^DApp developer compiles, deploys and invokes a contract.*$ + each row in example data for a scenario outline is postfixed with '#01', '#02', example: + TestDappDevelop/DApp developer compiles, deploys and invokes a contract#01 + required: false + type: string + default: "^TestDappDevelop$/^.*$" + + js-stellar-sdk-npm-version: + description: | + set the version of js-stellar-sdk to use, need to choose one of either + resolution options, using this for npm release or a gh ref using js-stellar-sdk-ref: + required: false + type: string + + js-stellar-sdk-repo: + description: | + set the version of stellar-sdk based on a gh repo, e.g. stellar/js-stellar-sdk + if set, takes precedence over js-stellar-sdk-npm-version + required: false + type: string + + js-stellar-sdk-ref: + description: "The git ref (branch, tag, sha) to use for js-stellar-sdk if using gh repo option" + required: false + type: string + + stellar-xdr-ref: + description: "git ref of stellar-xdr to use" + required: true + type: string + + stellar-core-ref: + description: "git ref of stellar-core to use" + required: true + type: string + stellar-rpc-repo: + description: "The git repo to use for stellar-rpc" + required: false + type: string + default: "stellar/stellar-rpc" + + stellar-rpc-ref: + description: "git ref of stellar-rpc to use" + required: true + type: string + + horizon-ref: + description: "git ref of stellar/stellar-horizon to use" + required: true + type: string + + friendbot-ref: + description: "git ref of stellar/friendbot to use" + required: true + type: string + + lab-ref: + description: "git ref of stellar laboratory to use" + required: true + type: string + + protocol-version: + description: "Protocol version to use" + required: true + type: string + + rust-toolchain-version: + description: "Version of Rust toolchain to use in test runtime environment" + required: true + type: string + + verbose-output: + required: false + type: boolean + default: true + + soroban-examples-ref: + description: "The git ref (branch, tag, sha) to use for soroban-examples" + required: true + type: string + + soroban-examples-repo: + description: "The git repo to use for soroban-examples" + required: false + type: string + default: "stellar/soroban-examples" + +env: + SYSTEM_TEST_IMAGE: stellar/system-test:dev + STELLAR_CLI_STAGED_IMAGE: stellar/system-test-stellar-cli:dev + +jobs: + prepare-config: + runs-on: ubuntu-latest + outputs: + images-config: ${{ steps.set-config.outputs.images }} + system-test-image: "${{ env.SYSTEM_TEST_IMAGE}}" + stellar-cli-staged-image: "${{ env.STELLAR_CLI_STAGED_IMAGE}}" + cli-image-cache-key: ${{ steps.compute-cache-keys.outputs.cli-image-cache-key }} + system-test-image-cache-key: ${{ steps.compute-cache-keys.outputs.system-test-image-cache-key }} + steps: + - id: compute-cache-keys + run: | + # Helper function to resolve ref to commit SHA + get_commit_sha() { + local repo="$1" + local ref="$2" + + # Return empty if either repo or ref is blank + if [ -z "$repo" ] || [ -z "$ref" ]; then + echo "" + return + fi + + # Fetch the commit SHA for the ref (works for branches, tags, and SHAs) + local sha=$(git ls-remote "https://github.com/$repo.git" "$ref" 2>/dev/null | cut -f1) + echo "${sha:-$ref}" + } + + # Resolve commit SHAs for cache key stability + CLI_SHA=$(get_commit_sha "${{ inputs.stellar-cli-repo }}" "${{ inputs.stellar-cli-ref }}") + JS_SDK_SHA=$(get_commit_sha "${{ inputs.js-stellar-sdk-repo }}" "${{ inputs.js-stellar-sdk-ref }}") + SYSTEM_TEST_SHA=$(get_commit_sha "stellar/system-test" "${{ inputs.system-test-git-ref }}") + + # Compute CLI image cache key + CLI_CACHE_INPUT="${{ runner.os }}-${{ inputs.stellar-cli-repo }}-$CLI_SHA-${{ inputs.stellar-cli-crate-version }}" + CLI_CACHE_KEY="cli-image-$(echo -n "$CLI_CACHE_INPUT" | sha256sum | cut -d' ' -f1)" + echo "cli-image-cache-key=$CLI_CACHE_KEY" >> $GITHUB_OUTPUT + + # Compute system test image cache key (includes CLI key + additional inputs) + SYSTEM_TEST_CACHE_INPUT="$CLI_CACHE_KEY-${{ inputs.js-stellar-sdk-repo }}-$JS_SDK_SHA-${{ inputs.js-stellar-sdk-npm-version }}-${{ inputs.rust-toolchain-version }}-$SYSTEM_TEST_SHA" + SYSTEM_TEST_CACHE_KEY="system-test-image-$(echo -n "$SYSTEM_TEST_CACHE_INPUT" | sha256sum | cut -d' ' -f1)" + echo "system-test-image-cache-key=$SYSTEM_TEST_CACHE_KEY" >> $GITHUB_OUTPUT + + - id: set-config + run: | + cat <> $GITHUB_OUTPUT + images</dev/null || stat -c%s /tmp/cli-image.tar.zst 2>/dev/null); \ + echo "Finished CLI image extract, compressed size = $CLI_SIZE bytes"; \ + fi + echo "Starting system test image extract and compression..." + docker save $SYSTEM_TEST_IMAGE | zstd -vv -10 -o /tmp/system-test-image.tar.zst + SYSTEM_SIZE=$(stat -f%z /tmp/system-test-image.tar.zst 2>/dev/null || stat -c%s /tmp/system-test-image.tar.zst 2>/dev/null) + echo "Finished system test image extract, compressed size = $SYSTEM_SIZE bytes" + + - name: Save cache for cli + uses: actions/cache/save@v4 + if: steps.restore-cli-image.outputs.cache-hit != 'true' + with: + path: /tmp/cli-image.tar.zst + key: ${{ needs.prepare-config.outputs.cli-image-cache-key }} + - name: Save cache for system test image + uses: actions/cache/save@v4 + if: steps.restore-system-test-image.outputs.cache-hit != 'true' + with: + path: /tmp/system-test-image.tar.zst + key: ${{ needs.prepare-config.outputs.system-test-image-cache-key }} + - name: save file to artifact + uses: actions/upload-artifact@v4 + with: + name: image-system-test + path: /tmp/system-test-image.tar.zst + + integration: + name: System tests + needs: [build-system-test, build-quickstart, prepare-config] + # Run if build-system-test succeeded OR was skipped because image is already in built(cache hit) + if: always() && (needs.build-system-test.result == 'success' || needs.build-system-test.result == 'skipped') + + strategy: + matrix: + scenario-filter: ["${{ inputs.test-filter }}"] + runs-on: ubuntu-latest + env: + SYSTEM_TEST_IMAGE: ${{ needs.prepare-config.outputs.system-test-image }} + steps: + - name: Start quickstart with rpc + uses: stellar/quickstart@main + with: + artifact: image-quickstart-rpc-custom-amd64.tar + tag: rpc-custom-amd64 + enable: core,rpc + - name: Download system-test image artifact + uses: actions/download-artifact@v4 + with: + name: image-system-test + path: /tmp/ + - name: load system-test image from artifact file + run: | + zstd -d -c /tmp/system-test-image.tar.zst | docker load + + - name: Run system test scenarios + run: | + docker run \ + --add-host=host.docker.internal:host-gateway \ + --rm -t --name e2e_test $SYSTEM_TEST_IMAGE \ + --VerboseOutput ${{ inputs.verbose-output }} \ + --TargetNetworkRPCURL http://host.docker.internal:8000/rpc \ + --TestFilter "${{ matrix.scenario-filter }}" \ + --SorobanExamplesGitHash ${{ inputs.soroban-examples-ref }} \ + --SorobanExamplesRepoURL https://github.com/${{ inputs.soroban-examples-repo }} diff --git a/.gitignore b/.gitignore index 74c80e4..3e5f133 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ systest.sublime-project systest.sublime-workspace .quickstart_repo node_modules/ +cli_oci_image diff --git a/Dockerfile b/Dockerfile index 9b33967..988bce7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG QUICKSTART_IMAGE_REF=stellar/quickstart:soroban-dev +ARG BASE_IMAGE_REF=ubuntu:24.04 ARG STELLAR_CLI_IMAGE_REF=stellar/system-test-soroban-cli:dev FROM golang:1.24 AS go @@ -22,13 +22,13 @@ ADD features/dapp_develop/dapp_develop.feature ./bin ADD features/dapp_develop/soroban_config.exp ./bin FROM $STELLAR_CLI_IMAGE_REF AS stellar-cli -FROM $QUICKSTART_IMAGE_REF AS base +FROM $BASE_IMAGE_REF AS base ARG RUST_TOOLCHAIN_VERSION ARG NODE_VERSION ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y build-essential expect git libdbus-1-dev libudev-dev && apt-get clean +RUN apt-get update && apt-get install -y build-essential expect curl jq git libdbus-1-dev libudev-dev && apt-get clean # Install Rust RUN ["mkdir", "-p", "/rust"] @@ -38,14 +38,12 @@ ENV RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION ENV PATH="/usr/local/go/bin:$CARGO_HOME/bin:${PATH}" RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN_VERSION" RUN rustup show active-toolchain || rustup toolchain install -# Older toolchain to compile soroban examples -RUN rustup toolchain install 1.81-x86_64-unknown-linux-gnu # Wasm toolchain to compile contracts RUN rustup target add wasm32v1-none # Use a non-root user ARG USERNAME=tester -ARG USER_UID=1000 +ARG USER_UID=1018 ARG USER_GID=$USER_UID RUN groupadd --gid $USER_GID $USERNAME \ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ diff --git a/Dockerfile.core b/Dockerfile.core deleted file mode 100644 index 41cca6d..0000000 --- a/Dockerfile.core +++ /dev/null @@ -1,8 +0,0 @@ -ARG CORE_IMAGE= - -FROM $CORE_IMAGE AS stellar-core - -FROM ubuntu -ARG CORE_IMAGE_BIN_PATH= - -COPY --from=stellar-core ${CORE_IMAGE_BIN_PATH} /usr/local/bin/stellar-core diff --git a/Makefile b/Makefile index 91c22f2..53987f2 100644 --- a/Makefile +++ b/Makefile @@ -2,39 +2,20 @@ SHELL:=/bin/bash MAKEFILE_DIR:=$(dir $(abspath $(lastword $(MAKEFILE_LIST)))) .EXPORT_ALL_VARIABLES: -.PHONY: build build-quickstart build-core build-friendbot build-horizon build-stellar-rpc +.PHONY: build SYSTEM_TEST_SHA=$(shell git rev-parse HEAD) -QUICKSTART_STAGE_IMAGE=stellar/system-test-base:dev -CORE_STAGE_IMAGE=stellar/system-test-core:dev -HORIZON_STAGE_IMAGE=stellar/system-test-horizon:dev -RS_XDR_STAGE_IMAGE=stellar/system-test-rs-xdr:dev -FRIENDBOT_STAGE_IMAGE=stellar/system-test-friendbot:dev -STELLAR_RPC_STAGE_IMAGE=stellar/system-test-stellar-rpc:dev STELLAR_CLI_STAGE_IMAGE=stellar/system-test-stellar-cli:dev -LAB_STAGE_IMAGE=stellar/system-test-stellar-laboratory:dev # The rest of these variables can be set as environment variables to the makefile # to modify how system test is built. -# The default protocol version that the image should start with. Should -# typically be set to the maximum supported protocol version of all components. -# If not set will default to the core max supported protocol version in quickstart. -PROTOCOL_VERSION_DEFAULT=23 - # variables to set for source code, can be any valid docker context url local # path github remote repo `https://github.com/repo#` -CORE_GIT_REF=https://github.com/stellar/stellar-core.git\#master -STELLAR_RPC_GIT_REF=https://github.com/stellar/stellar-rpc.git\#main STELLAR_CLI_GIT_REF=https://github.com/stellar/stellar-cli.git\#main -GO_GIT_REF=https://github.com/stellar/go.git\#master -RS_XDR_GIT_REPO=https://github.com/stellar/rs-stellar-xdr -RS_XDR_GIT_REF=main -QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git\#main -# specify the published npm repo version of soroban-client js library, -# or you can specify gh git ref url as the version -JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git\#master +# if crate version is set, then it overrides STELLAR_CLI_GIT_REF, cli will be installed from this create instead +STELLAR_CLI_CRATE_VERSION= # variables to set if wanting to use existing dockerhub images instead of compiling # image during build. if using this option, the image ref should provide a version for same @@ -42,172 +23,37 @@ JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git\#master # # image must have soroban cli bin at /usr/local/cargo/bin/soroban STELLAR_CLI_IMAGE= -# -# image must have soroban rpc bin at /bin/stellar-rpc -STELLAR_RPC_IMAGE= -# -# image must have horizon bin at /go/bin/horizon -HORIZON_IMAGE= -# -# image must have friendbot bin at /app/friendbot -FRIENDBOT_IMAGE= -# -# image must have the bin at /usr/local/cargo/bin/stellar-xdr -RS_XDR_IMAGE= -# -# image with stellar-core binary, assumes core bin at /usr/local/bin/stellar-core -CORE_IMAGE= -# define a custom path that core bin is located on CORE_IMAGE, other than /usr/local/bin/stellar-core -CORE_IMAGE_BIN_PATH= -# -# a prebuilt 'soroban-dev' image from the quickstart repo, if this is supplied, -# the other core, rpc, horizon, friendbot config settings are mostly ignored, since the quickstart image -# has them compiled in already. the 'stellar/quickstart' images also support multi-arch, so the build will -# work those images whether the build host is arm64 or amd64. -QUICKSTART_IMAGE= +# defauult node version to install in system test image NODE_VERSION?=20.19.4 -# if crate version is set, then it overrides STELLAR_CLI_GIT_REF, cli will be installed from this create instead -STELLAR_CLI_CRATE_VERSION= +# specify the published npm repo version of soroban-client js library, +# or you can specify gh git ref url as the version +JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git\#master # sets the rustc version in the system test image RUST_TOOLCHAIN_VERSION=stable -# temporarily needed, builds core with soroban enabled features -CORE_COMPILE_CONFIGURE_FLAGS=--disable-tests - # the final image name that is created in local docker images store for system test SYSTEM_TEST_IMAGE=stellar/system-test:dev -build-friendbot: - if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(FRIENDBOT_IMAGE)" ]; then \ - SOURCE_URL="$(GO_GIT_REF)"; \ - if [[ ! "$(GO_GIT_REF)" =~ \.git ]]; then \ - pushd "$(GO_GIT_REF)"; \ - SOURCE_URL=.; \ - fi; \ - docker build -t "$(FRIENDBOT_STAGE_IMAGE)" \ - --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ - -f services/friendbot/docker/Dockerfile "$$SOURCE_URL"; \ - fi - -build-rs-xdr: - if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(RS_XDR_IMAGE)" ]; then \ - SOURCE_URL="$(QUICKSTART_GIT_REF)"; \ - if [[ ! "$(QUICKSTART_GIT_REF)" =~ \.git ]]; then \ - pushd "$(QUICKSTART_GIT_REF)"; \ - SOURCE_URL=.; \ - fi; \ - docker build -t "$(RS_XDR_STAGE_IMAGE)" --target builder \ - --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ - --build-arg REPO=$$RS_XDR_GIT_REPO \ - --build-arg REF=$$RS_XDR_GIT_REF \ - -f Dockerfile.xdr "$$SOURCE_URL"; \ - fi - -build-stellar-rpc: - if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(STELLAR_RPC_IMAGE)" ]; then \ - SOURCE_URL="$(STELLAR_RPC_GIT_REF)"; \ - if [[ ! "$(STELLAR_RPC_GIT_REF)" =~ \.git ]]; then \ - pushd "$(STELLAR_RPC_GIT_REF)"; \ - SOURCE_URL=.; \ - fi; \ - docker build -t "$(STELLAR_RPC_STAGE_IMAGE)" --target build \ - --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ - -f cmd/stellar-rpc/docker/Dockerfile "$$SOURCE_URL"; \ - fi - build-stellar-cli: if [ -z "$(STELLAR_CLI_IMAGE)" ]; then \ DOCKERHUB_RUST_VERSION=rust:$$( [ "$(RUST_TOOLCHAIN_VERSION)" = "stable" ] && echo "latest" || echo "$(RUST_TOOLCHAIN_VERSION)"); \ - docker buildx build -t "$(STELLAR_CLI_STAGE_IMAGE)" --target builder \ + docker buildx build --progress=plain --load -t "$(STELLAR_CLI_STAGE_IMAGE)" --target builder \ --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ --build-arg DOCKERHUB_RUST_VERSION="$$DOCKERHUB_RUST_VERSION" \ --build-arg STELLAR_CLI_CRATE_VERSION="$(STELLAR_CLI_CRATE_VERSION)" \ -f- $(STELLAR_CLI_GIT_REF) < $(MAKEFILE_DIR)Dockerfile.stellar-cli; \ fi -build-horizon: - if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(HORIZON_IMAGE)" ]; then \ - SOURCE_URL="$(GO_GIT_REF)"; \ - if [[ ! "$(GO_GIT_REF)" =~ \.git ]]; then \ - pushd "$(GO_GIT_REF)"; \ - SOURCE_URL=.; \ - fi; \ - docker build -t "$(HORIZON_STAGE_IMAGE)" \ - --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ - --target builder -f services/horizon/docker/Dockerfile.dev "$$SOURCE_URL"; \ - fi - -build-core: - if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(CORE_IMAGE)" ]; then \ - SOURCE_URL="$(CORE_GIT_REF)"; \ - if [[ ! "$(CORE_GIT_REF)" =~ \.git ]]; then \ - pushd "$(CORE_GIT_REF)"; \ - SOURCE_URL=.; \ - fi; \ - docker build -t "$(CORE_STAGE_IMAGE)" \ - --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ - --build-arg CONFIGURE_FLAGS="$(CORE_COMPILE_CONFIGURE_FLAGS)" \ - -f docker/Dockerfile.testing "$$SOURCE_URL"; \ - fi; \ - if [ ! -z "$(CORE_IMAGE)" ] && [ ! -z "$(CORE_IMAGE_BIN_PATH)" ]; then \ - docker build -t "$(CORE_STAGE_IMAGE)" \ - --build-arg CORE_IMAGE="$(CORE_IMAGE)" \ - --build-arg CORE_IMAGE_BIN_PATH="$(CORE_IMAGE_BIN_PATH)" \ - -f Dockerfile.core .; \ - fi - -build-lab: - # only build if we don't have a qs image - if [ -z "$(QUICKSTART_IMAGE)" ]; then \ - SOURCE_URL="$(QUICKSTART_GIT_REF)"; \ - if [[ ! "$(QUICKSTART_GIT_REF)" =~ \.git ]]; then \ - pushd "$(QUICKSTART_GIT_REF)"; \ - SOURCE_URL=.; \ - fi; \ - docker build -t "$(LAB_STAGE_IMAGE)" \ - --build-arg NEXT_PUBLIC_COMMIT_HASH=main \ - --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ - -f Dockerfile.lab "$$SOURCE_URL"; \ - fi - -build-quickstart: build-lab build-core build-friendbot build-horizon build-rs-xdr build-stellar-rpc - if [ -z "$(QUICKSTART_IMAGE)" ]; then \ - CORE_IMAGE_REF=$$( [[ -z "$(CORE_IMAGE)" || ! -z "$(CORE_IMAGE_BIN_PATH)" ]] && echo "$(CORE_STAGE_IMAGE)" || echo "$(CORE_IMAGE)"); \ - HORIZON_IMAGE_REF=$$( [ -z "$(HORIZON_IMAGE)" ] && echo "$(HORIZON_STAGE_IMAGE)" || echo "$(HORIZON_IMAGE)"); \ - FRIENDBOT_IMAGE_REF=$$( [ -z "$(FRIENDBOT_IMAGE)" ] && echo "$(FRIENDBOT_STAGE_IMAGE)" || echo "$(FRIENDBOT_IMAGE)"); \ - STELLAR_RPC_IMAGE_REF=$$( [ -z "$(STELLAR_RPC_IMAGE)" ] && echo "$(STELLAR_RPC_STAGE_IMAGE)" || echo "$(STELLAR_RPC_IMAGE)"); \ - RS_XDR_IMAGE_REF=$$( [ -z "$(RS_XDR_IMAGE)" ] && echo "$(RS_XDR_STAGE_IMAGE)" || echo "$(RS_XDR_IMAGE)"); \ - SOURCE_URL="$(QUICKSTART_GIT_REF)"; \ - if [[ ! "$(QUICKSTART_GIT_REF)" =~ \.git ]]; then \ - pushd "$(QUICKSTART_GIT_REF)"; \ - SOURCE_URL=.; \ - fi; \ - docker build -t "$(QUICKSTART_STAGE_IMAGE)" \ - --build-arg PROTOCOL_VERSION_DEFAULT=$$PROTOCOL_VERSION_DEFAULT \ - --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ - --build-arg STELLAR_CORE_IMAGE_REF=$$CORE_IMAGE_REF \ - --build-arg STELLAR_XDR_IMAGE_REF=$$RS_XDR_IMAGE_REF \ - --build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ - --build-arg CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true \ - --build-arg HORIZON_IMAGE_REF=$$HORIZON_IMAGE_REF \ - --build-arg FRIENDBOT_IMAGE_REF=$$FRIENDBOT_IMAGE_REF \ - --build-arg STELLAR_RPC_IMAGE_REF=$$STELLAR_RPC_IMAGE_REF \ - --build-arg LAB_IMAGE_REF=$(LAB_STAGE_IMAGE) \ - -f Dockerfile "$$SOURCE_URL"; \ - fi - -build: build-quickstart build-stellar-cli - QUICKSTART_IMAGE_REF=$$( [ -z "$(QUICKSTART_IMAGE)" ] && echo "$(QUICKSTART_STAGE_IMAGE)" || echo "$(QUICKSTART_IMAGE)"); \ +build: build-stellar-cli STELLAR_CLI_IMAGE_REF=$$( [ -z "$(STELLAR_CLI_IMAGE)" ] && echo "$(STELLAR_CLI_STAGE_IMAGE)" || echo "$(STELLAR_CLI_IMAGE)"); \ - docker build -t "$(SYSTEM_TEST_IMAGE)" -f Dockerfile \ + docker buildx build --progress=plain --load -t "$(SYSTEM_TEST_IMAGE)" -f Dockerfile \ --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ - --build-arg QUICKSTART_IMAGE_REF=$$QUICKSTART_IMAGE_REF \ --build-arg STELLAR_CLI_CRATE_VERSION=$(STELLAR_CLI_CRATE_VERSION) \ --build-arg STELLAR_CLI_IMAGE_REF=$$STELLAR_CLI_IMAGE_REF \ --build-arg RUST_TOOLCHAIN_VERSION=$(RUST_TOOLCHAIN_VERSION) \ --build-arg NODE_VERSION=$(NODE_VERSION) \ --build-arg JS_STELLAR_SDK_NPM_VERSION=$(JS_STELLAR_SDK_NPM_VERSION) \ - --label org.opencontainers.image.revision="$(SYSTEM_TEST_SHA)" .; + --label org.opencontainers.image.revision="$(SYSTEM_TEST_SHA)" .; \ diff --git a/README.md b/README.md index abfa376..98541b4 100644 --- a/README.md +++ b/README.md @@ -2,74 +2,33 @@ ### Running system tests: -Identify the system-test image you want to use for running tests: +Identify the quickstart image you want to use as target for running tests. Quickstart contains the server stack of core, rpc: - Use a prebuilt system test image published as tags under - `dockerhub.io/stellar/system-test` -- Build the system test docker image locally with specific versions of core, - horizon, soroban rpc, rust toolchain, stellar cli, this will create a docker - image named `stellar/system-test:dev`. All `GIT_REF` variables can refer to + `dockerhub.io/stellar/quickstart` +- Or build the system test docker image locally with specific versions of cli and stellar-js-sdk, + this will create a docker image named `stellar/system-test:dev`. All `GIT_REF` variables can refer to either a fully qualified local path to checked out git repo, or a fully qualified github remote repo url `https://github.com/repo#` ``` make - QUICKSTART_GIT_REF=? \ - CORE_GIT_REF=? \ - CORE_COMPILE_CONFIGURE_FLAGS=? \ - STELLAR_RPC_GIT_REF=? \ STELLAR_CLI_GIT_REF=? \ - GO_GIT_REF=? \ RUST_TOOLCHAIN_VERSION=? \ STELLAR_CLI_CRATE_VERSION=? \ JS_STELLAR_SDK_NPM_VERSION=? \ NODE_VERSION=? \ - PROTOCOL_VERSION_DEFAULT=? \ build ``` -example of build using specific git refs, mainline from repos in this example, -or use tags, branches, etc: +all settings have defaults pre-set, and optionally be overriden, refer to the Makefile for the defaulted values. -``` -make CORE_GIT_REF=https://github.com/stellar/stellar-core.git#f1dc39f0f146815e5e3a94ed162e2f0639cb433f \ - CORE_COMPILE_CONFIGURE_FLAGS="--disable-tests --enable-next-protocol-version-unsafe-for-production" \ - STELLAR_RPC_GIT_REF=https://github.com/stellar/soroban-tools.git#main \ - RUST_TOOLCHAIN_VERSION=stable \ - STELLAR_CLI_GIT_REF=https://github.com/stellar/soroban-tools.git#main \ - QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git#main \ - JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git#master \ - build -``` - -example of build using an existing quickstart image, this can dramatically speed -up the build time, as the existing quickstart image will provide the -pre-compiled rpc, and core runtimes already: - -``` -make QUICKSTART_IMAGE=stellar/quickstart:soroban-dev \ - RUST_TOOLCHAIN_VERSION=1.66.0 \ - STELLAR_CLI_GIT_REF=/Users/user/stellar-cli-build -``` - -some settings have defaults pre-set, and optionally be overriden: +#### Optional Build Params ``` +# cli will be compiled from this git ref STELLAR_CLI_GIT_REF=https://github.com/stellar/stellar-cli.git#main -STELLAR_RPC_GIT_REF=https://github.com/stellar/stellar-rpc.git#main -RUST_TOOLCHAIN_VERSION=stable -QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git#main -# the GO_GIT_REF provides the reference on the stellar/go repo from which -# to build horizon -GO_GIT_REF=https://github.com/stellar/go.git#master -CORE_COMPILE_CONFIGURE_FLAGS="--disable-tests" -CORE_GIT_REF=https://github.com/stellar/stellar-core.git#master -JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git#master -``` -optional params to set: - -``` # this will override STELLAR_CLI_GIT_REF, and install stellar cli from crates repo instead STELLAR_CLI_CRATE_VERSION=0.4.0 @@ -86,42 +45,26 @@ JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git#master # platform arch as the build host is running on, i.e. linux/amd64 or linux/arm64. # Otherwise, build will fail if image is not available for matching host platform. # -# this will skip building from source for core(CORE_GIT_REF), rpc(STELLAR_RPC_GIT_REF) and quickstart(QUICKSTART_GIT_REF), instead -# will use the versions already compiled in the existing quickstart docker image provided: -QUICKSTART_IMAGE=/: - -# this will skip building core from CORE_GIT_REF and instead -# will use the `stellar-core` by default at /usr/local/bin/stellar-core in the existing docker image provided: -CORE_IMAGE=/: - -# define a custom path that `stellar-core` bin is located on CORE_IMAGE, -# to override the default of /usr/local/bin/stellar-core -CORE_IMAGE_BIN_PATH= - -# this will skip building stellar-rpc from STELLAR_RPC_GIT_REF and instead -# will use the bin already compiled at /bin/stellar-rpc in the existing docker image provided: -STELLAR_RPC_IMAGE=/: # this will skip building stellar-cli from STELLAR_CLI_GIT_REF and instead # will use the bin already compiled at /usr/local/cargo/bin/soroban in the existing docker image provided: STELLAR_CLI_IMAGE=/: +``` + +#### Required runtime params -# this will skip building horizon from GO_GIT_REF and instead -# will use the bin already compiled at /go/bin/horizon in the existing docker image provided: -HORIZON_IMAGE=/: +Set the target network to test. This just needs to be the RPC server of the network. It can be from a running quickstart instance or testnet or pubnet: + `--TargetNetworkRPCURL {http:///soroban/rpc}` -# this will skip building friendbot from GO_GIT_REF and instead -# will use the bin already compiled at /app/friendbot in the existing docker image provided: -FRIENDBOT_IMAGE=/: +Note - If you are running quickstart as a docker container on the same host machine, then specify the rpc url as `--TargetNetworkRPCURL http://host.docker.internal:8000/rpc` to use Docker's convention to reference host network. -# set the default network protocol version which the internal core runtime built from `CORE_GIT_REF` should start with. -# Should typically be set to the maximum supported protocol version of all components. -# If not set or set to empty, will default to the core max supported protocol version defined in quickstart. -PROTOCOL_VERSION_DEFAULT= -``` +#### Optional runtime params -Optional parameters to pass when running the system-test image, -`stellar/system-test:`: +System test will by default use the network settings for `local` network from quickstart. +If `TargetNetworkRPCURL` is pointed at any stellar network other than a `local` network instance provided from quickstart, then you'll need to provide the network specifics. +`--TargetNetworkPassphrase "{passphrase}"` +`--TargetNetworkTestAccountSecret "{your test account key pair info}"` +`--TargetNetworkTestAccountPublic "{your test account key pair info}"` To specify git version of the smart contract source code used in soroban test fixtures. `--SorobanExamplesGitHash {branch, tag, git commit hash}` @@ -134,46 +77,12 @@ scenario outline is postfixed with '#01', '#02', examples: or `--TestFilter "^TestDappDevelop$/^DApp developer compiles, deploys and invokes a contract#01$"` -The default target network for system tests is a new/empty instance of local -network hosted inside the docker container, tests will use the default root -account already seeded into local network. Alternatively, can override the -network settings for local and remote usages: - -- Tests will use an internally hosted core watcher node: - `--TargetNetwork {standalone|futurenet|testnet}` -- Tests will use an external rpc instance and the container will not run core, - horizon, rpc services internally: - `--TargetNetworkRPCURL {http:///soroban/rpc}` -- Tests use these settings in either target network mode, and these are by - default set to work with local: `--TargetNetworkPassphrase "{passphrase}"` - `--TargetNetworkTestAccountSecret "{your test account key pair info}"` - `--TargetNetworkTestAccountPublic "{your test account key pair info}"` - -Debug mode, the docker container will exit with error code when any pre-setup or -test fails to pass, you can enable DEBUG_MODE flag, and the container will stay -running, prompting you for enter key before shutting down, make sure you invoke -docker with `-it` so the prompt will reach your command line. While container is -kept running, you can shell into it via `docker exec -it ` -and view log files of services in the stack such as core, rpc located in -container at `/var/log/supervisor`. `--DebugMode=true` +Set verbose logging output `--VerboseOutput true` -The docker run follows standard exit code conventions, so if all tests pass in -the container run, exit code from command line execution will be 0, otherwise, -if any failures in container or tests, then exit code will be greater than 0. +#### Running Tests -#### Running Test Examples - -- Run tests against an instance of core and rpc on a local network all running - in the test container: - - ``` - docker run --rm -t --name e2e_test stellar/system-test: \ - --VerboseOutput true - ``` - -- Run tests against a remote instance of rpc configured for testnet, this will - not run core or rpc instances locally in the test container. It requires you - provide a key pair of an account that is funded with Lumens on the target +- Run tests against a remote instance of rpc hosted on a quickstart configured for testnet. + The tests requires you provide a key pair of an account that is funded with Lumens on the target network for the tests to use as source account on transactions it will submit to target network: @@ -184,9 +93,23 @@ if any failures in container or tests, then exit code will be greater than 0. --TargetNetworkPassphrase "Test SDF Network ; September 2015" \ --TargetNetworkTestAccountSecret \ --TargetNetworkTestAccountPublic \ - --SorobanExamplesGitHash v20.0.0-rc2 + --SorobanExamplesGitHash v22.0.1 ``` +#### Debug test failures +Use `--VerboseOutput true` and may need to check the lops of the rpc server instance if you have access to those at same time. + +The docker container will exit with error code when any pre-setup or +test fails to pass, you can enable DEBUG_MODE flag, and the container will stay +running, prompting you for depressing enter key before shutting down, make sure you invoke +docker with `-it` so the prompt will reach your command line. While container is +kept running, you can shell into it via `docker exec -it ` +and manually re-run tests in container, check local outputs. + +The docker run follows standard exit code conventions, so if all tests pass in +the container run, exit code from command line execution will be 0, otherwise, +if any failures in container or tests, then exit code will be greater than 0. + ### Development mode and running tests directly from checked out system-test repo. This approach allows to run the tests from source code directly on host as go @@ -200,17 +123,11 @@ tests, no docker image is used. https://www.rust-lang.org/tools/install 3. `stellar` cli, compile or install via cargo crate a version of stellar cli onto your machine and accessible from PATH. -4. target network stack for the tests to access stellar-rpc instance. You can - use an existing/running instance if reachable or can use the quickstart - image `stellar/quickstart:testing` from dockerhub to run the latest stable - target network stack locally, or build quickstart with specific versions of - core, horizon and soroban rpc first - [following these instructions](https://github.com/stellar/quickstart#building-custom-images) - and run `stellar/quickstart:dev` locally. +4. run an instance of RPC locally by running quickstart on a local network such as `stellar/quickstart:latest`. ``` - docker run --rm -it -p 8000:8000 --name stellar stellar/quickstart:dev --local --enable rpc + docker run --rm -it -p 8000:8000 --name stellar stellar/quickstart:latest --local ``` -5. locally checkout stellar/system-test GH repo and go into top folder - +5. locally checkout stellar/system-test `git clone https://github.com/stellar/system-test.git;cd system-test` #### Running tests locally as go programs diff --git a/events.ts b/events.ts index 6095e93..2cd184c 100755 --- a/events.ts +++ b/events.ts @@ -29,6 +29,7 @@ async function main() { let response = await server.getEvents({ startLedger: Number(ledgerFrom), + endLedger: 0, filters: filters, limit: Number(size) }); diff --git a/start b/start index 8102a0a..aed88b6 100755 --- a/start +++ b/start @@ -5,17 +5,14 @@ set -o pipefail # the versions of software that tests will use SOROBAN_EXAMPLES_GIT_HASH="main" SOROBAN_EXAMPLES_REPO_URL="https://github.com/stellar/soroban-examples.git" -DEBUG_MODE= +DEBUG_MODE=false # the target network under test -TARGET_NETWORK= +# defaults to local quickstart network settings TARGET_NETWORK_PASSPHRASE="Standalone Network ; February 2017" TARGET_NETWORK_SECRET_KEY="SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L" TARGET_NETWORK_PUBLIC_KEY="GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI" -TARGET_NETWORK_RPC_URL= -QUICKSTART_LOG_FILE=/var/log/system-test-quickstart.log -LOCAL_CORE=false -ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=--enable-soroban-diagnostic-events +TARGET_NETWORK_RPC_URL="http://host.docker.internal:8000/rpc" # example filter for all combos of one scenario outline: ^TestDappDevelop$/^DApp developer compiles, deploys and invokes a contract.*$ # each row in example data for a scenario outline is postfixed with '#01', '#02', example: @@ -41,15 +38,6 @@ printout() { trap finish EXIT function finish { - if [ -z "$TARGET_NETWORK_RPC_URL" ] && [ $? -ne 0 ] && [ "$VERBOSE_OUTPUT" != "true" ]; then - # dump the local server logs if they were running in container. - echo "" >&2 - echo "" >&2 - echo "dumping system log output $QUICKSTART_LOG_FILE ..." >&2 - echo "" >&2 - echo "" >&2 - cat $QUICKSTART_LOG_FILE >&2 - fi CANCELLED=true if [ "$DEBUG_MODE" = "true" ]; then @@ -61,56 +49,17 @@ function finish { function main() { process_args "$@" - if [ ! -z "$TARGET_NETWORK_RPC_URL" ] && [ ! -z "$TARGET_NETWORK" ]; then - 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" != "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 + if [ -z "$TARGET_NETWORK_RPC_URL" ]; then + echo "Invalid, TargetNetworkRPCUrl must be set" >&2 exit 1 fi - if [ -z "$TARGET_NETWORK_RPC_URL" ]; then - - TARGET_NETWORK_RPC_URL=http://localhost:8000/rpc - LOCAL_CORE=true - print_screen_output "starting target stack on $TARGET_NETWORK with following server versions:" - print_screen_output " CORE VERSION=$(stellar-core version 2>/dev/null || echo "n/a")" - print_screen_output " HORIZON VERSION=$(stellar-horizon version 2>/dev/null || echo "n/a")" - print_screen_output " STELLAR RPC VERSION=$(stellar-rpc version 2>/dev/null || echo "n/a")" - - if [ "$TARGET_NETWORK" = "futurenet" ]; then - TARGET_NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022" - fi - - if [ "$VERBOSE_OUTPUT" = "true" ]; then - # redirects all quickstart output to console during test execution - /start --$TARGET_NETWORK --enable rpc $ENABLE_SOROBAN_DIAGNOSTIC_EVENTS --logs 2>&1 & - else - # don't show any quickstart output on console during test execution - # all quickstart output is redirected(buffering disabled) to log file, which will be dumped to - # console if tests fail. - stdbuf -o0 -e0 /start --$TARGET_NETWORK --enable rpc $ENABLE_SOROBAN_DIAGNOSTIC_EVENTS --logs >> $QUICKSTART_LOG_FILE 2>&1 & - fi - fi - stellar_rpc_status - # quickstart runs horizon, but sys tests don't need it. - if [ "$LOCAL_CORE" = "true" ]; then - supervisorctl stop horizon - fi - print_screen_output " RUST_TOOLCHAIN_VERSION=$(rustc --version 2>/dev/null || echo"n/a" )" print_screen_output " SOROBAN_CLI_CRATE_VERSION=$(soroban version 2>/dev/null || echo "n/a" )" print_screen_output " SOROBAN_EXAMPLES_GIT_HASH=$SOROBAN_EXAMPLES_GIT_HASH" print_screen_output " SOROBAN_EXAMPLES_REPO_URL=$SOROBAN_EXAMPLES_REPO_URL" - print_screen_output " TARGET_NETWORK=$TARGET_NETWORK" print_screen_output " TARGET_NETWORK_PASSPHRASE=$TARGET_NETWORK_PASSPHRASE" print_screen_output " TARGET_NETWORK_SECRET_KEY=$TARGET_NETWORK_SECRET_KEY" print_screen_output " TARGET_NETWORK_PUBLIC_KEY=$TARGET_NETWORK_PUBLIC_KEY" @@ -127,7 +76,6 @@ function main() { export TargetNetworkPublicKey=${TARGET_NETWORK_PUBLIC_KEY} export TargetNetworkRPCURL=${TARGET_NETWORK_RPC_URL} export VerboseOutput=${VERBOSE_OUTPUT} - export LocalCore=${LOCAL_CORE} export FeaturePath=${FEATURE_PATH} for file in ./*; @@ -170,10 +118,6 @@ function process_args() { VERBOSE_OUTPUT="$1" shift ;; - --TargetNetwork) - TARGET_NETWORK="$1" - shift - ;; --TargetNetworkPassphrase) TARGET_NETWORK_PASSPHRASE="$1" shift @@ -193,10 +137,6 @@ function process_args() { *) esac done - - if [ -z "$TARGET_NETWORK_RPC_URL" ] && [ -z "$TARGET_NETWORK" ]; then - TARGET_NETWORK=local - fi } function stellar_rpc_status () { @@ -216,7 +156,7 @@ function stellar_rpc_status () { fi COUNTER=$[$COUNTER +1] - if [ $COUNTER -gt 900 ]; then + if [ $COUNTER -gt 180 ]; then echo "Waited longer than 15 minutes for Stellar RPC, cancelling and exit." exit 1 fi