Skip to content

Commit

Permalink
Merge branch 'master' into bumpCore
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Dec 11, 2024
2 parents 126a37e + e1f62bf commit 96ac077
Show file tree
Hide file tree
Showing 26 changed files with 179 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .do/deploy.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- key: NETWORK
value: 'local'
scope: RUN_TIME
- key: ENABLE_SOROBAN_RPC
- key: ENABLE_RPC
value: 'false'
scope: RUN_TIME
- key: DISABLE_SOROBAN_DIAGNOSTIC_EVENTS
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-future.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
xdr_ref: v22.0.0
core_ref: v22.0.0
horizon_ref: horizon-v22.0.1
soroban_rpc_ref: v22.0.0-rc3
stellar_rpc_ref: v22.1.1
friendbot_ref: horizon-v22.0.1
test_matrix: |
{
Expand All @@ -59,7 +59,7 @@ jobs:
xdr_ref: v22.0.0
core_ref: v22.0.0
horizon_ref: horizon-v22.0.1
soroban_rpc_ref: v22.0.0-rc3
stellar_rpc_ref: v22.1.1
friendbot_ref: horizon-v22.0.1
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 @@ -36,7 +36,7 @@ jobs:
xdr_ref: v22.0.0
core_ref: v22.0.0
horizon_ref: horizon-v22.0.1
soroban_rpc_ref: v22.1.0
stellar_rpc_ref: v22.1.1
friendbot_ref: horizon-v22.0.1
test_matrix: |
{
Expand All @@ -60,7 +60,7 @@ jobs:
xdr_ref: v22.0.0
core_ref: v22.0.0
horizon_ref: horizon-v22.0.1
soroban_rpc_ref: v22.1.0
stellar_rpc_ref: v22.1.1
friendbot_ref: horizon-v22.0.1
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:
xdr_ref: v22.0.0
core_ref: v22.1.0rc1
horizon_ref: horizon-v22.0.1
soroban_rpc_ref: v22.1.0
stellar_rpc_ref: v22.1.1
friendbot_ref: horizon-v22.0.1
test_matrix: |
{
Expand All @@ -61,7 +61,7 @@ jobs:
xdr_ref: v22.0.0
core_ref: v22.1.0rc1
horizon_ref: horizon-v22.0.1
soroban_rpc_ref: v22.1.0
stellar_rpc_ref: v22.1.1
friendbot_ref: horizon-v22.0.1
test_matrix: |
{
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ on:
description: 'Git ref for the stellar/rs-stellar-xdr repo'
type: 'string'
required: false
soroban_rpc_ref:
description: 'Git ref for the stellar/soroban-rpc repo (soroban-rpc)'
stellar_rpc_ref:
description: 'Git ref for the stellar/stellar-rpc repo (stellar-rpc)'
type: 'string'
required: true
friendbot_ref:
Expand All @@ -63,7 +63,7 @@ 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) }}
HORIZON_REPO_REF: ${{ inputs.horizon_ref }}
FRIENDBOT_REPO_REF: ${{ inputs.friendbot_ref }}
SOROBAN_RPC_REPO_BRANCH: ${{ inputs.soroban_rpc_ref }}
STELLAR_RPC_REPO_BRANCH: ${{ inputs.stellar_rpc_ref }}
CORE_REPO: ${{ inputs.core_repo }}
CORE_REPO_REF: ${{ inputs.core_ref }}
XDR_REPO_REF: ${{ inputs.xdr_ref }}
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
name: image-stellar-friendbot-${{ inputs.tag }}-${{ inputs.arch }}
path: /tmp/image

load-stellar-soroban-rpc-from-cache:
load-stellar-rpc-from-cache:
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache.outputs.cache-hit }}
Expand All @@ -172,41 +172,41 @@ jobs:
uses: actions/cache@v3
with:
path: /tmp/image
key: image-stellar-soroban-rpc-${{ inputs.arch }}-${{ env.SOROBAN_RPC_REPO_BRANCH }}
key: image-stellar-rpc-${{ inputs.arch }}-${{ env.STELLAR_RPC_REPO_BRANCH }}
- name: Upload Stellar-Core Image
if: steps.cache.outputs.cache-hit == 'true'
uses: actions/upload-artifact@v4
with:
name: image-stellar-soroban-rpc-${{ inputs.tag }}-${{ inputs.arch }}
name: image-stellar-rpc-${{ inputs.tag }}-${{ inputs.arch }}
path: /tmp/image

build-stellar-soroban-rpc:
needs: [load-stellar-soroban-rpc-from-cache]
if: ${{ needs.load-stellar-soroban-rpc-from-cache.outputs.cache-hit != 'true' }}
build-stellar-rpc:
needs: [load-stellar-rpc-from-cache]
if: ${{ needs.load-stellar-rpc-from-cache.outputs.cache-hit != 'true' }}
runs-on: ${{ inputs.arch == 'arm64' && 'ubuntu-jammy-4-cores-arm64' || 'ubuntu-latest' }}
steps:
- id: cache
uses: actions/cache@v3
with:
path: /tmp/image
key: image-stellar-soroban-rpc-${{ inputs.arch }}-${{ env.SOROBAN_RPC_REPO_BRANCH }}
key: image-stellar-rpc-${{ inputs.arch }}-${{ env.STELLAR_RPC_REPO_BRANCH }}
- if: inputs.arch == 'arm64'
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18
with:
platforms: arm64
- uses: docker/setup-buildx-action@5146db6c4d81fbfd508899f851bbb3883a96ff9f
- name: Build Stellar-Soroban-Rpc Image
- name: Build Stellar-rpc Image
run: >
docker buildx build --platform linux/${{ inputs.arch }}
-f cmd/soroban-rpc/docker/Dockerfile --target build
-t stellar-soroban-rpc:${{ inputs.arch }}
-f cmd/stellar-rpc/docker/Dockerfile --target build
-t stellar-rpc:${{ inputs.arch }}
-o type=docker,dest=/tmp/image
--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
https://github.com/stellar/soroban-rpc.git#${{ env.SOROBAN_RPC_REPO_BRANCH }}
- name: Upload Stellar-Soroban-Rpc Image
https://github.com/stellar/stellar-rpc.git#${{ env.STELLAR_RPC_REPO_BRANCH }}
- name: Upload Stellar-rpc Image
uses: actions/upload-artifact@v4
with:
name: image-stellar-soroban-rpc-${{ inputs.tag }}-${{ inputs.arch }}
name: image-stellar-rpc-${{ inputs.tag }}-${{ inputs.arch }}
path: /tmp/image

load-rs-stellar-xdr-from-cache:
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
path: /tmp/image

build:
needs: [build-stellar-core, build-stellar-horizon, build-rs-stellar-xdr, build-stellar-friendbot, build-stellar-soroban-rpc]
needs: [build-stellar-core, build-stellar-horizon, build-rs-stellar-xdr, build-stellar-friendbot, build-stellar-rpc]
if: always()
outputs:
image: ${{ steps.image.outputs.name }}
Expand Down Expand Up @@ -289,19 +289,19 @@ jobs:
with:
name: image-stellar-friendbot-${{ inputs.tag }}-${{ inputs.arch }}
path: /tmp/stellar-friendbot
- name: Download Stellar-Soroban-Rpc Image
- name: Download Stellar-rpc Image
uses: actions/download-artifact@v4
with:
name: image-stellar-soroban-rpc-${{ inputs.tag }}-${{ inputs.arch }}
path: /tmp/stellar-soroban-rpc
name: image-stellar-rpc-${{ inputs.tag }}-${{ inputs.arch }}
path: /tmp/stellar-rpc
- name: Load Stellar-Core Image
run: docker load -i /tmp/stellar-core/image
- name: Load Stellar-Horizon Image
run: docker load -i /tmp/stellar-horizon/image
- name: Load Stellar-Friendbot Image
run: docker load -i /tmp/stellar-friendbot/image
- name: Load Stellar-Soroban-Rpc Image
run: docker load -i /tmp/stellar-soroban-rpc/image
- name: Load Stellar-rpc Image
run: docker load -i /tmp/stellar-rpc/image
- name: Load Stellar-Rs-Xdr Image
run: docker load -i /tmp/stellar-xdr/image
- if: inputs.arch == 'arm64'
Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
--build-arg STELLAR_CORE_IMAGE_REF=stellar-core:${{ inputs.arch }}
--build-arg HORIZON_IMAGE_REF=stellar-horizon:${{ inputs.arch }}
--build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:${{ inputs.arch }}
--build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:${{ inputs.arch }}
--build-arg STELLAR_RPC_IMAGE_REF=stellar-rpc:${{ inputs.arch }}
- name: Save Quickstart Image
run: docker save $IMAGE -o /tmp/image
- name: Upload Quickstart Image
Expand Down Expand Up @@ -423,18 +423,18 @@ jobs:
echo "supervisorctl tail -f friendbot" | docker exec -i stellar sh &
echo "supervisorctl tail -f horizon" | docker exec -i stellar sh &
go run test_friendbot.go
- name: Run soroban rpc up test
- name: Run stellar rpc up test
if: ${{ matrix.rpc }}
run: |
docker logs stellar -f &
echo "supervisorctl tail -f soroban-rpc" | docker exec -i stellar sh &
go run test_soroban_rpc_up.go
- name: Run soroban rpc healthy test
echo "supervisorctl tail -f stellar-rpc" | docker exec -i stellar sh &
go run test_stellar_rpc_up.go
- name: Run stellar rpc healthy test
if: ${{ matrix.rpc && matrix.network != 'pubnet' }}
run: |
docker logs stellar -f &
echo "supervisorctl tail -f soroban-rpc" | docker exec -i stellar sh &
go run test_soroban_rpc_healthy.go
echo "supervisorctl tail -f stellar-rpc" | docker exec -i stellar sh &
go run test_stellar_rpc_healthy.go
- name: Prepare Test Logs
if: always()
run: sudo chmod -R a+r logs
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ ARG STELLAR_XDR_IMAGE_REF
ARG STELLAR_CORE_IMAGE_REF
ARG HORIZON_IMAGE_REF
ARG FRIENDBOT_IMAGE_REF
ARG SOROBAN_RPC_IMAGE_REF
ARG STELLAR_RPC_IMAGE_REF

FROM $STELLAR_XDR_IMAGE_REF AS stellar-xdr
FROM $STELLAR_CORE_IMAGE_REF AS stellar-core
FROM $HORIZON_IMAGE_REF AS horizon
FROM $FRIENDBOT_IMAGE_REF AS friendbot
FROM $SOROBAN_RPC_IMAGE_REF AS soroban-rpc
FROM $STELLAR_RPC_IMAGE_REF AS stellar-rpc

FROM ubuntu:22.04

Expand All @@ -33,7 +33,7 @@ COPY --from=horizon /go/bin/horizon /usr/bin/stellar-horizon

COPY --from=friendbot /app/friendbot /usr/local/bin/friendbot

COPY --from=soroban-rpc /bin/soroban-rpc /usr/bin/stellar-soroban-rpc
COPY --from=stellar-rpc /bin/stellar-rpc /usr/bin/stellar-rpc

RUN adduser --system --group --quiet --home /var/lib/stellar --disabled-password --shell /bin/bash stellar;

Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__PHONY__: run logs build build-deps build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc
__PHONY__: run logs build build-deps build-deps-core build-deps-horizon build-deps-friendbot build-deps-stellar-rpc

REVISION=$(shell git -c core.abbrev=no describe --always --exclude='*' --long --dirty)
TAG?=dev
Expand All @@ -8,12 +8,12 @@ XDR_REF?=main
CORE_REPO?=https://github.com/stellar/stellar-core.git
CORE_REF?=master
CORE_CONFIGURE_FLAGS?=--disable-tests
SOROBAN_RPC_REF?=main
HORIZON_REF?=$(shell ./scripts/soroban_repo_to_horizon_repo.sh $(SOROBAN_RPC_REF))
STELLAR_RPC_REF?=main
HORIZON_REF?=$(shell ./scripts/soroban_repo_to_horizon_repo.sh $(STELLAR_RPC_REF))
FRIENDBOT_REF?=$(HORIZON_REF)

run:
docker run --rm --name stellar -p 8000:8000 stellar/quickstart:$(TAG) --local --enable-soroban-rpc
docker run --rm --name stellar -p 8000:8000 stellar/quickstart:$(TAG) --local --enable-stellar-rpc

logs:
docker exec stellar /bin/sh -c 'tail -F /var/log/supervisor/*'
Expand All @@ -27,7 +27,7 @@ build-latest:
XDR_REF=v22.0.0 \
CORE_REF=v22.0.0 \
HORIZON_REF=horizon-v22.0.1 \
SOROBAN_RPC_REF=v22.1.0 \
STELLAR_RPC_REF=v22.1.0 \
FRIENDBOT_REF=31fc8f4236388f12fc609228b7a7f5494867a1f9

build-testing:
Expand All @@ -36,7 +36,7 @@ build-testing:
XDR_REF=v22.0.0 \
CORE_REF=v22.0.0 \
HORIZON_REF=horizon-v22.0.1 \
SOROBAN_RPC_REF=v22.1.0 \
STELLAR_RPC_REF=v22.1.0 \
FRIENDBOT_REF=horizon-v22.0.1

build-future:
Expand All @@ -45,7 +45,7 @@ build-future:
XDR_REF=v22.0.0 \
CORE_REF=v22.0.0 \
HORIZON_REF=horizon-v22.0.1 \
SOROBAN_RPC_REF=v22.1.0 \
STELLAR_RPC_REF=v22.1.0 \
FRIENDBOT_REF=horizon-v22.0.1

build:
Expand All @@ -57,9 +57,9 @@ build:
--build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(CORE_REF) \
--build-arg HORIZON_IMAGE_REF=stellar-horizon:$(HORIZON_REF) \
--build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(FRIENDBOT_REF) \
--build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(SOROBAN_RPC_REF) \
--build-arg STELLAR_RPC_IMAGE_REF=stellar-rpc:$(STELLAR_RPC_REF) \

build-deps: build-deps-xdr build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc
build-deps: build-deps-xdr build-deps-core build-deps-horizon build-deps-friendbot build-deps-stellar-rpc

build-deps-xdr:
docker build -t stellar-xdr:$(XDR_REF) -f Dockerfile.xdr --target builder . --build-arg REPO="$(XDR_REPO)" --build-arg REF="$(XDR_REF)"
Expand All @@ -73,5 +73,5 @@ build-deps-horizon:
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-rpc.git#$(SOROBAN_RPC_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
build-deps-stellar-rpc:
docker build -t stellar-rpc:$(STELLAR_RPC_REF) -f cmd/stellar-rpc/docker/Dockerfile --target build https://github.com/stellar/stellar-rpc.git#$(STELLAR_RPC_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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-rpc/tree/main/cmd/soroban-rpc)
- [stellar-rpc](https://github.com/stellar/stellar-rpc/tree/main/cmd/stellar-rpc)
- [Supervisord](http://supervisord.org) is used from managing the processes of the above services.

## Usage
Expand Down Expand Up @@ -119,9 +119,9 @@ _Note: In local mode a local friendbot is running. In testnet and futurenet mode

### Soroban Development

The RPC Server will be avaialble on port 8000 of the container, and the base URL path for Soroban RPC will be `http://<container_host>:8000/rpc`. This endpoint uses [JSON-RPC](https://www.jsonrpc.org/specification) protocol. Refer to example usages in [soroban-example-dapp](https://github.com/stellar/soroban-example-dapp).
The RPC Server will be avaialble on port 8000 of the container, and the base URL path for Stellar RPC will be `http://<container_host>:8000/rpc`. This endpoint uses [JSON-RPC](https://www.jsonrpc.org/specification) protocol. Refer to example usages in [soroban-example-dapp](https://github.com/stellar/soroban-example-dapp).

To enable soroban rpc admin endpoint for access to metrics and [Go pprof (profiling)](https://pkg.go.dev/net/http/pprof), include the `--enable-soroban-rpc-admin-endpoint` flag, the HTTP endpoint will be listening on container port 6061, which can be exposed with standard docker port rule `-p "6061:6061"`, the published endpoints are:
To enable stellar rpc admin endpoint for access to metrics and [Go pprof (profiling)](https://pkg.go.dev/net/http/pprof), include the `--enable-stellar-rpc-admin-endpoint` flag, the HTTP endpoint will be listening on container port 6061, which can be exposed with standard docker port rule `-p "6061:6061"`, the published endpoints are:

```
http://<container_host>:6061/metrics
Expand Down Expand Up @@ -177,7 +177,7 @@ built with.
`--enable-next-protocol-version-unsafe-for-production`.
- `HORIZON_REF`: The git reference of stellar-horizon to build.
- `FRIENDBOT_REF`: The git reference of stellar-friendbot to build.
- `SOROBAN_RPC_REF`: The git reference of soroban-rpc to build.
- `STELLAR_RPC_REF`: The git reference of stellar-rpc to build.

For example:

Expand All @@ -188,7 +188,7 @@ make build \
CORE_CONFIGURE_FLAGS=... \
HORIZON_REF=... \
FRIENDBOT_REF=... \
SOROBAN_RPC_REF=...
STELLAR_RPC_REF=...
```

### Background vs. Interactive containers
Expand Down Expand Up @@ -239,21 +239,21 @@ The image exposes one main port through which services provide their APIs:

| Port | Service | Description |
| ---- | ------------------------------- | -------------- |
| 8000 | horizon, soroban-rpc, friendbot | main http port |
| 8000 | horizon, stellar-rpc, friendbot | main http port |

The image also exposes a few other ports that most developers do not need, but area available:

| Port | Service | Description |
| ----- | -------------------------- | -------------------- |
| 5432 | postgresql | database access port |
| 6060 | horizon | admin port |
| 6061 | soroban-rpc | admin port |
| 6061 | stellar-rpc | admin port |
| 11625 | stellar-core | peer node port |
| 11626 | stellar-core | main http port |
| 11725 | stellar-core (horizon) | peer node port |
| 11726 | stellar-core (horizon) | main http port |
| 11825 | stellar-core (soroban-rpc) | peer node port |
| 11826 | stellar-core (soroban-rpc) | main http port |
| 11825 | stellar-core (stellar-rpc) | peer node port |
| 11826 | stellar-core (stellar-rpc) | main http port |

### Security Considerations

Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions common/soroban-rpc/bin/start

This file was deleted.

7 changes: 7 additions & 0 deletions common/stellar-rpc/bin/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

set -e
set -o pipefail

echo "starting stellar-rpc..."
exec /usr/bin/stellar-rpc --config-path=/opt/stellar/stellar-rpc/etc/stellar-rpc.cfg
9 changes: 0 additions & 9 deletions common/supervisor/etc/supervisord.conf.d/soroban-rpc.conf

This file was deleted.

Loading

0 comments on commit 96ac077

Please sign in to comment.