Skip to content
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
12 changes: 9 additions & 3 deletions scripts/docker-local/Dockerfile.deployer
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN apt-get update \
ca-certificates \
curl \
jq \
libdbus-1-3 \
&& rm -rf /var/lib/apt/lists/*

# Stellar CLI — runtime `contract deploy` / `contract invoke` only.
Expand All @@ -45,15 +46,20 @@ COPY scripts/relayer-e2e/package.json scripts/relayer-e2e/
COPY scripts/cross-chain-e2e/package.json scripts/cross-chain-e2e/
COPY contracts/stellar/tests/fixtures/package.json contracts/stellar/tests/fixtures/

RUN pnpm fetch --ignore-scripts

# Sources needed at runtime: backend-relayer for prisma schema/migrations,
# packages/* for workspace links, scripts/* for the deploy + seed CLIs.
COPY apps/backend-relayer apps/backend-relayer
COPY packages packages
COPY scripts scripts

RUN pnpm install --frozen-lockfile --offline --ignore-scripts \
# BuildKit cache mount keeps the pnpm store around across rebuilds; the
# --filter set pulls only the three workspace roots the deployer actually
# uses plus their transitive workspace deps.
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile --ignore-scripts \
--filter backend-relayer \
--filter relayer-e2e \
--filter cross-chain-e2e \
&& pnpm --filter backend-relayer exec prisma generate

COPY scripts/docker-local/entrypoint.sh /usr/local/bin/entrypoint.sh
Expand Down
29 changes: 21 additions & 8 deletions scripts/docker-local/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,29 @@ log "generating stellar identity '$ADMIN_ACCT'…"
stellar keys rm "$ADMIN_ACCT" >/dev/null 2>&1 || true
stellar keys generate "$ADMIN_ACCT" --network "$STELLAR_NETWORK"

log "friendbot-funding '$ADMIN_ACCT'…"
for i in $(seq 1 30); do
if stellar keys fund "$ADMIN_ACCT" --network "$STELLAR_NETWORK" 2>/dev/null; then
break
fi
log " friendbot not ready (try $i/30)…"
sleep 4
[[ $i -eq 30 ]] && { log "friendbot funding failed"; exit 1; }
# Quickstart flips RPC to "healthy" well before friendbot's HTTP endpoint
# is serving. Probe friendbot directly so we don't burn N failed
# `stellar keys fund` RPC round-trips waiting for it.
FRIENDBOT_URL="${STELLAR_RPC_URL%/soroban/rpc}/friendbot"
log "waiting for friendbot at $FRIENDBOT_URL…"
for i in $(seq 1 90); do
# A bare GET returns 400 ("invalid request") once friendbot is actually
# serving. Anything in 2xx/4xx means the backend is up; 5xx / 000 mean
# the quickstart proxy is up but the friendbot process isn't ready yet.
code="$(curl -s -o /dev/null -w '%{http_code}' "$FRIENDBOT_URL" || echo 000)"
case "$code" in
2*|4*)
log "friendbot up (http $code)."
break
;;
esac
sleep 2
[[ $i -eq 90 ]] && { log "friendbot never became reachable (last http=$code)"; exit 1; }
done

log "friendbot-funding '$ADMIN_ACCT'…"
stellar keys fund "$ADMIN_ACCT" --network "$STELLAR_NETWORK"

ADMIN_SECRET="$(stellar keys show "$ADMIN_ACCT")"
printf '%s' "$ADMIN_SECRET" > "$ADMIN_SECRET_PATH"
log "wrote admin secret → $ADMIN_SECRET_PATH"
Expand Down
12 changes: 9 additions & 3 deletions scripts/docker-local/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ for arg in "$@"; do
done

have_artifact() {
[[ -f "$ARTIFACTS_DIR/contracts/stellar/target/wasm32v1-none/release/order_portal.wasm" \
&& -d "$ARTIFACTS_DIR/contracts/evm/out/OrderPortal.sol" \
&& -f "$ARTIFACTS_DIR/proof_circuits/deposits/target/vk" ]]
local stellar_wasm="$ARTIFACTS_DIR/contracts/stellar/target/wasm32v1-none/release"
local evm_out="$ARTIFACTS_DIR/contracts/evm/out"
for w in verifier.wasm merkle_manager.wasm ad_manager.wasm order_portal.wasm; do
[[ -f "$stellar_wasm/$w" ]] || return 1
done
for c in OrderPortal AdManager MerkleManager Verifier wNativeToken ERC20Mock; do
[[ -d "$evm_out/${c}.sol" ]] || return 1
done
[[ -f "$ARTIFACTS_DIR/proof_circuits/deposits/target/vk" ]]
}

sync_from_local_tree() {
Expand Down
Loading