Skip to content

3 skill inaccuracies found during ETH wallet build (inspect content-type, port proxying, JSON-RPC params) #2

@riseandshaheen

Description

@riseandshaheen

Context

While building a Cartesi Rollups v2 ETH wallet application (JS backend + React frontend) using the skills, I hit 3 issues where the skills gave incorrect or missing guidance. These caused real failures during development that required debugging to resolve.

Environment: Cartesi CLI v2.0-alpha.34, local Anvil devnet via cartesi run


Issue 1: Inspect endpoint content type is wrong in two skills

Affected skills: cartesi-frontend (line 152), cartesi-local-dev (line 453)

Both skills instruct sending inspect requests with Content-Type: application/json and a JSON-wrapped hex payload:

# What the skills say (DOES NOT WORK with cartesi run)
curl -s -X POST "http://localhost:<port>/inspect/<app-name>" \
  -H "Content-Type: application/json" \
  -d '{"payload":"0x7374617473"}'

What actually works with cartesi run:

curl -s -X POST "http://localhost:<port>/inspect/<app-name>" \
  -H "Content-Type: application/octet-stream" \
  -d 'stats'

The inspect endpoint under cartesi run expects Content-Type: application/octet-stream with a raw string body. When you send the JSON-wrapped format, the backend's hexToString(data.payload) decodes something unexpected and route matching fails silently — the inspect returns a report but with wrong data, making it hard to debug.

Suggested fix: Update both cartesi-frontend section 5 and cartesi-local-dev Phase 4 to use application/octet-stream with raw body when targeting cartesi run.


Issue 2: cartesi-local-dev doesn't document single-port proxying

Affected skill: cartesi-local-dev

The skill implies Anvil runs on localhost:8545 separately and uses generic <port> placeholders for inspect/RPC. In reality, cartesi run proxies all services through a single dynamic port (e.g. 6751):

Service Actual URL
Anvil RPC http://127.0.0.1:6751/anvil
Inspect http://127.0.0.1:6751/inspect/<app-name>
JSON-RPC http://127.0.0.1:6751/rpc

This matters because:

  • cartesi deposit ether with --rpc-url http://127.0.0.1:8545 fails with ECONNREFUSED
  • The correct flag is --rpc-url http://127.0.0.1:<port>/anvil
  • Frontend config must point the wagmi RPC transport to <port>/anvil, not localhost:8545

Suggested fix: Add a clear table in cartesi-local-dev Phase 2 showing the single-port proxy layout and explicitly state that localhost:8545 is NOT directly exposed.


Issue 3: JSON-RPC params format inconsistency between skills

Affected skills: cartesi-local-dev vs cartesi-jsonrpc

cartesi-local-dev (line 503) shows params as an array:

{"jsonrpc":"2.0","method":"cartesi_listOutputs","params":[{"application":"<app-name>"}],"id":1}

cartesi-jsonrpc (line 323) correctly shows params as an object:

{"jsonrpc":"2.0","method":"cartesi_listOutputs","params":{"application":"my-dapp"},"id":1}

The array format returns {"error":{"code":-32602,"message":"Invalid parameters"}}. Only the object format works.

Suggested fix: Update all JSON-RPC examples in cartesi-local-dev (lines 503, 508, 513, 518, 582, 599) to use object params consistent with cartesi-jsonrpc.


Reproduction

All three issues were hit while following the skills to build an ETH deposit/withdraw app with a React frontend, targeting cartesi run on local Anvil. Happy to provide the full project if helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions