Skip to content

Create API crate and organize protobuf files#30

Merged
georgi-l95 merged 2 commits intomainfrom
7-create-api-crate-and-organize-protobuf-files
Jun 13, 2025
Merged

Create API crate and organize protobuf files#30
georgi-l95 merged 2 commits intomainfrom
7-create-api-crate-and-organize-protobuf-files

Conversation

@georgi-l95
Copy link
Copy Markdown
Contributor

Description

This PR fixes the rock-node-protobufs crate so it builds successfully again.
While compiling, several tonic::include_proto! paths referred to modules that are not generated by tonic-build, which produced “couldn’t read … No such file or directory” errors.
The change:

  • Adds every missing (actually-generated) protobuf module under the com.hedera.* hierarchy.
  • Removes / reorganises the stale module stubs that pointed to non-existent files.
  • Enables #![allow(non_camel_case_types)] at crate root to silence harmless naming warnings emitted by generated code.

With these updates the protobuf crate now compiles its full set of 193 .proto definitions without errors.

Related Issues

Changes

  • crates/rock-node-protobufs/src/lib.rs
    • Added #![allow(non_camel_case_types)].
    • Added correct tonic::include_proto! calls for:
      • com.hedera.hapi.block
      • com.hedera.hapi.block.stream.{input,output}
      • com.hedera.hapi.node.{addressbook,state.{addressbook,blockstream,entity,history,hints,roster,tss}}
      • com.hedera.hapi.platform.{event,state}
      • com.hedera.hapi.services.auxiliary.{history,hints,tss}
      • com.hedera.mirror.api.proto
    • Dropped invalid includes (com.hedera.hapi.platform, com.hedera.hapi.services, com.hedera.hapi.streams).
    • Restructured the module tree to mirror the generated file layout.

Reviewer Checklist

  • The code follows the project's coding standards.
  • New and existing unit tests pass locally with my changes.
  • I have added necessary documentation (if applicable).
  • I have confirmed that this change does not introduce any new security vulnerabilities.

Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
@georgi-l95 georgi-l95 added this to the 0.1.0 milestone Jun 13, 2025
@georgi-l95 georgi-l95 self-assigned this Jun 13, 2025
@georgi-l95 georgi-l95 added the area: protobuf Related to the gRPC and data serialization contracts. label Jun 13, 2025
@georgi-l95 georgi-l95 linked an issue Jun 13, 2025 that may be closed by this pull request
4 tasks
@georgi-l95 georgi-l95 merged commit 1c69c39 into main Jun 13, 2025
@georgi-l95 georgi-l95 deleted the 7-create-api-crate-and-organize-protobuf-files branch June 13, 2025 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: protobuf Related to the gRPC and data serialization contracts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create API Crate and Organize Protobuf Files

1 participant