Skip to content

Commit f7809dd

Browse files
committed
feat(emulator): update to emulator v0.19.0 (WIP)
1 parent d29da5f commit f7809dd

20 files changed

Lines changed: 763 additions & 1559 deletions

File tree

Dockerfile

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,35 @@
33

44
# syntax=docker.io/docker/dockerfile:1
55

6-
ARG EMULATOR_VERSION=0.18.1
6+
ARG EMULATOR_VERSION=0.19.0
77

88
# Build directories.
99
ARG GO_BUILD_PATH=/build/cartesi/go
1010

11-
FROM cartesi/machine-emulator:${EMULATOR_VERSION} AS common-env
11+
FROM debian:bookworm-20250113 AS common-env
1212

1313
USER root
1414

1515
# Re-declare ARGs so they can be used in the RUN block
16+
ARG EMULATOR_VERSION
1617
ARG GO_BUILD_PATH
1718

1819
# Install ca-certificates and curl (setup).
1920
RUN <<EOF
2021
set -e
2122
apt-get update
22-
apt-get install -y --no-install-recommends ca-certificates curl wget build-essential pkg-config libssl-dev
23+
apt-get install -y --no-install-recommends \
24+
ca-certificates curl wget build-essential pkg-config libssl-dev
25+
addgroup --system --gid 102 cartesi
26+
adduser --system --uid 102 --ingroup cartesi --disabled-login --no-create-home --home /nonexistent --gecos "cartesi user" --shell /bin/false cartesi
27+
ARCH=$(dpkg --print-architecture)
28+
wget -O /tmp/cartesi-machine.deb "https://github.com/cartesi/machine-emulator/releases/download/v${EMULATOR_VERSION}-alpha3/cartesi-machine-v${EMULATOR_VERSION}_${ARCH}.deb"
29+
case "$ARCH" in
30+
amd64) echo "726c510632eedad51aec366634711f5062808c5aedf34b7fb7e6b2263de88e1f /tmp/cartesi-machine.deb" | sha256sum --check ;;
31+
arm64) echo "45712294ddd9cef0130074066b800d3b090a5e576ec9215e1a16f3ddcb146d29 /tmp/cartesi-machine.deb" | sha256sum --check ;;
32+
*) echo "unsupported architecture: $ARCH"; exit 1 ;;
33+
esac
34+
apt-get install -y --no-install-recommends /tmp/cartesi-machine.deb
2335
mkdir -p /opt/go ${GO_BUILD_PATH}/rollups-node
2436
chown -R cartesi:cartesi /opt/go ${GO_BUILD_PATH}
2537
EOF
@@ -38,7 +50,6 @@ RUN <<EOF
3850
set -e
3951
ARCH=$(dpkg --print-architecture)
4052
wget -O /tmp/go.tar.gz "https://go.dev/dl/go1.23.6.linux-${ARCH}.tar.gz"
41-
sha256sum /tmp/go.tar.gz
4253
case "$ARCH" in
4354
amd64) echo "9379441ea310de000f33a4dc767bd966e72ab2826270e038e78b2c53c2e7802d /tmp/go.tar.gz" | sha256sum --check ;;
4455
arm64) echo "561c780e8f4a8955d32bf72e46af0b5ee5e0debe1e4633df9a03781878219202 /tmp/go.tar.gz" | sha256sum --check ;;
@@ -109,13 +120,16 @@ RUN make build-debian-package DESTDIR=$PWD/_install
109120
# (This stage copies the binaries from previous stages.)
110121
# =============================================================================
111122

112-
FROM cartesi/machine-emulator:${EMULATOR_VERSION} AS rollups-node
123+
FROM debian:bookworm-20250113 AS rollups-node
113124

114125
ARG NODE_RUNTIME_DIR=/var/lib/cartesi-rollups-node
115126
ARG GO_BUILD_PATH
116127

117128
USER root
118129

130+
COPY --from=common-env \
131+
/tmp/cartesi-machine.deb \
132+
cartesi-machine.deb
119133
COPY --from=debian-packager \
120134
${GO_BUILD_PATH}/rollups-node/cartesi-rollups-node-v*.deb \
121135
cartesi-rollups-node.deb
@@ -124,13 +138,16 @@ COPY --from=debian-packager \
124138
ARG DEBIAN_FRONTEND=noninteractive
125139
RUN <<EOF
126140
set -e
141+
addgroup --system --gid 102 cartesi
142+
adduser --system --uid 102 --ingroup cartesi --disabled-login --no-create-home --home /nonexistent --gecos "cartesi user" --shell /bin/false cartesi
127143
apt-get update
128144
apt-get install -y --no-install-recommends \
129145
ca-certificates \
130146
curl \
131147
procps \
148+
./cartesi-machine.deb \
132149
./cartesi-rollups-node.deb
133-
rm -rf /var/lib/apt/lists/* cartesi-rollups-node.deb
150+
rm -rf /var/lib/apt/lists/* cartesi-*.deb
134151
mkdir -p ${NODE_RUNTIME_DIR}/snapshots ${NODE_RUNTIME_DIR}/data
135152
chown -R cartesi:cartesi ${NODE_RUNTIME_DIR}
136153
EOF

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ $(CARTESI_TEST_MACHINE_IMAGES):
209209
@mkdir -p $(DOWNLOADS_DIR)
210210
@wget -nc -i test/dependencies -P $(DOWNLOADS_DIR)
211211
@shasum -ca 256 test/dependencies.sha256
212-
@cd $(DOWNLOADS_DIR) && ln -s rootfs-tools-v0.16.1.ext2 rootfs.ext2
212+
@cd $(DOWNLOADS_DIR) && ln -s rootfs-tools-v0.17.0-test2.ext2 rootfs.ext2
213213
@cd $(DOWNLOADS_DIR) && ln -s linux-6.5.13-ctsi-1-v0.20.0.bin linux.bin
214214

215215
download-test-dependencies: | $(CARTESI_TEST_MACHINE_IMAGES)

control.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Homepage: https://docs.cartesi.io/cartesi-rollups/
55
Architecture: ARG_ARCH
66
Maintainer: Node Reference Unit <https://discord.com/channels/600597137524391947/1110564973115097179>
77
Provides: cartesi-rollups-node
8-
Depends: cartesi-machine (>= 0.18.0), cartesi-machine (<< 0.19.0)
8+
Depends: cartesi-machine (>= 0.19.0), cartesi-machine (<< 0.20.0)
99
Section: net
1010
Priority: optional
1111
Multi-Arch: no

0 commit comments

Comments
 (0)