Proto-generated types for Ev-node.
grpc(enabled by default) - Includes gRPC client and server codetransport- Enables tonic transport features
[dependencies]
ev-types = "0.0.1"If you only need the message types without gRPC client/server code:
[dependencies]
ev-types = { version = "0.0.1", default-features = false }This is useful when:
- You only need to serialize/deserialize Ev-node messages
- You're using a different RPC framework
- You want to minimize dependencies
- You're building for environments where gRPC is not needed
This crate generates two versions of the protobuf code:
evnode.v1.messages.rs- Contains only the message types (structs/enums) with no gRPC dependenciesevnode.v1.services.rs- Contains everything including gRPC client/server code
Both files are pre-generated and checked into the repository, so users don't need protoc installed or need to regenerate based on their feature selection.
The crate uses pre-generated proto files that are checked into version control. This ensures that the crate can be built from crates.io without requiring access to the original .proto files.
cargo buildThe build script will:
- Check if pre-generated files exist (
src/proto/evnode.v1.*.rs) - If they exist, use them (this is the default behavior)
- If they don't exist, attempt to generate them from source proto files
The generated code is committed to the repository. If you modify the proto files, you need to regenerate:
# Force regeneration by setting the environment variable
EV_TYPES_FORCE_PROTO_GEN=1 cargo build
# Or from the repository root
just rust-proto-genImportant:
- The build process generates both
evnode.v1.messages.rsandevnode.v1.services.rs - Both files should be committed to ensure users can use the crate without needing to regenerate
- When publishing to crates.io, the pre-generated files are included in the package
- Users installing from crates.io will use the pre-generated files automatically
Important: The CI uses protoc version 25.1. If your local protoc version differs, you may see formatting differences in the generated files.
To check your protoc version:
protoc --versionTo ensure consistency with CI:
- Install protoc version 25.1
- Use the provided script:
./client/scripts/generate-protos.sh - Or use just:
just rust-proto-gen
If you see differences in generated files between local and CI:
- It's usually due to protoc version differences
- Different versions may format the generated code slightly differently
- The functionality remains the same, only formatting changes
To avoid this:
- Use the same protoc version as CI (25.1)
- Or accept the formatting from your version and update CI if needed
This crate requires:
protoc(Protocol Buffers compiler)tonic-buildfor code generationprostfor runtime support
The build dependencies are specified in Cargo.toml and use workspace versions for consistency.