Skip to content

Commit c6e42eb

Browse files
authored
Update helloworld-tutorial.md (#2385)
Update the hello-world tutorial readme to reflect changes to package names and remove reference to deprecated tools. ## Motivation As someone relatively new to Rust and new to Tonic, I was working through the hello-world tutorial and found a few issues. I've successfully built the project with the changes in this PR. ## Solution - update example Cargo.toml to reflect package name updates - update example build.rs with correct build tool name - remove reference to deprecated GUI tool I've tested this and it runs and builds correctly. I sort of hate to reference Postman as the recommended GUI but it was the first one on the list referenced by the now-deprecated Bloom GUI.
1 parent 29163c2 commit c6e42eb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/helloworld-tutorial.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,11 @@ path = "src/client.rs"
114114
[dependencies]
115115
tonic = "*"
116116
prost = "0.14"
117+
tonic-prost = "*"
117118
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
118119

119120
[build-dependencies]
120-
tonic-build = "*"
121+
tonic-prost-build = "*"
121122
```
122123

123124
We include `tonic-build` as a useful way to incorporate the generation of our client and server gRPC code into the build process of our application. We will setup this build process now:
@@ -128,7 +129,7 @@ At the root of your project (not /src), create a `build.rs` file and add the fol
128129

129130
```rust
130131
fn main() -> Result<(), Box<dyn std::error::Error>> {
131-
tonic_build::compile_protos("proto/helloworld.proto")?;
132+
tonic_prost_build::compile_protos("proto/helloworld.proto")?;
132133
Ok(())
133134
}
134135
```
@@ -239,7 +240,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
239240

240241
You should now be able to run your HelloWorld gRPC server using the command `cargo run --bin helloworld-server`. This uses the [[bin]] we defined earlier in our `Cargo.toml` to run specifically the server.
241242

242-
If you have a gRPC GUI client such as [Bloom RPC] you should be able to send requests to the server and get back greetings!
243+
If you have a gRPC GUI client such as [Postman] you should be able to send requests to the server and get back greetings!
243244

244245
Or if you use [grpcurl] then you can simply try send requests like this:
245246
```
@@ -252,7 +253,7 @@ And receiving responses like this:
252253
}
253254
```
254255

255-
[bloom rpc]: https://github.com/uw-labs/bloomrpc
256+
[postman]: https://www.postman.com/
256257
[grpcurl]: https://github.com/fullstorydev/grpcurl
257258

258259
## Writing our Client

0 commit comments

Comments
 (0)