Skip to content
Logo

Rollup

Build Cartesi applications in Node.js, talking directly to the machine — no HTTP server in between.

A Cartesi application receives inputs from the blockchain, processes them inside a deterministic Linux virtual machine (the Cartesi Machine), and produces verifiable outputs. The @cartesi/rollup package is a native binding to libcmt, the guest-side rollup library, so your Node.js code can process inputs and emit outputs with a few function calls:

import {  } from "@cartesi/rollup";
 
const  = new ();
 
await .({
    (, ) {
        // an input arrived from the blockchain — echo it back as a notice
        .(.);
        return true; // accept
    },
    (, ) {
        // an off-chain query — answer with a report
        .(.);
    },
});

The same code runs unchanged in two environments:

  • Your development machine — the binding embeds libcmt's mock IO driver: inputs come from local files, outputs are written next to them. Instant feedback, no emulator needed.
  • Inside the Cartesi Machine — the binding talks to the real rollup device of the emulated riscv64 machine. A prebuilt binary ships in the package, so nothing is compiled at install time.

This is the guest side of the rollups protocol: the blobs this package emits and receives are the same ones @cartesi/codec encodes and decodes off-chain.

Installation

Where to go next