Categorygithub.com/Mugen-Builders/learn-rollmelette
repository
0.0.0-20241025012433-c63b23fa6aba
Repository: https://github.com/mugen-builders/learn-rollmelette.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README


An example in Golang using Cartesi CLI, Nonodo, and Rollmelette
This example aims to demonstrate the lifecycle of a Cartesi DApp through unit tests using Rollmelette as a framework. In addition it serves as a template for integration with Avail.

Static Badge Static Badge Static Badge Static Badge Static Badge

User Stories:

Here is a list of user stories that the application covers:

#User Story Description
1As a user, I want to send Ether tokens to my wallet on Layer 2.
2As a user, I want to send ERC20 tokens to my wallet on Layer 2.
3As a user, I want to transfer Ether tokens between wallets on Layer 2.
4As a user, I want to transfer ERC20 tokens between wallets on Layer 2.
5As a user, I want to withdraw my deposit in ERC20.
6As a user, I want to withdraw my deposit in Ether.
7As a user, I want to request the balance of Ether in my wallet on Layer 2.
8As a user, I want to request the balance of ERC20 tokens in my wallet on Layer 2.
9As a user, I want to verify if the Ether deposit was received correctly on Layer 2.
10As a user, I want to verify if the ERC20 token deposit was received correctly on Layer 2.
11As a user, I want to receive a confirmation of Ether transfer between wallets on Layer 2.
12As a user, I want to receive a confirmation of ERC20 token transfer between wallets on Layer 2.

Setup:

The system setup is divided into three parts:

1º - Install all dependencies:

  • Cartesi CLI:
$ npm i -g @cartesi/cli
  • Foundry: Follow the instruction here

2º - Clone this repo using the code below:

git clone https://github.com/Mugen-Builders/learn-rollmelette.git

Running the tests:

The command below will run all unit tests present in the repository.

make test

[!NOTE] All user stories covered here can also be fulfilled using the CLI. For more information, please refer to the documentation.

Avail Integration + Cartesi bare metal:

This section will help you set up a Cartesi dApp with Avail on your local machine. You'll be able to send transactions either directly through Cartesi Rollups Smart Contracts on L1 or via Avail DA using EIP-712 signed messages. You'll also learn how to check the dApp's state and outputs using Cartesi Rollups Framework APIs.

Requirements:

As a reference for setting up your machine, follow these steps

Running your node locally ( A mocked implementation ):

  • Start brunodo using the command with the flag with the flag that enables integration with Avail:
$ brunodo
  • Build your machine:
$ cartesi build
  • Run the Cartesi Machine Locally on bare metal using the command:
$ cartesi-machine --network \
 --flash-drive=label:root,filename:.cartesi/image.ext2 \
 --env=ROLLUP_HTTP_SERVER_URL=http://10.0.2.2:5004 -- /var/opt/cartesi-app/app

Running your node locally with a testnet:

  • Start brunodo using the command with the flag with the flag that enables integration with Avail:
$ brunodo --avail-enabled -d --contracts-input-box-block 6850934 --rpc-url https://sepolia.drpc.org
  • Build your machine:
$ cartesi build
  • Run the Cartesi Machine Locally on bare metal using the command:
$ cartesi-machine --network \
 --flash-drive=label:root,filename:.cartesi/image.ext2 \
 --env=ROLLUP_HTTP_SERVER_URL=http://10.0.2.2:5004 -- /var/opt/cartesi-app/app