IMPORTANT: You need to do the steps in sequence in order for the state of the lesson's learning environment to be consistent. Otherwise, you'll get behaviors that might be confusing.
The objective of this scenario is to demonstrate how to how to create a gRPC client and server in Go using the
protoc executable to auto-generate boilerplate code and then use the autogenerated code within a server and client code also written in Go.
The demonstration is created using the sample code defined in the tutorial published by the gRPC/CNCF found here.
Also, you'l be able to view the auto-generated code in the version of Visual Studio Code that's built directly into the Katacoda interactive learning environment.
Here's a listing of the lessons in the scenario.
Lesson 1 - Get protoc executable up and runnning
Lesson 2 - Get the demonstrations gRPC API source code
Lesson 4 - Generate the gRPC message objects in C# using
To proceed, click the
Start Scenario button.
Auto-generating gRPC Code Using protoc and GoLang
Get the protoc executable up and runnning
The objective of this lesson is to demonstrate how to download
protoc binary executable for the GitHub repository and install it on your computer.
protoc is binary executable that is designed to auto-generate boilerplate gRPC code.
protoc uses the plugin design pattern. Thus, developers can write an add-in for
protoc that will auto-generate code for the given language in a particular way. In this lesson you're going to use
In this lesson we'll be installing
protoc under the Linux operating system. To disover which version of Linux your system is running execute the following command.
Step 1: Create working directory
Step 2: Navigate to working directory
Step 3: Download the release zip from GitHub using
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.12.0-rc2/protoc-3.12.0-rc-2-linux-x86_64.zip
Step 4: Unzip fhe file
Step 5: Copy
protoc in the system's
cp bin/protoc /bin/protoc
/bin is the environment
protoc can be executed from anywhere on the computer.
Step 6: Navigate back to the