You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!--
Please read and fill out this form before submitting your PR.
Please make sure you have reviewed our contributors guide before
submitting your
first PR.
NOTE: PR titles should follow semantic commits:
https://www.conventionalcommits.org/en/v1.0.0/
-->
## Overview
Due to how we have the repo setup, there is an issue about including the
proto files in the crate, this is a solution to fix this
---------
Co-authored-by: tac0turtle <[email protected]>
Copy file name to clipboardExpand all lines: client/crates/types/README.md
+22-14Lines changed: 22 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# rollkit-types
1
+
# ev-types
2
2
3
-
Proto-generated types for Rollkit.
3
+
Proto-generated types for Ev-node.
4
4
5
5
## Features
6
6
@@ -13,7 +13,7 @@ Proto-generated types for Rollkit.
13
13
14
14
```toml
15
15
[dependencies]
16
-
rollkit-types = "0.1"
16
+
ev-types = "0.0.1"
17
17
```
18
18
19
19
### Types only (without gRPC)
@@ -22,12 +22,12 @@ If you only need the message types without gRPC client/server code:
22
22
23
23
```toml
24
24
[dependencies]
25
-
rollkit-types = { version = "0.1", default-features = false }
25
+
ev-types = { version = "0.0.1", default-features = false }
26
26
```
27
27
28
28
This is useful when:
29
29
30
-
- You only need to serialize/deserialize Rollkit messages
30
+
- You only need to serialize/deserialize Ev-node messages
31
31
- You're using a different RPC framework
32
32
- You want to minimize dependencies
33
33
- You're building for environments where gRPC is not needed
@@ -36,33 +36,41 @@ This is useful when:
36
36
37
37
This crate generates two versions of the protobuf code:
38
38
39
-
1.**`rollkit.v1.messages.rs`** - Contains only the message types (structs/enums) with no gRPC dependencies
40
-
2.**`rollkit.v1.services.rs`** - Contains everything including gRPC client/server code
39
+
1.**`evnode.v1.messages.rs`** - Contains only the message types (structs/enums) with no gRPC dependencies
40
+
2.**`evnode.v1.services.rs`** - Contains everything including gRPC client/server code
41
41
42
42
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.
43
43
44
44
## Building
45
45
46
-
The proto files are automatically generated during the build process:
46
+
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.
47
47
48
48
```bash
49
49
cargo build
50
50
```
51
51
52
+
The build script will:
53
+
1. Check if pre-generated files exist (`src/proto/evnode.v1.*.rs`)
54
+
2. If they exist, use them (this is the default behavior)
55
+
3. If they don't exist, attempt to generate them from source proto files
56
+
52
57
## Proto Generation
53
58
54
59
The generated code is committed to the repository. If you modify the proto files, you need to regenerate:
55
60
56
61
```bash
57
-
#From the repository root
58
-
make rust-proto-gen
62
+
#Force regeneration by setting the environment variable
63
+
EV_TYPES_FORCE_PROTO_GEN=1 cargo build
59
64
60
-
# Or directly
61
-
cd client/crates/rollkit-types
62
-
cargo build
65
+
# Or from the repository root (if a make target exists)
66
+
make rust-proto-gen
63
67
```
64
68
65
-
**Important**: The build process generates both `rollkit.v1.messages.rs` and `rollkit.v1.services.rs`. Both files should be committed to ensure users can use the crate without needing to regenerate based on their feature selection.
69
+
**Important**:
70
+
- The build process generates both `evnode.v1.messages.rs` and `evnode.v1.services.rs`
71
+
- Both files should be committed to ensure users can use the crate without needing to regenerate
72
+
- When publishing to crates.io, the pre-generated files are included in the package
73
+
- Users installing from crates.io will use the pre-generated files automatically
0 commit comments