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

Add GraphQL to SDK #133

Merged
merged 4 commits into from
Jan 22, 2025
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
5 changes: 5 additions & 0 deletions .changeset/long-stingrays-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/sdk": major
---

add cartesi-rollups-graphql binary
11 changes: 11 additions & 0 deletions packages/sdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
ARG NODEJS_VERSION
ARG SU_EXEC_VERSION
ARG ANVIL_VERSION
ARG CARTESI_ROLLUPS_GRAPHQL_VERSION

################################################################################
# base image
FROM ${BASE_IMAGE} AS base

Check warning on line 15 in packages/sdk/Dockerfile

View workflow job for this annotation

GitHub Actions / build

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
ARG DEBIAN_FRONTEND=noninteractive
RUN <<EOF
Expand Down Expand Up @@ -61,16 +62,25 @@

################################################################################
# alto installer
FROM node:${NODEJS_VERSION}-bookworm AS alto

Check warning on line 65 in packages/sdk/Dockerfile

View workflow job for this annotation

GitHub Actions / build

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG node:${NODEJS_VERSION}-bookworm results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
ARG ALTO_VERSION
RUN npm install -g @pimlico/alto@${ALTO_VERSION}

################################################################################
# devnet installer
FROM node:${NODEJS_VERSION}-bookworm AS devnet

Check warning on line 71 in packages/sdk/Dockerfile

View workflow job for this annotation

GitHub Actions / build

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG node:${NODEJS_VERSION}-bookworm results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
ARG DEVNET_VERSION
RUN npm install -g @cartesi/devnet@${DEVNET_VERSION}

################################################################################
# cartesi-rollups-graphql installer
FROM base AS graphql
ARG CARTESI_ROLLUPS_GRAPHQL_VERSION
ARG TARGETOS
ARG TARGETARCH
RUN curl -fsSL https://github.com/cartesi/rollups-graphql/releases/download/v${CARTESI_ROLLUPS_GRAPHQL_VERSION}/cartesi-rollups-graphql-v${CARTESI_ROLLUPS_GRAPHQL_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz \
| tar -xzf - -C /usr/local/bin

################################################################################
# sdk final image
FROM base
Expand Down Expand Up @@ -143,6 +153,7 @@
COPY --from=crane /usr/local/bin/crane /usr/local/bin/
COPY --from=devnet /usr/local/lib/node_modules/@cartesi/devnet/export/abi/localhost.json /usr/share/cartesi/
COPY --from=devnet /usr/local/lib/node_modules/@cartesi/devnet/build/anvil_state.json /usr/share/cartesi/
COPY --from=graphql /usr/local/bin/cartesi-rollups-graphql /usr/local/bin/
RUN mkdir -p /tmp/.cartesi && chmod 1777 /tmp/.cartesi

# Install cartesi-machine emulator
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ target "default" {
NODEJS_VERSION = "18.19.0"
SU_EXEC_VERSION = "0.2"
ANVIL_VERSION = "2044faec64f99a21f0e5f0094458a973612d0712"
CARTESI_ROLLUPS_GRAPHQL_VERSION = "2.3.4"
}
}
Loading