Skip to content

feat(cli): use either Repository or JSON-RPC API to read data#738

Merged
renatomaia merged 5 commits intonext/2.0from
features/cli-read-jsonrpc
Mar 2, 2026
Merged

feat(cli): use either Repository or JSON-RPC API to read data#738
renatomaia merged 5 commits intonext/2.0from
features/cli-read-jsonrpc

Conversation

@renatomaia
Copy link

closes #723

@renatomaia renatomaia requested a review from vfusco February 19, 2026 19:02
@renatomaia renatomaia self-assigned this Feb 19, 2026
@renatomaia renatomaia force-pushed the features/cli-read-prt-data branch from efdc751 to 305b9fd Compare February 19, 2026 19:42
@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch from 01145bf to 5ded42b Compare February 19, 2026 19:51
@vfusco vfusco requested a review from Copilot February 20, 2026 15:20
@vfusco vfusco added this to the 2.0.0 milestone Feb 20, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a ReadService abstraction for the CLI read subcommands so they can fetch data either from the local DB (via repository) or from a remote JSON-RPC endpoint, aligning CLI “read” outputs with the JSON-RPC API shapes.

Changes:

  • Added internal/read.ReadService interface plus DB-backed (RepositoryReadService) and JSON-RPC-backed (JsonrpcReadService) implementations.
  • Updated multiple CLI read subcommands to use the new datasource abstraction.
  • Added a new config/env var/flag for selecting a remote JSON-RPC endpoint (CARTESI_JSONRPC_ENDPOINT, --jsonrpc-endpoint).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 30 comments.

Show a summary per file
File Description
internal/read/types.go Introduces ReadService interface for read operations.
internal/read/repository.go Implements DB-backed read service using repository and marshals JSON-RPC-shaped responses.
internal/read/jsonrpc.go Implements JSON-RPC-backed read service using the JSON-RPC client.
internal/config/generated.go Adds CARTESI_JSONRPC_ENDPOINT to generated config and loads it into node/jsonrpc configs.
internal/config/generate/Config.toml Declares CARTESI_JSONRPC_ENDPOINT in the config generator inputs.
cmd/cartesi-rollups-cli/root/root.go Adds --jsonrpc-endpoint flag (bound to config).
cmd/cartesi-rollups-cli/root/read//.go Switches subcommands to use ReadService and JSON-RPC params types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch from 5ded42b to 18aea27 Compare February 20, 2026 18:29
@renatomaia renatomaia force-pushed the features/cli-read-prt-data branch from e84cea7 to 1b7160a Compare February 20, 2026 19:01
@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch from 18aea27 to a23cf08 Compare February 20, 2026 19:01
@renatomaia renatomaia force-pushed the features/cli-read-prt-data branch from 1b7160a to d93c155 Compare February 20, 2026 21:08
@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch 2 times, most recently from 6a0c122 to 2f44070 Compare February 20, 2026 22:35
@renatomaia renatomaia force-pushed the features/cli-read-prt-data branch 2 times, most recently from ac88e77 to 90c3e94 Compare February 21, 2026 03:19
@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch from 2f44070 to e7b09d6 Compare February 21, 2026 03:19
@renatomaia renatomaia force-pushed the features/cli-read-prt-data branch from 90c3e94 to 70e9d25 Compare February 23, 2026 19:08
@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch from e7b09d6 to 892faa1 Compare February 23, 2026 19:09
@renatomaia renatomaia force-pushed the features/cli-read-prt-data branch from 70e9d25 to ef0433b Compare February 23, 2026 20:26
@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch from 892faa1 to a52a331 Compare February 23, 2026 20:26
@renatomaia renatomaia force-pushed the features/cli-read-prt-data branch from ef0433b to aae86b4 Compare February 23, 2026 21:05
Base automatically changed from features/cli-read-prt-data to next/2.0 February 24, 2026 21:00
@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch from a52a331 to d9ccb60 Compare February 24, 2026 21:17
@vfusco vfusco requested review from Copilot and mpolitzer February 25, 2026 14:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch 6 times, most recently from 930a29c to 5175264 Compare February 27, 2026 14:27
@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch 2 times, most recently from a72c612 to 8963b2f Compare February 28, 2026 01:34
@vfusco vfusco requested a review from Copilot February 28, 2026 16:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated 21 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch from 8963b2f to 7d023f6 Compare February 28, 2026 21:35
@renatomaia renatomaia force-pushed the features/cli-read-jsonrpc branch from 7d023f6 to 955acfa Compare March 2, 2026 17:52
@github-project-automation github-project-automation bot moved this to Waiting Merge in Rollups SDK Mar 2, 2026
@renatomaia renatomaia merged commit 955acfa into next/2.0 Mar 2, 2026
6 checks passed
@renatomaia renatomaia deleted the features/cli-read-jsonrpc branch March 2, 2026 19:38
@github-project-automation github-project-automation bot moved this from Waiting Merge to Done in Rollups SDK Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants