#tool #cartesi #command-line-tool #build-tool #cli #co-processor

app cartesi-coprocessor

A cli tool to simplify bootstrapping, registering and deploying Cartesi co-processor programs

1 unstable release

new 0.1.0 Dec 19, 2024

#318 in Command line utilities

Apache-2.0

2MB
41K SLoC

Solidity 39K SLoC // 0.2% comments Python 1K SLoC // 0.0% comments Rust 771 SLoC // 0.1% comments

Cartesi Co-Processor CLI Tool

Overview

The Cartesi Co-Processor CLI Tool simplifies bootstrapping, registering, and deploying Cartesi co-processor 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.

Features

  • Bootstrap Projects: Quickly initialize a Cartesi project with a simple Foundry project inheriting the co-processor base contracts.
  • Simplified Registration: Easily build, generate .car files and finally update the co-processor task issuer with your program/machine details.
  • Simplified Deployment: Automate the deployment and registration of co-processor programs.

Installation

Using Cargo

Ensure you have Rust and Cargo installed. You can then install the CLI tool directly from crates.io:

cargo install cartesi-coprocessor

From Source

Clone the repository and build the tool manually:

git clone https://github.com/Mugen-Builders/co-processor-cli
cd co-processor-cli
cargo install --path .

Usage

Run the CLI tool with:

cartesi-coprocessor [COMMAND] [OPTIONS]

Commands

Bootstrap a Project

Initialize a new Foundry project with Cartesi base contracts:

cartesi-coprocessor create --dapp-name <project_name> --template <language template>

Register a Co-Processor Program

Register your Cartesi co-processor program:

cartesi-coprocessor register --email <w3 storage account email>

Example Workflow

  1. Bootstrap a Project
cartesi-coprocessor create --dapp-name my-cartesi-project --template rust
cd my-cartesi-project
  1. Add Logic to the Child Contract Edit the pre-generated child contract in the src folder to implement your business logic.

  2. Register the Program

cartesi-coprocessor register --email test@gmail.com

Contributing

We welcome contributions! To get started:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-name
  3. Make your changes and test them.
  4. Submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

If you encounter issues or have feature requests, please open an issue on GitHub. Or drop a message on Cartesi discord under the Co-Procesor thread.


Dependencies

~4–11MB
~123K SLoC