Template DApps and load-testing tools for the Cartesi Rollups SDK. Includes a Python template, a JavaScript template, and a Locust-based load tester.
npm install -g @cartesi/cli@2.0.0-alpha.32Both templates implement the same Cartesi Rollup polling loop: the app posts to /finish to receive the next input, handles it, then posts again. They differ only in runtime (Python vs Node.js).
cd py_simple_dapp
cartesi build # builds RISC-V machine drive via Docker
cartesi run # starts local Cartesi nodeSend an input:
cartesi send "Hello World" --encoding stringcd js_simple_dapp
cartesi build
cartesi runThe JS source (src/index.js) is bundled with esbuild during cartesi build.
Each DApp has a test_e2e.sh that starts the node, sends a "Hello World" input, confirms it was processed, records the result, and cleans up:
bash py_simple_dapp/test_e2e.sh
bash js_simple_dapp/test_e2e.shResults are appended to test_results.csv (commit hash, run counter, elapsed ms). To plot them, install dependencies once and then run:
pipenv install
pipenv run python plot_results.pySends Ethereum transactions to a Cartesi InputBox contract via Locust to stress-test a live rollup node.
cd simple-load-test
python3 -m venv .venv && . .venv/bin/activate
pip3 install -r requirements.txtCopy .env and fill in your values:
RPC_URL=
PRIVATE_KEY= # funds user wallets
MNEMONIC= # one derived wallet per simulated user
INPUTBOX_ADDRESS=
APP_ADDRESS=
Run:
ENV_FILE=.env locust --tags short --loglevel info --run-time 20m --spawn-rate 0.016 --users 20A web UI is available at http://0.0.0.0:8089. Add --headless to skip it.