Cartesi Node Host Mode

Cartesi Rollups version: 0.9.x

This project is a simple way to run Cartesi node on host mode using a local chain to test your code without the need to build the Cartesi Machine. Simply dowload the docker compose file, start docker compose, and start the Backend DApp code on the host machine

Requirements

Docker version 20.10.14 with Docker Buildkit enabled.

Run host mode

To start the Cartesi node on host mode using a local chain run:

curl https://raw.githubusercontent.com/prototyp3-dev/cartesi-node-host-mode/main/docker-compose.yml -O
docker compose up -d

Stop running the node with

docker compose down -v

Create and Test new project with Sunodo CLI

Using sunodo cli you can create a project and test using host mode.

As an example, we will create a python dapp and run on host mode. To create the dapp you can run

sunodo create my-dapp --template=python

While the cartesi node in host mode is running, you can run your backend code with:

cd my-dapp
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
ROLLUP_HTTP_SERVER_URL="http://127.0.0.1:5004" python3 dapp.py