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
Command | Description |
---|---|
build | Build the application |
run | Run a local Cartesi node for the application. |
send | Send input to the application |
deposit | Deposits Ether, ERC20 or ERC721 tokens to the application. |
address-book | Prints addresses of deployed smart contracts |
clean | Deletes all cached build artifacts of application. |
doctor | Verify the minimal system requirements |
hash | Print the image hash generated by the build command |
shell | Start a shell in the Cartesi machine of the application |
create | Creates a new application template. |
logs | Show logs of a local node environment. |
status | Shows the status of a local node environment. |
build
Compiles your application to RISC-V and builds a Cartesi machine snapshot.
Usage:
cartesi build
Flags:
--config <config>
: Path to the configuration file (default: ["cartesi.toml"]).--drives-only
Only build drives, do not boot machine.--verbose
: Verbose output (default: false).
run
Runs a local cartesi node for the application.
Usage:
cartesi run
Flags:
--block-time <number>
: Interval between blocks (in seconds) (default: 5).--default-block <string>
: Default block to be used when fetching new blocks. (choices: "latest", "safe", "pending", "finalized", default: "latest").--cpus <number>
: Number of cpu limits for the node.--memory <number>
: Memory limit for the node in MB.--services <string>
: Optional services to start, comma separated list from [bundler, espresso, explorer, graphql, paymaster] (default: []).-p, --port <number>
: Port to listen on (default: 8080).--dry-run
: Show the docker compose configuration (default: false).--epoch-length
: Length of an epoch (in blocks) (default: 720).--project-name <string>
: Name of project (used by docker compose and cartesi-rollups-node).-v, --verbose
: Verbose output (default: false).
send
Send inputs to the application.
Usage:
cartesi send
Flags:
--from <address>
: Input sender address.--application <address>
: Application address.--encoding <encoding>
: Input encoding (choices: "hex", "string", "abi").--abi-params <abi-params>
: Input abi params.--project-name <string>
: Name of project (used by docker compose and cartesi-rollups-node).--rpc-url <url>
: RPC URL of the Cartesi Devnet.
deposit
Deposits an asset to the application.
Usage:
cartesi deposit
Flags:
--from <address>
: Input sender address.--application <address>
: Application address.--project-name <string>
: Name of project (used by docker compose and cartesi-rollups-node).--rpc-url <url>
: RPC URL of the Cartesi Devnet.
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:
--command <command>
: shell command to run (default: "/bin/sh").-c, --config <config>
: path to the configuration file (default: ["cartesi.toml"]).--run-as-root
: run as root user (default: false).
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.
logs
Shows logs of a local node environment.
Usage:
cartesi logs
Flags:
-f, --follow
: Follow log output.--no-color
: Produce monochrome output.--since <string>
: Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes).-n, --tail <string>
: Number of lines to show from the end of the logs (default: "all").--until <string>
: Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes).-h, --help
: display help for command.
status
Shows the status of a local node environment.
Usage:
cartesi status
Flags:
--json
: Format output as JSON