Categorygithub.com/prototyp3-dev/go-rollups
module
0.5.2
Repository: https://github.com/prototyp3-dev/go-rollups.git
Documentation: pkg.go.dev

# README

Cartesi Rollups GO high level framework

This works for Cartesi Rollups version 1.0.x

Create cartesi rolllups DApp with codes like:

package main

import (
  "fmt"
  "github.com/prototyp3-dev/go-rollups/handler"
)

var infolog = log.New(os.Stderr, "[ info ]  ", log.Lshortfile)

func Handle(payload string) error {
  fmt.Println("Handle: Received payload:",payload)
  return nil
}

func main() {
  handler.HandleDefault(Handle)

  err := handler.RunDebug()
  if err != nil {
    log.Panicln(err)
  }
}

Check the examples for more use cases.

You will need sunodo cli to create and run the example, and curl to interact with the dapp.

To run an example

cd examples
rm -rf example.go
ln -sr example1_rollups_helpers.go example.go
sunodo build
sunodo run

You can send inputs with (account and private key of anvil test accounts)

sunodo send generic --input="test"

Send inspects with

curl http://localhost:8080/inspect/test

View notices with

curl -H 'Content-Type: application/json' -X POST http://localhost:8080/graphql -d '{"query": "query { notices { edges { node { index payload }}}}"}'
DISCLAIMER: This is a prototype to showcase the Cartesi Rollups features and is not intended to be used as-is in the production environment

# Packages

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