Skip to content
Open
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/angry-mammals-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/sdk": patch
---

remove unused eth_load and eth_dump scripts
5 changes: 5 additions & 0 deletions .changeset/khaki-deer-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/sdk": patch
---

feat(sdk): bump devnet
5 changes: 5 additions & 0 deletions .changeset/tricky-memes-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/sdk": patch
---

eth_isready for forked networks
2 changes: 0 additions & 2 deletions packages/sdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

Check warning on line 8 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 ${CARTESI_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 @@ -169,7 +169,7 @@

################################################################################
# postgresql initdb
FROM ${POSTGRES_BASE_IMAGE} AS postgresql-initdb

Check warning on line 172 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 ${POSTGRES_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

ARG DEBIAN_FRONTEND=noninteractive
RUN <<EOF
Expand All @@ -182,7 +182,7 @@
COPY --from=rollups-runtime /usr/bin/cartesi-rollups-cli /usr/bin/
COPY --from=rollups-runtime /usr/lib/libcartesi* /usr/lib/

ARG POSTGRES_PASSWORD=password

Check warning on line 185 in packages/sdk/Dockerfile

View workflow job for this annotation

GitHub Actions / build

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "POSTGRES_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

# create rollupsdb databases
COPY <<EOF /docker-entrypoint-initdb.d/00-createdb.sql
Expand All @@ -202,12 +202,12 @@

################################################################################
# rollups-database image
FROM ${POSTGRES_BASE_IMAGE} AS rollups-database

Check warning on line 205 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 ${POSTGRES_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
COPY --from=postgresql-initdb /var/lib/postgresql/data /var/lib/postgresql/data

################################################################################
# alto build
FROM node:${NODE_VERSION} AS alto

Check warning on line 210 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:${NODE_VERSION} 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
ARG NODE_VERSION
ARG FOUNDRY_VERSION
Expand Down Expand Up @@ -330,8 +330,6 @@
COPY alto /usr/local/bin
COPY devnet /usr/local/bin
COPY eth_isready /usr/local/bin
COPY eth_dump /usr/local/bin
COPY eth_load /usr/local/bin

COPY entrypoint.sh /usr/local/bin/
COPY --from=foundry /usr/local/bin/anvil /usr/local/bin/
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/devnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env sh
set -e
jq -rs '. | map({contractName,address}) | unique_by(.address) | sort_by(.contractName) | .[] | "\(.address) \(.contractName)"' /usr/share/cartesi/deployments/*.json
jq -r '.contracts | to_entries | sort_by(.key) | .[] | "\(.value.address) \(.key)"' /usr/share/cartesi/deployments/anvil.json
exec anvil --load-state /usr/share/cartesi/anvil_state.json "$@"
2 changes: 1 addition & 1 deletion packages/sdk/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ target "default" {
ALTO_VERSION = "1.2.5"
ALTO_PACKAGE_VERSION = "0.0.18"
CARTESI_BASE_IMAGE = "docker.io/library/debian:trixie-20260202-slim@sha256:f6e2cfac5cf956ea044b4bd75e6397b4372ad88fe00908045e9a0d21712ae3ba"
CARTESI_DEVNET_VERSION = "2.0.0-alpha.9"
CARTESI_DEVNET_VERSION = "2.0.0-alpha.10"
CARTESI_IMAGE_KERNEL_VERSION = "0.20.0"
CARTESI_LINUX_KERNEL_VERSION = "6.5.13-ctsi-1-v0.20.0"
CARTESI_MACHINE_EMULATOR_VERSION = "0.19.0"
Expand Down
11 changes: 0 additions & 11 deletions packages/sdk/eth_dump

This file was deleted.

14 changes: 12 additions & 2 deletions packages/sdk/eth_isready
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/env sh
set -eu

# https://ethereum.org/en/developers/docs/apis/json-rpc/#net_listening
curl -X POST -s -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"1","method":"net_listening","params":[]}' ${RPC_URL:-http://127.0.0.1:8545} | jq '.result'
RPC_URL="${RPC_URL:-http://127.0.0.1:8545}"

# If a block number argument is provided, check that the chain has reached it
if [ -n "$1" ]; then
current=$(cast block-number --rpc-url "$RPC_URL" 2>/dev/null) || exit 1
target=$(($1))
[ "$current" -ge "$target" ] && exit 0 || exit 1
fi

# Check if the node is listening
cast client --rpc-url "$RPC_URL" > /dev/null 2>&1
14 changes: 0 additions & 14 deletions packages/sdk/eth_load

This file was deleted.