Skip to main content

CLI commands

The Cartesi CLI provides essential tools for developing, deploying, and interacting with Cartesi applications. This page offers a quick reference to available commands and usage.

Basic Usage

To use any command, run:

cartesi [COMMAND]

For detailed help on a specific command, use:

cartesi help [COMMAND]

Core Commands

CommandDescription
createCreate a new application
buildBuild the application
runRun the application node
sendSend input to the application
deployDeploy application to a live network
address-bookPrints addresses of deployed smart contracts
cleanClean build artifacts of the application
doctorVerify the minimal system requirements
hashPrint the image hash generated by the build command
shellStart a shell in the Cartesi machine of the application

create

Create a new Cartesi application from a template.

Usage:

cartesi create NAME --template <template-name> [--branch <value>]

Flags:

  • --template=<option>: (required) Template name to use (options: cpp, cpp-low-level, go, javascript, lua, python, ruby, rust, typescript).
  • --branch=<value>: cartesi/application-templates repository branch name to use.

build

Compiles your application to RISC-V and builds a Cartesi machine snapshot.

Usage:

cartesi build [--from-image <value>] [--target <value>]

Flags:

  • --from-image=<value>: Skip Docker build and start from this image.
  • --target=<value>: Target of Docker multi-stage build.

run

Run a local Cartesi node for the application.

Usage:

cartesi run [--block-time <value>] [--epoch-length <value>] [--no-backend] [-v] [--listen-port <value>]

Flags:

  • --block-time=<value>: Interval between blocks in seconds (default: 5).
  • --epoch-length=<value>: length of an epoch in blocks (default: 720).
  • --no-backend: Run a node without the application code.
  • -v, --verbose: Run node with detailed container logs.
  • --listen-port=<value>: Port to listen for incoming connections (default: 8080).
  • --dry-run: Shows the docker compose configuration.
  • --cpus=<value>: Define the number of CPUs (eg.: 1) for the rollups-node (default is not limited).
  • --memory=<value>: Define the amount of memory (eg.: 1024) for the rollups-node in MB (default is not limited).

send

Send generic, Ether, ERC20, ERC721 and dApp address inputs to the application in interactive mode.

Usage:

cartesi send

Sub-commands:

  • send dapp-address: Send dApp address input.
  • send erc20: Send ERC-20 deposit.
  • send erc721: Send ERC-721 deposit.
  • send ether: Send ether deposit.
  • send generic: Send generic input.

deploy

Deploy the application to a live network.

Usage:

cartesi deploy --webapp <value> [--hosting self-hosted|third-party]

Flags:

  • --webapp=<value>: (required) Address of deploy webapp.
  • --hosting=<option>: Hosting type (options: self-hosted, third-party).

address-book

Prints addresses of the deployed ollups smart contracts.

Usage:

cartesi address-book [--json]

Flags:

  • --json: Format output as JSON

shell

Starts the Cartesi Machine in interactive mode, providing a shell interface.

Usage:

cartesi shell [IMAGE] [--run-as-root]

Flags:

--run-as-root: Run as root user

© 2024 Cartesi Foundation Ltd. All rights reserved.

The Cartesi Project is commissioned by the Cartesi Foundation.

We use cookies to ensure that we give you the best experience on our website. By using the website, you agree to the use of cookies.