Skip to content

feat(gRPC): add grpc client, types and proto-build#1062

Open
muXxer wants to merge 15 commits intodevelopfrom
feat/grpc
Open

feat(gRPC): add grpc client, types and proto-build#1062
muXxer wants to merge 15 commits intodevelopfrom
feat/grpc

Conversation

@muXxer
Copy link
Copy Markdown
Contributor

@muXxer muXxer commented Apr 7, 2026

Description of change

This PR moves the iota-grpc-types, iota-grpc-client and the iota-proto-build crates from the monorepository to the iota-rust-sdk.

Should be rebased and merged after #1061

How the change has been tested

  • Basic tests (linting, compilation, formatting, unit/integration tests)
  • Patch-specific tests (correctness, functionality coverage)
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@muXxer muXxer marked this pull request as ready for review April 8, 2026 15:47
@muXxer muXxer requested a review from a team as a code owner April 8, 2026 15:47
Comment thread crates/iota-sdk-grpc-client/src/api/common.rs Outdated
Comment thread crates/iota-sdk-grpc-client/src/response_ext.rs
Comment thread crates/iota-sdk-grpc-proto-build/src/codegen/accessors.rs Outdated
Comment thread crates/iota-sdk/examples/polling-indexer/Cargo.toml
Comment thread .github/workflows/lints.yml

impl Client {
/// Connect to a gRPC server and create a new Client instance.
#[allow(clippy::result_large_err)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this lint here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fixed it

Comment thread crates/iota-sdk-grpc-client/src/client.rs Outdated
/// Proto checkpoint summary. Use `response.summary()?.summary()` to convert
/// to SDK type.
pub summary: Option<iota_grpc_types::v1::checkpoint::CheckpointSummary>,
/// Proto validator signature. Use `response.signature()?.signature()` to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a bit awkward. Why not have a summary and summary_grpc or something?

Comment thread crates/iota-sdk-grpc-client/src/api/common.rs Outdated
Comment thread crates/iota-sdk-grpc-client/src/api/ledger/checkpoints.rs Outdated
/// ```
pub async fn get_objects(
&self,
refs: &[(ObjectId, Option<Version>)],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since the most common use-case is to use None for version always, shouldn't we have a function that skips that and accepts a list of only object IDs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But then we would increase the API surface by another function. What if you want to make a batch call and for some you want the version, and for others not. I would prefer to leave it like it is if you don't mind.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I really think the most likely use-case is to call this with no versions

Comment thread crates/iota-sdk-grpc-proto-build/src/main.rs Outdated
Copy link
Copy Markdown
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

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

Please add a workflow to check that grpc has been generated

@muXxer muXxer force-pushed the feat/grpc branch 2 times, most recently from 18c4f0c to 72acef8 Compare April 22, 2026 20:02
Comment thread crates/iota-sdk-grpc-types/src/proto/iota/grpc/v1/checkpoint.rs Outdated
Comment thread crates/iota-sdk-grpc-types/src/proto/iota/grpc/v1/checkpoint.rs Outdated
authors = ["IOTA Foundation <[email protected]>"]
edition = "2024"
license = "Apache-2.0"
publish = false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We want to publish it in the future?

Suggested change
publish = false

Same for the grpc types

- name: Run Cargo Udeps
run: cargo +nightly udeps ${{ matrix.flags }}

proto-build:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any other checks that would make sense to run in the CI? Are the e2e tests only in the iota repo for now?

}

pub fn add_field_path(&mut self, path: &str) -> &mut Self {
if self.wildcard || !is_valid_path(path) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't want to return an error (Result) if it's not a valid path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants