From caf0a209325d19ca479f2f65ecbea20216398324 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 19 Nov 2024 19:06:53 +0100 Subject: [PATCH] Rename Soroban RPC to Stellar RPC --- .github/workflows/Dockerfile.yml | 4 ++-- Makefile | 30 +++++++++++++++--------------- README.md | 18 +++++++++--------- start | 8 ++++---- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/Dockerfile.yml b/.github/workflows/Dockerfile.yml index 438247d..676ac38 100644 --- a/.github/workflows/Dockerfile.yml +++ b/.github/workflows/Dockerfile.yml @@ -20,7 +20,7 @@ env: 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 - SOROBAN_RPC_GIT_REF: https://github.com/stellar/soroban-rpc.git#main + STELLAR_RPC_GIT_REF: https://github.com/stellar/stellar-rpc.git#main 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#master @@ -50,7 +50,7 @@ jobs: run: | make CORE_GIT_REF=${{ env.CORE_GIT_REF }} \ CORE_COMPILE_CONFIGURE_FLAGS="${{ env.CORE_COMPILE_CONFIGURE_FLAGS }}" \ - SOROBAN_RPC_GIT_REF=${{ env.SOROBAN_RPC_GIT_REF }} \ + 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' }} \ diff --git a/Makefile b/Makefile index ff291d5..52187a4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL:=/bin/bash MAKEFILE_DIR:=$(dir $(abspath $(lastword $(MAKEFILE_LIST)))) .EXPORT_ALL_VARIABLES: -.PHONY: build build-quickstart build-core build-friendbot build-horizon build-soroban-rpc +.PHONY: build build-quickstart build-core build-friendbot build-horizon build-stellar-rpc SYSTEM_TEST_SHA=$(shell git rev-parse HEAD) QUICKSTART_STAGE_IMAGE=stellar/system-test-base:dev @@ -10,7 +10,7 @@ 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 -SOROBAN_RPC_STAGE_IMAGE=stellar/system-test-soroban-rpc:dev +STELLAR_RPC_STAGE_IMAGE=stellar/system-test-stellar-rpc:dev SOROBAN_CLI_STAGE_IMAGE=stellar/system-test-soroban-cli:dev # The rest of these variables can be set as environment variables to the makefile @@ -23,7 +23,7 @@ PROTOCOL_VERSION_DEFAULT= # 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 -SOROBAN_RPC_GIT_REF=https://github.com/stellar/soroban-rpc.git\#main +STELLAR_RPC_GIT_REF=https://github.com/stellar/stellar-rpc.git\#main SOROBAN_CLI_GIT_REF=https://github.com/stellar/soroban-tools.git\#main GO_GIT_REF=https://github.com/stellar/go.git\#master RS_XDR_GIT_REPO=https://github.com/stellar/rs-stellar-xdr @@ -40,8 +40,8 @@ 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 SOROBAN_CLI_IMAGE= # -# image must have soroban rpc bin at /bin/soroban-rpc -SOROBAN_RPC_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= @@ -103,16 +103,16 @@ build-rs-xdr: -f Dockerfile.xdr "$$SOURCE_URL"; \ fi -build-soroban-rpc: - if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(SOROBAN_RPC_IMAGE)" ]; then \ - SOURCE_URL="$(SOROBAN_RPC_GIT_REF)"; \ - if [[ ! "$(SOROBAN_RPC_GIT_REF)" =~ \.git ]]; then \ - pushd "$(SOROBAN_RPC_GIT_REF)"; \ +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 "$(SOROBAN_RPC_STAGE_IMAGE)" --target build \ + docker build -t "$(STELLAR_RPC_STAGE_IMAGE)" --target build \ --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \ - -f cmd/soroban-rpc/docker/Dockerfile "$$SOURCE_URL"; \ + -f cmd/stellar-rpc/docker/Dockerfile "$$SOURCE_URL"; \ fi build-soroban-cli: @@ -156,12 +156,12 @@ build-core: -f Dockerfile.core .; \ fi -build-quickstart: build-core build-friendbot build-horizon build-rs-xdr build-soroban-rpc +build-quickstart: 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)"); \ - SOROBAN_RPC_IMAGE_REF=$$( [ -z "$(SOROBAN_RPC_IMAGE)" ] && echo "$(SOROBAN_RPC_STAGE_IMAGE)" || echo "$(SOROBAN_RPC_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 \ @@ -177,7 +177,7 @@ build-quickstart: build-core build-friendbot build-horizon build-rs-xdr build-so --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 SOROBAN_RPC_IMAGE_REF=$$SOROBAN_RPC_IMAGE_REF \ + --build-arg STELLAR_RPC_IMAGE_REF=$$STELLAR_RPC_IMAGE_REF \ -f Dockerfile "$$SOURCE_URL"; \ fi diff --git a/README.md b/README.md index 51d535d..df83ae1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ QUICKSTART_GIT_REF=? \ CORE_GIT_REF=? \ CORE_COMPILE_CONFIGURE_FLAGS=? \ - SOROBAN_RPC_GIT_REF=? \ + STELLAR_RPC_GIT_REF=? \ SOROBAN_CLI_GIT_REF=? \ GO_GIT_REF=? \ RUST_TOOLCHAIN_VERSION=? \ @@ -26,7 +26,7 @@ ``` 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" \ - SOROBAN_RPC_GIT_REF=https://github.com/stellar/soroban-tools.git#main \ + STELLAR_RPC_GIT_REF=https://github.com/stellar/soroban-tools.git#main \ 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#master \ @@ -44,7 +44,7 @@ some settings have defaults pre-set, and optionally be overriden: ``` SOROBAN_CLI_GIT_REF=https://github.com/stellar/soroban-tools.git#main - SOROBAN_RPC_GIT_REF=https://github.com/stellar/soroban-tools.git#main + STELLAR_RPC_GIT_REF=https://github.com/stellar/soroban-tools.git#main RUST_TOOLCHAIN_VERSION=stable QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git#master # the GO_GIT_REF provides the reference on the stellar/go repo from which @@ -73,7 +73,7 @@ # 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(SOROBAN_RPC_GIT_REF) and quickstart(QUICKSTART_GIT_REF), instead + # 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=/: @@ -85,9 +85,9 @@ # to override the default of /usr/local/bin/stellar-core CORE_IMAGE_BIN_PATH= - # this will skip building soroban-rpc from SOROBAN_RPC_GIT_REF and instead - # will use the bin already compiled at /bin/soroban-rpc in the existing docker image provided: - SOROBAN_RPC_IMAGE=/: + # 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 soroban-cli from SOROBAN_CLI_GIT_REF and instead # will use the bin already compiled at /usr/local/cargo/bin/soroban in the existing docker image provided: @@ -165,9 +165,9 @@ This approach allows to run the tests from source code directly on host as go te 1. go 1.18 or above - https://go.dev/doc/install 2. rust toolchain(cargo and rustc), install the version per testing requirements or stable, - use rustup - https://www.rust-lang.org/tools/install 3. `soroban` cli, compile or install via cargo crate a version of soroban cli onto your machine and accessible from PATH. - 4. target network stack for the tests to access soroban-rpc instance. You can use an existing/running instance if reachable or can use the quickstart image `stellar/quickstart:soroban-dev` 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. 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:soroban-dev` 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. ``` - docker run --rm -it -p 8000:8000 --name stellar stellar/quickstart:dev --standalone --enable-soroban-rpc + docker run --rm -it -p 8000:8000 --name stellar stellar/quickstart:dev --standalone --enable-stellar-rpc ``` 5. locally checkout stellar/system-test GH repo and go into top folder - `git clone https://github.com/stellar/system-test.git;cd system-test` diff --git a/start b/start index 4f627eb..a162a77 100755 --- a/start +++ b/start @@ -90,16 +90,16 @@ function main() { if [ "$VERBOSE_OUTPUT" = "true" ]; then # redirects all quickstart output to console during test execution - /start --$TARGET_NETWORK --enable-soroban-rpc $ENABLE_SOROBAN_DIAGNOSTIC_EVENTS --logs 2>&1 & + /start --$TARGET_NETWORK --enable-stellar-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-soroban-rpc $ENABLE_SOROBAN_DIAGNOSTIC_EVENTS --logs >> $QUICKSTART_LOG_FILE 2>&1 & + stdbuf -o0 -e0 /start --$TARGET_NETWORK --enable-stellar-rpc $ENABLE_SOROBAN_DIAGNOSTIC_EVENTS --logs >> $QUICKSTART_LOG_FILE 2>&1 & fi fi - soroban_rpc_status + STELLAR_RPC_status # quickstart runs horizon, but sys tests don't need it. if [ "$LOCAL_CORE" = "true" ]; then @@ -199,7 +199,7 @@ function process_args() { fi } -function soroban_rpc_status () { +function STELLAR_RPC_status () { print_screen_output "waiting for soroban rpc to report ready state..." COUNTER=1 while ! $(curl --silent --location --request POST "$TARGET_NETWORK_RPC_URL" \