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

quickstart: Build Soroban RPC From New soroban-rpc Repo #558

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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
5 changes: 2 additions & 3 deletions .github/workflows/build-future.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
xdr_ref: v20.0.2
core_ref: v20.1.0
core_supports_enable_soroban_diagnostic_events: "true"
go_ref: horizon-v2.28.3
soroban_tools_ref: v20.1.0
soroban_rpc_ref: v20.1.0
leighmcculloch marked this conversation as resolved.
Show resolved Hide resolved
test_matrix: |
{
"network": ["local"],
Expand All @@ -56,7 +55,7 @@ jobs:
core_supports_enable_soroban_diagnostic_events: "true"
core_build_runner_type: ubuntu-latest-16-cores
go_ref: horizon-v2.28.3
soroban_tools_ref: v20.1.0
soroban_rpc_ref: v20.1.0
soroban_rpc_build_runner_type: ubuntu-latest-16-cores
test_matrix: |
{
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
xdr_ref: v20.1.0
core_ref: v20.2.0
go_ref: horizon-v2.28.3
soroban_tools_ref: v20.3.0
soroban_rpc_ref: v20.3.2
test_matrix: |
{
"network": ["pubnet", "local"],
Expand All @@ -55,7 +55,7 @@ jobs:
core_ref: v20.2.0
core_build_runner_type: ubuntu-latest-16-cores
go_ref: horizon-v2.28.3
soroban_tools_ref: v20.3.0
soroban_rpc_ref: v20.3.2
soroban_rpc_build_runner_type: ubuntu-latest-16-cores
test_matrix: |
{
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
core_ref: v20.2.0
core_supports_enable_soroban_diagnostic_events: "true"
go_ref: horizon-v2.28.3
soroban_tools_ref: v20.3.0
soroban_rpc_ref: v20.3.2
test_matrix: |
{
"network": ["testnet", "pubnet", "local"],
Expand All @@ -61,7 +61,7 @@ jobs:
core_supports_enable_soroban_diagnostic_events: "true"
core_build_runner_type: ubuntu-latest-16-cores
go_ref: horizon-v2.28.3
soroban_tools_ref: v20.3.0
soroban_rpc_ref: v20.3.2
soroban_rpc_build_runner_type: ubuntu-latest-16-cores
test_matrix: |
{
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ on:
description: 'Git ref for the stellar/rs-stellar-xdr repo'
type: 'string'
required: false
soroban_tools_ref:
description: 'Git ref for the stellar/soroban-tools repo (soroban-rpc)'
soroban_rpc_ref:
description: 'Git ref for the stellar/soroban-rpc repo (soroban-rpc)'
type: 'string'
required: true
soroban_rpc_build_runner_type:
Expand All @@ -66,7 +66,7 @@ on:
env:
IMAGE: ${{ format('{0}/{1}:{2}', secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io', github.repository, github.event_name == 'pull_request' && format('pr{0}-{1}', github.event.pull_request.number, inputs.tag) || inputs.tag) }}
GO_REPO_BRANCH: ${{ inputs.go_ref }}
SOROBAN_TOOLS_REPO_BRANCH: ${{ inputs.soroban_tools_ref }}
SOROBAN_RPC_REPO_BRANCH: ${{ inputs.soroban_rpc_ref }}
CORE_REPO: ${{ inputs.core_repo }}
CORE_REPO_REF: ${{ inputs.core_ref }}
XDR_REPO_REF: ${{ inputs.xdr_ref }}
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
uses: actions/cache@v3
with:
path: /tmp/image
key: image-stellar-soroban-rpc-${{ inputs.arch }}-${{ env.SOROBAN_TOOLS_REPO_BRANCH }}
key: image-stellar-soroban-rpc-${{ inputs.arch }}-${{ env.SOROBAN_RPC_REPO_BRANCH }}
- if: steps.cache.outputs.cache-hit != 'true' && inputs.arch == 'arm64'
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18
with:
Expand All @@ -175,7 +175,7 @@ jobs:
-t stellar-soroban-rpc:${{ inputs.arch }}
-o type=docker,dest=/tmp/image
--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
https://github.com/stellar/soroban-tools.git#${{ env.SOROBAN_TOOLS_REPO_BRANCH }}
https://github.com/stellar/soroban-rpc.git#${{ env.SOROBAN_RPC_REPO_BRANCH }}
- name: Upload Stellar-Soroban-Rpc Image
uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ build-latest:
CORE_REF=v20.2.0 \
CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \
HORIZON_REF=horizon-v2.28.3 \
SOROBAN_RPC_REF=v20.3.0
SOROBAN_RPC_REF=v20.3.2

build-testing:
$(MAKE) build TAG=testing \
XDR_REF=v20.1.0 \
CORE_REF=v20.2.0 \
CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \
HORIZON_REF=horizon-v2.28.3 \
SOROBAN_RPC_REF=v20.3.0
SOROBAN_RPC_REF=v20.3.2

build-future:
$(MAKE) build TAG=future \
Expand Down Expand Up @@ -71,4 +71,4 @@ build-deps-friendbot:
docker build -t stellar-friendbot:$(FRIENDBOT_REF) -f services/friendbot/docker/Dockerfile https://github.com/stellar/go.git#$(FRIENDBOT_REF)

build-deps-soroban-rpc:
docker build -t stellar-soroban-rpc:$(SOROBAN_RPC_REF) -f cmd/soroban-rpc/docker/Dockerfile --target build https://github.com/stellar/soroban-tools.git#$(SOROBAN_RPC_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
docker build -t stellar-soroban-rpc:$(SOROBAN_RPC_REF) -f cmd/soroban-rpc/docker/Dockerfile --target build https://github.com/stellar/soroban-rpc.git#$(SOROBAN_RPC_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The image uses the following software:
- [stellar-core](https://github.com/stellar/stellar-core)
- [horizon](https://github.com/stellar/go/tree/master/services/horizon)
- [friendbot](https://github.com/stellar/go/tree/master/services/friendbot)
- [soroban-rpc](https://github.com/stellar/soroban-tools/tree/main/cmd/soroban-rpc)
- [soroban-rpc](https://github.com/stellar/soroban-rpc/tree/main/cmd/soroban-rpc)
- Supervisord is used from managing the processes of the services above

## Usage
Expand Down
4 changes: 2 additions & 2 deletions scripts/soroban_repo_to_horizon_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ fi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to say we should remove this script instead of keep it. In all cases where we specify a version of rpc we also specify a version explicitly of horizon. This script is only used by the makefile, but it should be easier now-days to pick versions of horizon that match versions of soroban-rpc. Wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, less code, it's only used for ad-hoc make build which implies specifying versions for components in any case, @Shaptic and @psheth9, should we move this pr along still?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont have enough context on script removal part but this PR is pointing to old version of rpc, latest released soroban-rpc version is 20.3.2 so we need to update that. overall yes, we should definitely update quickstart so that it points to new soroban-rpc. Are there any edge cases here? cc @mollykarcher (if not I can refactor this PR and land)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can follow your suggestion and be landed with a little more adjustment like you mentioned for 20.3.2, regarding build-future.yml, that refers to futurenet, and I don't think that network has been updated to core 20.2.0 , which would mean leave it's soroban-tools/tag as-is, unless the same older tag is copied on soroban-rpc repo, the futurenet network option probably needs to be deprecated from quickstart on a separate ticket.

can sanity test pr locally by running the make targets for latest or testing image variants, and run the image and watch console output to confirm it joins the network:

docker run --rm -it     -p "8000:8000"   --name stellar     stellar/quickstart:latest|testing --testnet

can use --local for network also on either of those image variants, quickstart will run a standalone network in the container using CORE_REF version, rather than connecting to remote.

GO_MONOREPO=github.com/stellar/go
SOROBAN_BRANCH=$1
SOROBAN_REPO_GOMOD=https://raw.githubusercontent.com/stellar/soroban-tools/${SOROBAN_BRANCH}/go.mod
SOROBAN_REPO_GOMOD=https://raw.githubusercontent.com/stellar/soroban-rpc/${SOROBAN_BRANCH}/go.mod

# find the short commit from the soroban-tools repository.
# find the short commit from the soroban-rpc repository.
SHORT_COMMIT=$(curl -s ${SOROBAN_REPO_GOMOD} -o - | grep "${GO_MONOREPO} " | cut -d- -f3)

# find the long commit from the actual go repository using the short commit.
Expand Down