This guide outlines the installation of the tools needed to set up your environment. Currently, all these tools are essential for proper setup, though efforts are underway to streamline the process and minimize external dependencies.
The Cartesi Coprocessor CLI tool simplifies bootstrapping, registering, and deploying Cartesi Coprocessor programs. This tool streamlines the development workflow for Cartesi based applications, allowing developers to focus on building their logic instead of wrestling with setup and deployment processes.
Ensure Rust and Cargo are installed, then install the CLI tool from crates.io:
cargo install cartesi-coprocessor
Clone and build the tool manually:
git clone https://github.com/Mugen-Builders/co-processor-cli
cd co-processor-cli
cargo install --path .
:::warning Ensure all required dependencies are installed before using this tool. :::
Docker Desktop is a must-have requirement that comes pre-configured with two necessary plugins for building Cartesi dApps:
- Docker Buildx
- Docker Compose Install the latest version of Docker Desktop for your operating system.
Install RISC-V support by running:
docker run --privileged --rm tonistiigi/binfmt --install all
The Cartesi CLI is an easy-to-use tool for developing and deploying Cartesi Rollups dApps. In this tutorial, we use the Cartesi CLI as a prerequisite for the Coprocessor CLI, as it is responsible for building the Cartesi Machine image that will be used by your solution in the background.
Install the Cartesi CLI globally:
npm i -g @cartesi/cli
Foundry is a portable and modular toolkit for Ethereum application development.
Foundry consists of:
- Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
- Chisel: Fast, utilitarian, and verbose solidity REPL.
Download and run the Foundry installer:
curl -L https://foundry.paradigm.xyz | bash
Initialize Foundry:
foundryup
:::info With this setup complete, your environment is ready for development and interaction with the Cartesi Coprocessor. :::
For mainnet deployment, Web3 Storage stores your application's artifact, which is executed when the Coprocessor is called. However, for testnet or devnet, you don’t need to concern yourself with Web3 Storage, as your application artifact is uploaded directly to the Coprocessor solver.
Install the CLI globally:
npm install -g @web3-storage/w3cli
Refer to the official documentation for more details.
Nonodo is a development node for Cartesi Rollups that was designed to work with applications running in the host machine instead of the Cartesi Machine. So, the developer doesn't need to be concerned with compiling their application to RISC-V. The application back-end should run in the developer's machine and call the Rollup HTTP API to process advance and inspect inputs. Nonodo is a valuable development workflow tool, but there are some caveats the developer must be aware of.
Install Nonodo, a local testing tool emulating Cartesi's Node, using npm:
npm install -g nonodo
The goal of these binaries is to make it easy to distribute the Cartesi Machine across different platforms and architectures. Just grab and run no matter what host you are running on!
The archives are designed to be dependency-free, thereby minimizing installations on your host system. Notably, you don't need Lua to run anything, since the Cartesi Machine becomes an executable binary.
The goal is to make it easy for anyone to hack applications using the Cartesi Machine, no matter if you want to use just the CLI, its C API, script with Lua, or build other statically linked binaries on top.
- Download the Cartesi Machine for your OS from this link.
- Extract the
.tar.xz
file:
tar -xf <filename>.tar.xz
Replace <filename>
with the actual file name.
- Rename the extracted folder to
cartesi-machine
:
mv <extracted-folder-name> cartesi-machine
- Add the
bin
directory to your system’s PATH:
- Open your shell configuration file (
~/.bashrc
,~/.zshrc
, etc.) and add:
export PATH=$PATH:/path/to/cartesi-machine/bin
- Replace
/path/to/cartesi-machine/bin
with the actual path.
- Refresh your terminal:
source ~/.bashrc # For bash
source ~/.zshrc # For zsh
Run the following command to verify:
cartesi-machine --help
:::note For Mac Users**: You may encounter a security prompt. Refer to the troubleshooting section for resolution. :::