feat(cli): use either Repository or JSON-RPC API to read data#738
feat(cli): use either Repository or JSON-RPC API to read data#738renatomaia merged 5 commits intonext/2.0from
Conversation
efdc751 to
305b9fd
Compare
01145bf to
5ded42b
Compare
There was a problem hiding this comment.
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.ReadServiceinterface plus DB-backed (RepositoryReadService) and JSON-RPC-backed (JsonrpcReadService) implementations. - Updated multiple CLI
readsubcommands 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.
cmd/cartesi-rollups-cli/root/read/match_advances/match_advances.go
Outdated
Show resolved
Hide resolved
5ded42b to
18aea27
Compare
e84cea7 to
1b7160a
Compare
18aea27 to
a23cf08
Compare
1b7160a to
d93c155
Compare
6a0c122 to
2f44070
Compare
ac88e77 to
90c3e94
Compare
2f44070 to
e7b09d6
Compare
90c3e94 to
70e9d25
Compare
e7b09d6 to
892faa1
Compare
70e9d25 to
ef0433b
Compare
892faa1 to
a52a331
Compare
ef0433b to
aae86b4
Compare
a52a331 to
d9ccb60
Compare
There was a problem hiding this comment.
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.
930a29c to
5175264
Compare
a72c612 to
8963b2f
Compare
There was a problem hiding this comment.
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.
cmd/cartesi-rollups-cli/root/read/matchadvances/matchadvances.go
Outdated
Show resolved
Hide resolved
8963b2f to
7d023f6
Compare
7d023f6 to
955acfa
Compare
closes #723