Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .github/workflows/internal-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ jobs:
pattern: image-xdr-${{ steps.ids.outputs.xdr }}-${{ matrix.arch }}.*
merge-multiple: true
path: /tmp/images
- name: Download Image Strkey
uses: actions/download-artifact@v4
with:
pattern: image-strkey-${{ steps.ids.outputs.strkey }}-${{ matrix.arch }}.*
merge-multiple: true
path: /tmp/images
- name: Download Image Core
uses: actions/download-artifact@v4
with:
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# | node:22-trixie | 13 (trixie) |

ARG XDR_IMAGE=stellar-xdr-stage
ARG STRKEY_IMAGE=stellar-strkey-stage
ARG CORE_IMAGE=stellar-core-stage
ARG HORIZON_IMAGE=stellar-horizon-stage
ARG FRIENDBOT_IMAGE=stellar-friendbot-stage
Expand All @@ -35,6 +36,22 @@ FROM scratch AS stellar-xdr-stage

COPY --from=stellar-xdr-builder /usr/local/cargo/bin/stellar-xdr /stellar-xdr

# strkey

FROM rust:1-trixie AS stellar-strkey-builder
ARG STRKEY_REPO
ARG STRKEY_REF
WORKDIR /wd
RUN git clone https://github.com/${STRKEY_REPO} /wd
RUN git fetch origin ${STRKEY_REF}
RUN git checkout ${STRKEY_REF}
RUN rustup show active-toolchain || rustup toolchain install
RUN cargo install stellar-strkey --features cli --path . --locked

FROM scratch AS stellar-strkey-stage

COPY --from=stellar-strkey-builder /usr/local/cargo/bin/stellar-strkey /stellar-strkey

# core

FROM ubuntu:24.04 AS stellar-core-builder
Expand Down Expand Up @@ -186,6 +203,7 @@ COPY --from=stellar-lab-builder /usr/local/bin/node /node
# quickstart

FROM $XDR_IMAGE AS xdr
FROM $STRKEY_IMAGE AS strkey
FROM $CORE_IMAGE AS core
FROM $HORIZON_IMAGE AS horizon
FROM $FRIENDBOT_IMAGE AS friendbot
Expand All @@ -210,6 +228,7 @@ ADD dependencies /
RUN /dependencies

COPY --from=xdr /stellar-xdr /usr/local/bin/stellar-xdr
COPY --from=strkey /stellar-strkey /usr/local/bin/stellar-strkey
COPY --from=core /stellar-core /usr/bin/stellar-core
COPY --from=horizon /stellar-horizon /usr/bin/stellar-horizon
COPY --from=friendbot /friendbot /usr/local/bin/friendbot
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ IMAGE_JSON=.image.json
# Extract configuration from selected image
XDR_REPO = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "xdr") | .repo')
XDR_SHA = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "xdr") | .sha')
STRKEY_REPO = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "strkey") | .repo')
STRKEY_SHA = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "strkey") | .sha')
CORE_REPO = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "core") | .repo')
CORE_SHA = $(shell < $(IMAGE_JSON) jq -r '.deps[] | select(.name == "core") | .sha')
CORE_OPTIONS = $(shell < $(IMAGE_JSON) jq -c '.deps[] | select(.name == "core") | .options // {}')
Expand Down Expand Up @@ -38,6 +40,7 @@ build: $(IMAGE_JSON)
docker build -t stellar/quickstart:$(TAG) -f Dockerfile . \
--build-arg REVISION=$(REVISION) \
--build-arg XDR_REPO=$(XDR_REPO) --build-arg XDR_REF=$(XDR_SHA) \
--build-arg STRKEY_REPO=$(STRKEY_REPO) --build-arg STRKEY_REF=$(STRKEY_SHA) \
--build-arg CORE_REPO="$(CORE_REPO)" --build-arg CORE_REF="$(CORE_SHA)" --build-arg CORE_OPTIONS='$(CORE_OPTIONS)' \
--build-arg RPC_REPO="$(RPC_REPO)" --build-arg RPC_REF="$(RPC_SHA)" \
--build-arg HORIZON_REPO="$(HORIZON_REPO)" --build-arg HORIZON_REF="$(HORIZON_SHA)" --build-arg HORIZON_OPTIONS='$(HORIZON_OPTIONS)' \
Expand Down
5 changes: 5 additions & 0 deletions images.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"deps": [
{ "name": "xdr", "repo": "stellar/rs-stellar-xdr", "ref": "v24.0.0" },
{ "name": "strkey", "repo": "stellar/rs-stellar-strkey", "ref": "v0.0.14" },
{ "name": "core", "repo": "stellar/stellar-core", "ref": "v24.1.0", "options": { "configure_flags": "--disable-tests" } },
{ "name": "rpc", "repo": "stellar/stellar-rpc", "ref": "v24.0.0" },
{ "name": "horizon", "repo": "stellar/go", "ref": "horizon-v24.0.0", "options": { "pkg": "github.com/stellar/go/services/horizon" } },
Expand All @@ -28,6 +29,7 @@
},
"deps": [
{ "name": "xdr", "repo": "stellar/rs-stellar-xdr", "ref": "v24.0.0" },
{ "name": "strkey", "repo": "stellar/rs-stellar-strkey", "ref": "v0.0.14" },
{ "name": "core", "repo": "stellar/stellar-core", "ref": "v24.1.0", "options": { "configure_flags": "--disable-tests" } },
{ "name": "rpc", "repo": "stellar/stellar-rpc", "ref": "v24.0.0" },
{ "name": "horizon", "repo": "stellar/go", "ref": "horizon-v24.0.0", "options": { "pkg": "github.com/stellar/go/services/horizon" } },
Expand All @@ -51,6 +53,7 @@
},
"deps": [
{ "name": "xdr", "repo": "stellar/rs-stellar-xdr", "ref": "89cc1cbadf1b9a16843826954dede7fec514d8e7" },
{ "name": "strkey", "repo": "stellar/rs-stellar-strkey", "ref": "v0.0.14" },
{ "name": "core", "repo": "stellar/stellar-core", "ref": "bc46d6004548ed52b0f8b7552e2351c0aa190a45", "options": { "configure_flags": "--disable-tests" } },
{ "name": "rpc", "repo": "stellar/stellar-rpc", "ref": "1695c9c53a4cfc52ffb53c10da7fef60076e7bba" },
{ "name": "horizon", "repo": "stellar/stellar-horizon", "ref": "88d8ba74bee93f274559d4cc67172538267ee3f2", "options": { "pkg": "github.com/stellar/stellar-horizon" } },
Expand All @@ -70,6 +73,7 @@
},
"deps": [
{ "name": "xdr", "repo": "stellar/rs-stellar-xdr", "ref": "main" },
{ "name": "strkey", "repo": "stellar/rs-stellar-strkey", "ref": "main" },
{ "name": "core", "repo": "stellar/stellar-core", "ref": "master", "options": { "configure_flags": "--disable-tests" } },
{ "name": "rpc", "repo": "stellar/stellar-rpc", "ref": "main" },
{ "name": "horizon", "repo": "stellar/stellar-horizon", "ref": "main", "options": { "pkg": "github.com/stellar/stellar-horizon" } },
Expand All @@ -90,6 +94,7 @@
},
"deps": [
{ "name": "xdr", "repo": "stellar/rs-stellar-xdr", "ref": "main" },
{ "name": "strkey", "repo": "stellar/rs-stellar-strkey", "ref": "main" },
{ "name": "core", "repo": "stellar/stellar-core", "ref": "master", "options": { "configure_flags": "--disable-tests --enable-next-protocol-version-unsafe-for-production" } },
{ "name": "rpc", "repo": "stellar/stellar-rpc", "ref": "main" },
{ "name": "horizon", "repo": "stellar/stellar-horizon", "ref": "main", "options": { "pkg": "github.com/stellar/stellar-horizon" } },
Expand Down
19 changes: 19 additions & 0 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ function start() {
echo " quickstart: $REVISION"
echo " xdr:"
echo "$(stellar-xdr version | sed 's/^/ /')"
echo " strkey:"
echo "$(stellar-strkey version | sed 's/^/ /')"
echo " core:"
echo "$(stellar-core version 2>/dev/null | sed 's/^/ /')"
echo " rpc:"
Expand All @@ -101,6 +103,7 @@ function start() {
echo "network id: $NETWORK_ID"
echo "network root secret key: $NETWORK_ROOT_SECRET_KEY"
echo "network root account id: $NETWORK_ROOT_ACCOUNT_ID"
echo "native asset contract address: $NATIVE_ASSET_CONTRACT_ADDRESS"
echo "protocol version default: $PROTOCOL_VERSION_DEFAULT"
echo "protocol version set: $PROTOCOL_VERSION"

Expand Down Expand Up @@ -256,6 +259,7 @@ function process_args() {
local network_id_keys=$(stellar-core convert-id $NETWORK_ID | awk -F': ' '/strKey: /{print $2}' | tail -2)
export NETWORK_ROOT_SECRET_KEY=$(printf "$network_id_keys" | head -1)
export NETWORK_ROOT_ACCOUNT_ID=$(printf "$network_id_keys" | tail -1)
export NATIVE_ASSET_CONTRACT_ADDRESS=$(native_asset_contract_address $NETWORK_ID)

# Are we ephemeral or persistent?
if [ -z "$STELLAR_MODE" ]; then
Expand Down Expand Up @@ -868,4 +872,19 @@ function horizon_status() {
echo "horizon: ingestion caught up"
}

function native_asset_contract_address() {
local network_id=$1
local contract_hash=$(
jq -nc --arg network_id "$network_id" '{"contract_id":{"network_id":$network_id,"contract_id_preimage":{"asset":"native"}}}' |
stellar-xdr encode --type HashIdPreimage --output single |
sha256sum |
cut -f 1 -d " "
)
local contract_address=$(
stellar-strkey encode \
$(jq -nc --arg contract_hash "$contract_hash" '{"contract":$contract_hash}')
)
printf '%s' "$contract_address"
}

main $@