Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
GCdePaula committed Jan 7, 2025
1 parent b74329f commit b0e4e2a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 97 deletions.
11 changes: 11 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
update-submodules:
git submodule update --recursive --init

build-consensus:
just -f ./cartesi-rollups/contracts/justfile build
clean-consensus-bindings:
Expand Down Expand Up @@ -32,5 +35,13 @@ build: build-smart-contracts build-prt bind build-rust-workspace
clean-emulator:
make -C machine/emulator clean depclean distclean


build-docker-image TAG="dave:dev":
docker build -f test/Dockerfile -t {{TAG}} .

run-dockered +CMD: build-docker-image
docker run -it dave:dev {{CMD}}


hello:
echo $(echo "Hello")
66 changes: 0 additions & 66 deletions prt/tests/rollups/Dockerfile

This file was deleted.

25 changes: 0 additions & 25 deletions prt/tests/rollups/Makefile

This file was deleted.

5 changes: 3 additions & 2 deletions prt/tests/rollups/dave/node.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ local function start_dave_node(machine_path, db_path, sleep_duration, verbosity,
[[sh -c "echo $$ ; exec env MACHINE_PATH='%s' STATE_DIR='%s' \
SLEEP_DURATION=%d RUST_BACKTRACE='%s' \
RUST_LOG='none',cartesi_prt_core='%s',rollups_compute_runner='%s',rollups_epoch_manager='%s' \
../../target/debug/dave-rollups > dave.log 2>&1"]],
machine_path, db_path, sleep_duration, trace_level, verbosity, verbosity, verbosity)
../../../target/debug/dave-rollups > dave.log 2>&1"]],
machine_path, db_path, sleep_duration, trace_level, verbosity, verbosity, verbosity
)

local reader = io.popen(cmd)
assert(reader, "`popen` returned nil reader")
Expand Down
7 changes: 5 additions & 2 deletions prt/tests/rollups/justfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# run PRT rollups echo test
test-echo:
# run PRT rollups test
test MACH_PATH:
rm -rf _state
MACHINE_PATH="../../../test/programs/echo" lua prt_rollups.lua

# run PRT rollups echo test
test-echo: (test "../../../test/programs/echo")

# read logs from PRT Rollups node, run in separate terminal after `test-echo`
read-node-logs:
tail -f dave.log
7 changes: 5 additions & 2 deletions test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN \
liblua5.4-dev \
lua5.4 \
libclang-dev \
xxd jq; \
xxd jq sqlite3; \
rm -rf /var/cache/apt;

# Install cartesi machine
Expand Down Expand Up @@ -108,4 +108,7 @@ RUN \
--mount=type=cache,target=prt/contracts/out,sharing=locked \
--mount=type=cache,target=prt/contracts/cache,sharing=locked \
RUSTFLAGS="-lslirp" \
just build-rust-workspace --features external_cartesi
just build-rust-workspace --features external_cartesi; \
cp target/debug/dave-rollups .

RUN mkdir -p target/debug && mv dave-rollups target/debug/

0 comments on commit b0e4e2a

Please sign in to comment.