Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Soroban RPC to Stellar RPC #107

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
using: "composite"
steps:
-
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: /tmp/
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ 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
QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#1a831b2350dd3928b60eb745d0862ee19dd2aaaa
# 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:
Expand All @@ -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' }} \
Expand All @@ -64,7 +64,7 @@ jobs:
docker save ${{ env.IMAGE }} -o /tmp/image;
- if: ${{ env.PUSH_ENABLED == 'true' }}
name: Upload System Test Image
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: image-Dockerfile
path: /tmp/image
Expand Down
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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
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
Expand All @@ -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#<ref>`
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
Expand All @@ -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=
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 \
Expand All @@ -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

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=? \
Expand All @@ -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 \
Expand All @@ -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
Expand Down Expand Up @@ -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=<docker registry>/<docker image name>:<docker tag>

Expand All @@ -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=<docker registry>/<docker image name>:<docker tag>
# 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=<docker registry>/<docker image name>:<docker tag>

# 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:
Expand Down Expand Up @@ -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`

Expand Down
8 changes: 4 additions & 4 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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" \
Expand Down